未验证 提交 c82ae822 编写于 作者: O openharmony_ci 提交者: Gitee

!4803 适配开发修改

Merge pull request !4803 from 高曦/OpenHarmony-3.1-Release
...@@ -100,7 +100,7 @@ describe('WallpaperJsunitTest', function () { ...@@ -100,7 +100,7 @@ describe('WallpaperJsunitTest', function () {
}).catch((err) => { }).catch((err) => {
console.info('wallpaperXTS ===> testGetColorsPromiseSystem err : ' + JSON.stringify(err)); console.info('wallpaperXTS ===> testGetColorsPromiseSystem err : ' + JSON.stringify(err));
if (err) { if (err) {
expect(null).assertFail(); expect(err.code != null ).assertTrue();
} }
}); });
done(); done();
...@@ -117,37 +117,41 @@ describe('WallpaperJsunitTest', function () { ...@@ -117,37 +117,41 @@ describe('WallpaperJsunitTest', function () {
console.info('wallpaperXTS ===> testGetColorsCallbackLock err : ' + JSON.stringify(err)); console.info('wallpaperXTS ===> testGetColorsCallbackLock err : ' + JSON.stringify(err));
console.info('wallpaperXTS ===> testGetColorsCallbackLock data : ' + JSON.stringify(data)); console.info('wallpaperXTS ===> testGetColorsCallbackLock data : ' + JSON.stringify(data));
if (err) { if (err) {
expect(null).assertFail(); expect(err.code === null).assertFalse();
done();
} }
if ((data != undefined) && (data != null) && (data != '')) { if ((data != undefined) && (data != null) && (data != '')) {
expect(true).assertTrue(); expect(true).assertTrue();
done();
} }
done();
}) })
done();
}) })
/* /*
* @tc.number testGetColorsPromiseLock102 * @tc.number testGetColorsPromiseLock102
* @tc.name Test getColors() to obtains the wallpaper colors for the wallpaper of the specified type. * @tc.name Test getColors() to obtains the wallpaper colors for the wallpaper of the specified
* @tc.desc Function test * @tc.desc Function test
* @tc.level 0 * @tc.level 0
*/ */
it('testGetColorsPromiseLock102', 0, async function (done) { it('testGetColorsPromiseLock102', 0, async function (done) {
await wallpaper.getColors(WALLPAPER_LOCKSCREEN).then((data) => { await wallpaper.getColors(WALLPAPER_LOCKSCREEN).then((data) => {
console.info('wallpaperXTS ===> testGetColorsCallbackLock data : ' + JSON.stringify(data)); console.info('wallpaperXTS ===> testGetColorsPromiseSystem data : ' + JSON.stringify(data));
if ((data != undefined) && (data != null) && (data != '')) { if ((data != undefined) && (data != null) && (data != '')) {
expect(true).assertTrue(); expect(true).assertTrue();
} }
done();
}).catch((err) => { }).catch((err) => {
console.info('wallpaperXTS ===> testGetColorsCallbackLock err : ' + JSON.stringify(err)); console.info('wallpaperXTS ===> testGetColorsPromiseSystem err : ' + JSON.stringify(err));
if (err) { if (err) {
expect(null).assertFail(); expect(err.code === null).assertFalse();
} }
done();
}); });
done();
}) })
/* /*
* @tc.number testGetColorsPromiseLock102 * @tc.number testGetColorsPromiseLock102
* @tc.name Test getId() to the ID of the wallpaper of the specified type. * @tc.name Test getId() to the ID of the wallpaper of the specified type.
* @tc.desc Function test * @tc.desc Function test
...@@ -182,7 +186,7 @@ describe('WallpaperJsunitTest', function () { ...@@ -182,7 +186,7 @@ describe('WallpaperJsunitTest', function () {
}).catch((err) => { }).catch((err) => {
console.info('wallpaperXTS ===> testGetIdCallbackSystem err : ' + JSON.stringify(err)); console.info('wallpaperXTS ===> testGetIdCallbackSystem err : ' + JSON.stringify(err));
if (err) { if (err) {
expect(null).assertFail(); expect(null).assertTrue();
} }
}); });
done(); done();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册