diff --git a/miscservices/wallpaper_js/src/main/js/Test/Wallpaper/WallpaperJsunit.test.js b/miscservices/wallpaper_js/src/main/js/Test/Wallpaper/WallpaperJsunit.test.js index df22bd043fe13a86c919ab6220194b9457a5af37..acfb2a48448e92740dacfcc0bbc63d944a0431b6 100644 --- a/miscservices/wallpaper_js/src/main/js/Test/Wallpaper/WallpaperJsunit.test.js +++ b/miscservices/wallpaper_js/src/main/js/Test/Wallpaper/WallpaperJsunit.test.js @@ -13,11 +13,12 @@ * limitations under the License. */ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -import wallpaper from '@ohos.app.wallpaperability' +import wallpaper from '@ohos.wallpaper' const WALLPAPER_SYSTEM = 0; const WALLPAPER_LOCKSCREEN = 1; -var imageSource = '/data/accounts/account_0/appdata/com.test.testApp/wallpaper'; +var imageSourceSystem = '/data/service/el1/public/wallpaper/0/system/wallpaper'; +var imageSourceLockscreen = '/data/service/el1/public/wallpaper/0/lockscreen/wallpaper_lock'; describe('WallpaperJsunitTest', function () { beforeAll(async function () { @@ -44,8 +45,9 @@ describe('WallpaperJsunitTest', function () { * @tc.level 0 */ it('testWALLPAPER_SYSTEM', 0, async function (done) { - console.info('wallpaperXTS ===> testWALLPAPER_SYSTEM : ' + JSON.stringify(wallpaper.WALLPAPER_SYSTEM)); - expect(wallpaper.WALLPAPER_SYSTEM == 0).assertTrue(); + console.info('wallpaperXTS ===> testWALLPAPER_SYSTEM : ' + + JSON.stringify(wallpaper.WallpaperType.WALLPAPER_SYSTEM)); + expect(wallpaper.WallpaperType.WALLPAPER_SYSTEM == 0).assertTrue(); done(); }) @@ -56,8 +58,9 @@ describe('WallpaperJsunitTest', function () { * @tc.level 0 */ it('testWALLPAPER_LOCKSCREEN', 0, async function (done) { - console.info('wallpaperXTS ===> testWALLPAPER_LOCKSCREEN : ' + JSON.stringify(wallpaper.WALLPAPER_LOCKSCREEN)); - expect(wallpaper.WALLPAPER_LOCKSCREEN == 1).assertTrue(); + console.info('wallpaperXTS ===> testWALLPAPER_LOCKSCREEN : ' + + JSON.stringify(wallpaper.WallpaperType.WALLPAPER_LOCKSCREEN)); + expect(wallpaper.WallpaperType.WALLPAPER_LOCKSCREEN == 1).assertTrue(); done(); }) @@ -477,7 +480,7 @@ describe('WallpaperJsunitTest', function () { * @tc.level 0 */ it('testSetWallpaperURLPromiseLock104', 0, async function (done) { - await wallpaper.setWallpaper(imageSource, WALLPAPER_LOCKSCREEN).then((data) => { + await wallpaper.setWallpaper(imageSourceLockscreen, WALLPAPER_LOCKSCREEN).then((data) => { console.info('wallpaperXTS ===> testSetWallpaperURLPromiseLock data : ' + JSON.stringify(data)); if ((data != undefined) && (data != null) && (data != '')) { expect(true).assertTrue(); @@ -498,7 +501,7 @@ describe('WallpaperJsunitTest', function () { * @tc.level 0 */ it('testSetWallpaperURLCallbackSystem103', 0, async function (done) { - await wallpaper.setWallpaper(imageSource, WALLPAPER_SYSTEM, function (err, data) { + await wallpaper.setWallpaper(imageSourceSystem, WALLPAPER_SYSTEM, function (err, data) { console.info('wallpaperXTS ===> testSetWallpaperURLCallbackSystem err : ' + JSON.stringify(err)); console.info('wallpaperXTS ===> testSetWallpaperURLCallbackSystem data : ' + JSON.stringify(data)); if (err) { @@ -524,7 +527,7 @@ describe('WallpaperJsunitTest', function () { done(); return; } - wallpaper.setWallpaper(imageSource, WALLPAPER_SYSTEM).then((data) => { + wallpaper.setWallpaper(imageSourceSystem, WALLPAPER_SYSTEM).then((data) => { console.info('wallpaperXTS ===> testSetWallpaperURLPromiseSystem data : ' + JSON.stringify(data)); if ((data != undefined) && (data != null) && (data != '')) { expect(true).assertTrue(); @@ -545,7 +548,7 @@ describe('WallpaperJsunitTest', function () { * @tc.level 0 */ it('testSetWallpaperURLCallbackLock104', 0, async function (done) { - await wallpaper.setWallpaper(imageSource, WALLPAPER_LOCKSCREEN, function (err, data) { + await wallpaper.setWallpaper(imageSourceLockscreen, WALLPAPER_LOCKSCREEN, function (err, data) { console.info('wallpaperXTS ===> testSetWallpaperURLCallbackLock err : ' + JSON.stringify(err)); console.info('wallpaperXTS ===> testSetWallpaperURLCallbackLock data : ' + JSON.stringify(data)); if (err) {