Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
4bde85ba
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
4bde85ba
编写于
6月 01, 2022
作者:
O
openharmony_ci
提交者:
Gitee
6月 01, 2022
浏览文件
操作
浏览文件
下载
差异文件
!3399 补充窗口xts接口
Merge pull request !3399 from 华华小仙女/master
上级
f3786ec2
a431454b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
246 addition
and
29 deletion
+246
-29
graphic/windowStage/entry/src/main/ets/test/windowCallback.test.ets
...ndowStage/entry/src/main/ets/test/windowCallback.test.ets
+31
-15
graphic/windowStage/entry/src/main/ets/test/windowPromise.test.ets
...indowStage/entry/src/main/ets/test/windowPromise.test.ets
+215
-14
未找到文件。
graphic/windowStage/entry/src/main/ets/test/windowCallback.test.ets
浏览文件 @
4bde85ba
...
@@ -18,7 +18,6 @@ import ohosWindow from '@ohos.window';
...
@@ -18,7 +18,6 @@ import ohosWindow from '@ohos.window';
import display from '@ohos.display';
import display from '@ohos.display';
export default function windowCallbackTest(context, windowStage, abilityStorage) {
export default function windowCallbackTest(context, windowStage, abilityStorage) {
console.log('testets context: ' + JSON.stringify(context))
console.log('testets context: ' + JSON.stringify(context))
console.log('testets context windowStage: ' + JSON.stringify(windowStage));
console.log('testets context windowStage: ' + JSON.stringify(windowStage));
console.log('testets context abilityStorage: ' + JSON.stringify(abilityStorage));
console.log('testets context abilityStorage: ' + JSON.stringify(abilityStorage));
...
@@ -147,15 +146,15 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
...
@@ -147,15 +146,15 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
}
}
expect(!data).assertTrue();
expect(!data).assertTrue();
mainWnd.setSystemBarEnable([], (err, data) => {
mainWnd.setSystemBarEnable([], (err, data) => {
console.log(msgStr + 'mainWnd.setSystemBarEnable [] JSON.stringfy(data)==' + JSON.stringify(data));
console.log(msgStr + 'mainWnd.setSystemBarEnable [] JSON.string
i
fy(data)==' + JSON.stringify(data));
if (err && err.code) {
if (err && err.code) {
unexpectedError(data, caseName, 'mainWnd.setSystemBarEnable []', done);
unexpectedError(data, caseName, 'mainWnd.setSystemBarEnable []', done);
}
}
expect(!data).assertTrue();
expect(!data).assertTrue();
mainWnd.setSystemBarEnable([null, '123'], (err, data) => {
mainWnd.setSystemBarEnable([null, '123'], (err, data) => {
console.log(msgStr + 'mainWnd.setSystemBarEnable [null,123] JSON.stringfy(data)==' + JSON.stringify(data));
console.log(msgStr + 'mainWnd.setSystemBarEnable [null,123] JSON.string
i
fy(data)==' + JSON.stringify(data));
console.log(msgStr + 'mainWnd.setSystemBarEnable [null,123] JSON.stringfy(err)==' + JSON.stringify(err));
console.log(msgStr + 'mainWnd.setSystemBarEnable [null,123] JSON.string
i
fy(err)==' + JSON.stringify(err));
if (err && err.code) {
if (err && err.code) {
expect(err.code === 130).assertTrue();
expect(err.code === 130).assertTrue();
done();
done();
...
@@ -744,10 +743,10 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
...
@@ -744,10 +743,10 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
})
})
})
})
/**
/**
* @tc.number SUB_WINDOW_DESTROY_JSAPI_002
* @tc.number SUB_WINDOW_DESTROY_JSAPI_002
* @tc.name Test destroyTest2
* @tc.name Test destroyTest2
* @tc.desc Verification window destruction scenario
* @tc.desc Verification window destruction scenario
*/
*/
it('destroyTest2', 0, function (done) {
it('destroyTest2', 0, function (done) {
let caseName = 'destroyTest2';
let caseName = 'destroyTest2';
let msgStr = 'jsunittest ' + caseName + ' ';
let msgStr = 'jsunittest ' + caseName + ' ';
...
@@ -824,10 +823,10 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
...
@@ -824,10 +823,10 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
})
})
})
})
/**
/**
* @tc.number SUB_WINDOW_LOADCONTENT_JSAPI_008
* @tc.number SUB_WINDOW_LOADCONTENT_JSAPI_008
* @tc.name Test loadContentTest8
* @tc.name Test loadContentTest8
* @tc.desc Verify the scenario of loading a page that does not exist
* @tc.desc Verify the scenario of loading a page that does not exist
*/
*/
it('loadContentTest8', 0, function (done) {
it('loadContentTest8', 0, function (done) {
let caseName = 'loadContentTest8';
let caseName = 'loadContentTest8';
let msgStr = 'jsunittest ' + caseName + ' ';
let msgStr = 'jsunittest ' + caseName + ' ';
...
@@ -899,6 +898,23 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
...
@@ -899,6 +898,23 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
});
});
})
})
/**
/**
* @tc.number SUB_WINDOW_LOADCONTENT_JSAPI_012
* @tc.name Test loadContentTest12
* @tc.desc Verify the scenario of loading an existing page
*/
it('loadContentTest12', 0, function (done) {
let caseName = 'loadContentTest12';
let msgStr = 'jsunittest ' + caseName + ' ';
console.log(msgStr + 'begin');
windowStage.loadContent(null, abilityStorage, (err, data) => {
if (err && err.code) {
expectedError(err, caseName, 'windowStage.loadContent', done,130);
console.log(msgStr + 'windowStage.loadContent(pages/index/index.ets)' + JSON.stringify(err));
}
done();
});
})
/**
* @tc.number SUB_WINDOW_CREATESUBWINDOW_JSAPI_003
* @tc.number SUB_WINDOW_CREATESUBWINDOW_JSAPI_003
* @tc.name Test createSubWindowTest3
* @tc.name Test createSubWindowTest3
* @tc.desc Verify the scenario of creating an auxiliary window
* @tc.desc Verify the scenario of creating an auxiliary window
...
@@ -968,8 +984,8 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
...
@@ -968,8 +984,8 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
let msgStr = 'jsunittest ' + caseName + ' ';
let msgStr = 'jsunittest ' + caseName + ' ';
console.log(msgStr + 'begin ohosWindow =' + JSON.stringify(ohosWindow));
console.log(msgStr + 'begin ohosWindow =' + JSON.stringify(ohosWindow));
let mainWnd = null;
let mainWnd = null;
ohosWindow.create(context,'setPrivacyModeTest2', ohosWindow.WindowType.TYPE_SYSTEM_ALERT, (err, data) => {
ohosWindow.create(context,
'setPrivacyModeTest2', ohosWindow.WindowType.TYPE_SYSTEM_ALERT, (err, data) => {
if (err
&&
err.code) {
if (err
&&
err.code) {
console.log(msgStr + 'ohosWindow.create fail err:' + JSON.stringify(err));
console.log(msgStr + 'ohosWindow.create fail err:' + JSON.stringify(err));
expect().assertFail();
expect().assertFail();
done();
done();
...
@@ -1040,7 +1056,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
...
@@ -1040,7 +1056,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
console.log(msgStr + 'begin ohosWindow =' + JSON.stringify(ohosWindow));
console.log(msgStr + 'begin ohosWindow =' + JSON.stringify(ohosWindow));
let mainWnd = null;
let mainWnd = null;
windowStage.createSubWindow('setPrivacyModeTest3', (err, data) => {
windowStage.createSubWindow('setPrivacyModeTest3', (err, data) => {
if (err
&&
err.code) {
if (err
&&
err.code) {
console.log(msgStr + 'windowStage.createSubWindow fail err:' + JSON.stringify(err));
console.log(msgStr + 'windowStage.createSubWindow fail err:' + JSON.stringify(err));
expect().assertFail();
expect().assertFail();
done();
done();
...
...
graphic/windowStage/entry/src/main/ets/test/windowPromise.test.ets
浏览文件 @
4bde85ba
...
@@ -95,6 +95,7 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
...
@@ -95,6 +95,7 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
function expectedError(error, caseName, apiName, done, code) {
function expectedError(error, caseName, apiName, done, code) {
let msgStr = 'jsunittest ' + caseName + ' ' + apiName + ' failed, err: ';
let msgStr = 'jsunittest ' + caseName + ' ' + apiName + ' failed, err: ';
console.log(msgStr + JSON.stringify(error));
console.log(msgStr + JSON.stringify(error));
console.log(msgStr + 'code:' + code);
if (error.code === code) {
if (error.code === code) {
expect(TRUE_FLAG).assertTrue();
expect(TRUE_FLAG).assertTrue();
}
}
...
@@ -115,7 +116,211 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
...
@@ -115,7 +116,211 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
}, time);
}, time);
})
})
}
}
/**
* @tc.number SUB_WINDOW_ON_OFF_JSAPI_001
* @tc.name Test listenerTest1
* @tc.desc Verify whether the change monitoring of avoidance area can be started normally.
*/
it('listenerTest1', 0, async function (done) {
let caseName = 'listenerTest1';
let msgStr = 'jsunittest ' + caseName + ' ';
let listenerOnFlag = listenerStatus.ready;
console.log(msgStr + 'begin');
let tempWnd = await windowStage.getMainWindow().catch((err) => {
unexpectedError(err, caseName, 'windowStage.getMainWindow', done);
});
console.log(msgStr + 'windowStage.getMainWindow, tempWnd: ' + tempWnd);
listenerData.on = true;
listenerData.typeStr = 'systemAvoidAreaChange';
tempWnd.on('systemAvoidAreaChange', (avoidAreaData) => {
console.log(msgStr + 'tempWnd.on systemAvoidAreaChange, systemBatData : ' + JSON.stringify(avoidAreaData));
if (listenerOnFlag === listenerStatus.pending) {
listenerOnFlag = listenerStatus.finished;
expect(!!avoidAreaData).assertTrue();
done();
}
})
expect(!!tempWnd).assertTrue();
await tempWnd.show().catch((err) => {
unexpectedError(err, caseName, 'tempWnd.show', done);
});
console.log(msgStr + 'tempWnd.show success');
await tempWnd.setFullScreen(true).catch((err) => {
unexpectedError(err, caseName, 'tempWnd.setFullScreen(true)', done);
});
console.log(msgStr + 'tempWnd.setFullScreen(true) success');
await tempWnd.setSystemBarEnable([]).catch((err) => {
unexpectedError(err, caseName, 'tempWnd.setSystemBarEnable([])', done);
});
console.log(msgStr + 'tempWnd.setSystemBarEnable([]) success');
console.log(msgStr + 'tempWnd.on systemAvoidAreaChange finished');
await sleep(1000);
listenerOnFlag = listenerStatus.pending;
await tempWnd.setSystemBarEnable(['status', 'navigation']).catch((err) => {
unexpectedError(err, caseName, 'tempWnd.setSystemBarEnable([status, navigation])', done);
});
console.log(msgStr + 'tempWnd.setSystemBarEnable([status, navigation]) success');
})
/**
* @tc.number SUB_WINDOW_ON_OFF_JSAPI_002
* @tc.name Test listenerTest2
* @tc.desc Verify that the window size avoidance area changes and monitor whether it can be opened normally.
*/
it('listenerTest2', 0, async function (done) {
let caseName = 'listenerTest2';
let msgStr = 'jsunittest ' + caseName + ' ';
let wndId = 'listenerTest2';
let baseType = 2;
let changedModel = 102;
let baseValue = 100;
let resizeValue = 200;
let listenerOnFlag = listenerStatus.ready;
console.log(msgStr + 'begin');
let tempWnd = await ohosWindow.create(context, wndId, baseType).catch((err) => {
unexpectedError(err, caseName, 'ohosWindow.create ' + baseType, done);
});
console.log(msgStr + 'ohosWindow.create ' + baseType + ', tempWnd: ' + tempWnd);
expect(!!tempWnd).assertTrue();
listenerData.on = true;
listenerData.typeStr = 'windowSizeChange';
tempWnd.on('windowSizeChange', (sizeData) => {
console.log(msgStr + 'tempWnd.on windowSizeChange, systemBatData : ' + JSON.stringify(sizeData));
if (listenerOnFlag === listenerStatus.pending) {
listenerOnFlag = listenerStatus.finished;
expect(!!sizeData).assertTrue();
expect(sizeData.width === resizeValue).assertTrue();
expect(sizeData.height === resizeValue).assertTrue();
done();
}
})
await tempWnd.show().catch((err) => {
unexpectedError(err, caseName, 'tempWnd.show', done);
});
console.log(msgStr + 'tempWnd.show success');
await tempWnd.setWindowMode(changedModel).catch((err) => {
unexpectedError(err, caseName, 'tempWnd.setWindowMode ' + changedModel, done);
});
console.log(msgStr + 'tempWnd.setWindowMode ' + changedModel + ' success');
await tempWnd.resetSize(baseValue, baseValue).catch((err) => {
unexpectedError(err, caseName, 'tempWnd.resetSize(' + baseValue + ', ' + baseValue + ')', done);
});
console.log(msgStr + 'tempWnd.resetSize(' + baseValue + ', ' + baseValue + ') success');
console.log(msgStr + 'tempWnd.on windowSizeChange finished');
await sleep(1000);
listenerOnFlag = listenerStatus.pending;
await tempWnd.resetSize(resizeValue, resizeValue).catch((err) => {
unexpectedError(err, caseName, 'tempWnd.resetSize(' + resizeValue + ', ' + resizeValue + ')', done);
});
console.log(msgStr + 'tempWnd.resetSize(' + resizeValue + ', ' + resizeValue + ') success');
})
/**
* @tc.number SUB_WINDOW_ON_OFF_JSAPI_003
* @tc.name Test listenerTest3
* @tc.desc Verify whether the change monitoring of avoidance area can be started normally.
*/
it('listenerTest3', 0, async function (done) {
let caseName = 'listenerTest3';
let msgStr = 'jsunittest ' + caseName + ' ';
let listenerOffFlag = listenerStatus.ready;
console.log(msgStr + 'begin');
let tempWnd = await windowStage.getMainWindow().catch((err) => {
unexpectedError(err, caseName, 'windowStage.getMainWindow', done);
});
console.log(msgStr + 'windowStage.getMainWindow, tempWnd: ' + tempWnd);
expect(!!tempWnd).assertTrue();
listenerData.on = true;
listenerData.typeStr = 'systemAvoidAreaChange';
tempWnd.on('systemAvoidAreaChange', (avoidAreaData) => {
console.log(msgStr + 'tempWnd.on systemAvoidAreaChange, systemBatData : ' + JSON.stringify(avoidAreaData));
setTimeout(() => {
console.log(msgStr + 'tempWnd.on systemAvoidAreaChange, systemBatData 1100 : ' + JSON.stringify(avoidAreaData));
}, 1100)
done();
})
console.log(msgStr + 'tempWnd.on systemAvoidAreaChange finished');
await tempWnd.show().catch((err) => {
unexpectedError(err, caseName, 'tempWnd.show', done);
});
console.log(msgStr + 'tempWnd.show success');
await tempWnd.setFullScreen(true).catch((err) => {
unexpectedError(err, caseName, 'tempWnd.setFullScreen(true)', done);
});
console.log(msgStr + 'tempWnd.setFullScreen(true) success');
await tempWnd.setSystemBarEnable([]).catch((err) => {
unexpectedError(err, caseName, 'tempWnd.setSystemBarEnable([])', done);
});
console.log(msgStr + 'tempWnd.setSystemBarEnable([]) success');
await sleep(1000);
tempWnd.off('systemAvoidAreaChange');
console.log(msgStr + 'tempWnd.off systemAvoidAreaChange finished');
await sleep(1200);
listenerOffFlag = listenerStatus.pending;
await tempWnd.setSystemBarEnable(['status', 'navigation']).catch((err) => {
unexpectedError(err, caseName, 'tempWnd.setSystemBarEnable([status, navigation])', done);
});
console.log(msgStr + 'tempWnd.setSystemBarEnable([status, navigation]) success');
})
/**
* @tc.number SUB_WINDOW_ON_OFF_JSAPI_004
* @tc.name Test listenerTest4
* @tc.desc Verify whether the window size change monitoring can be closed normally.
*/
it('listenerTest4', 0, async function (done) {
let caseName = 'listenerTest4';
let msgStr = 'jsunittest ' + caseName + ' ';
let wndId = 'listenerTest4';
let baseType = 2;
let changedModel = 102;
let listenerOffFlag = listenerStatus.ready;
console.log(msgStr + 'begin');
let tempWnd = await ohosWindow.create(context, wndId, baseType).catch((err) => {
unexpectedError(err, caseName, 'ohosWindow.create ' + baseType, done);
});
console.log(msgStr + 'ohosWindow.create ' + baseType + ', tempWnd: ' + tempWnd);
expect(!!tempWnd).assertTrue();
listenerData.on = true;
listenerData.typeStr = 'windowSizeChange';
tempWnd.on('windowSizeChange', (sizeData) => {
console.log(msgStr + 'tempWnd.on windowSizeChange, sizeData : ' + JSON.stringify(sizeData));
if (listenerOffFlag === listenerStatus.pending) {
listenerOffFlag = listenerStatus.finished;
unexpectedError(null, caseName, 'off windowSizeChange', done)
}
})
await tempWnd.show().catch((err) => {
unexpectedError(err, caseName, 'tempWnd.show', done);
});
console.log(msgStr + 'tempWnd.show success');
await tempWnd.setWindowMode(changedModel).catch((err) => {
unexpectedError(err, caseName, 'tempWnd.setWindowMode ' + changedModel, done);
});
console.log(msgStr + 'tempWnd.setWindowMode ' + changedModel + ' success');
await tempWnd.resetSize(100, 100).catch((err) => {
unexpectedError(err, caseName, 'tempWnd.resetSize(100, 100)', done);
});
console.log(msgStr + 'tempWnd.resetSize(100, 100) success');
console.log(msgStr + 'tempWnd.on windowSizeChange finished');
await sleep(1000);
tempWnd.off('windowSizeChange');
console.log(msgStr + 'tempWnd.off windowSizeChange finished');
sleep(1000);
listenerOffFlag = listenerStatus.pending;
await tempWnd.resetSize(200, 200).catch((err) => {
unexpectedError(err, caseName, 'tempWnd.resetSize(200, 200)', done);
});
console.log(msgStr + 'tempWnd.resetSize(200, 200) success');
setTimeout(() => {
if (listenerOffFlag === listenerStatus.finished) {
let apiStr = 'tempWnd.off windowSizeChange time wait';
unexpectedError(null, caseName, apiStr, done);
} else {
console.log(msgStr + 'tempWnd.off windowSizeChange time wait');
done();
}
}, 5000)
})
/**
/**
* @tc.number SUB_WINDOW_SETSYSTEMBARENABLE_JSAPI_001
* @tc.number SUB_WINDOW_SETSYSTEMBARENABLE_JSAPI_001
* @tc.name Test setSystemBarEnableTest1
* @tc.name Test setSystemBarEnableTest1
...
@@ -784,12 +989,12 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
...
@@ -784,12 +989,12 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
expect(!!tempWnd).assertTrue();
expect(!!tempWnd).assertTrue();
console.log(msgStr + 'tempWnd.loadContent start');
console.log(msgStr + 'tempWnd.loadContent start');
let errFlag = false;
let errFlag = false;
await tempWnd.loadContent(null).catch((err) => {
let loadContentData =
await tempWnd.loadContent(null).catch((err) => {
errFlag = true;
errFlag = true;
expectedError(err, caseName, 'tempWnd.loadContent', done, 130);
expectedError(err, caseName, 'tempWnd.loadContent', done, 130);
console.log(msgStr + 'tempWnd.loadContent(null)' + JSON.stringify(err));
console.log(msgStr + 'tempWnd.loadContent(null)' + JSON.stringify(err));
});
});
console.log(msgStr + 'tempWnd.loadContent
end'
);
console.log(msgStr + 'tempWnd.loadContent
loadContentData:' + JSON.stringify(loadContentData)
);
if (!errFlag) {
if (!errFlag) {
console.log(msgStr + 'should report err');
console.log(msgStr + 'should report err');
expect(TRUE_FLAG).assertFail();
expect(TRUE_FLAG).assertFail();
...
@@ -823,12 +1028,11 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
...
@@ -823,12 +1028,11 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
let caseName = 'loadContentTest5';
let caseName = 'loadContentTest5';
let msgStr = 'jsunittest ' + caseName + ' ';
let msgStr = 'jsunittest ' + caseName + ' ';
console.log(msgStr + 'begin');
console.log(msgStr + 'begin');
let load5 = await windowStage.loadContent(
'pages/index/index.ets'
, abilityStorage).catch((err) => {
let load5 = await windowStage.loadContent(
null
, abilityStorage).catch((err) => {
unexpectedError(err, caseName, 'tempWnd.loadContent', done
);
expectedError(err, caseName, 'tempWnd.loadContent', done, 130
);
console.log(msgStr + 'tempWnd.loadContent(pages/index/index.ets)' + JSON.stringify(err));
console.log(msgStr + 'tempWnd.loadContent(pages/index/index.ets)' + JSON.stringify(err));
});
});
expect(!load5).assertTrue();
console.log(msgStr + 'tempWnd.loadContent end load5=' + JSON.stringify(load5));
console.log(msgStr + 'tempWnd.loadContent end load=' + JSON.stringify(load5));
done();
done();
})
})
/**
/**
...
@@ -908,19 +1112,18 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
...
@@ -908,19 +1112,18 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
let msgStr = 'jsunittest ' + caseName + ' ';
let msgStr = 'jsunittest ' + caseName + ' ';
console.log(msgStr + 'begin ');
console.log(msgStr + 'begin ');
let mainWnd = null;
let mainWnd = null;
let windowData = await ohosWindow.create(context,
'setPrivacyModeTest1', ohosWindow.WindowType.TYPE_SYSTEM_ALERT).catch((err) => {
let windowData = await ohosWindow.create(context,
'setPrivacyModeTest1', ohosWindow.WindowType.TYPE_SYSTEM_ALERT)
unexpectedError(err, caseName, 'ohosWindow.create', done);
.catch((err) => {
done(
);
unexpectedError(err, caseName, 'ohosWindow.create', done
);
})
})
expect(!!windowData).assertTrue();
expect(!!windowData).assertTrue();
console.log(msgStr + 'window.create success windowData' + windowData);
console.log(msgStr + 'window.create success windowData' + windowData);
mainWnd = windowData;
mainWnd = windowData;
let firstPro = await mainWnd.getProperties().catch((err, data) => {
let firstPro = await mainWnd.getProperties().catch((err, data) => {
unexpectedError(err, caseName, 'mainWnd.getProperties', done);
unexpectedError(err, caseName, 'mainWnd.getProperties', done);
done();
})
})
expect(!firstPro.isPrivacyMode).assertTrue();
console.log(msgStr + 'mainWnd.getProperties firstPro=' + JSON.stringify(firstPro));
console.log(msgStr + 'mainWnd.getProperties firstPro=' + JSON.stringify(firstPro));
expect(!firstPro.isPrivacyMode).assertTrue();
let firstPrivacyMode = await mainWnd.setPrivacyMode(true).catch((err, data) => {
let firstPrivacyMode = await mainWnd.setPrivacyMode(true).catch((err, data) => {
unexpectedError(err, caseName, 'mainWnd.setPrivacyMode', done);
unexpectedError(err, caseName, 'mainWnd.setPrivacyMode', done);
console.log(msgStr + 'mainWnd.setPrivacyMode(true) err=' + JSON.stringify(err));
console.log(msgStr + 'mainWnd.setPrivacyMode(true) err=' + JSON.stringify(err));
...
@@ -929,7 +1132,6 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
...
@@ -929,7 +1132,6 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
console.log(msgStr + 'mainWnd.setPrivacyMode true firstPrivacyMode=' + JSON.stringify(firstPrivacyMode));
console.log(msgStr + 'mainWnd.setPrivacyMode true firstPrivacyMode=' + JSON.stringify(firstPrivacyMode));
let secondPro = await mainWnd.getProperties().catch((err, data) => {
let secondPro = await mainWnd.getProperties().catch((err, data) => {
unexpectedError(err, caseName, 'mainWnd.getProperties', done);
unexpectedError(err, caseName, 'mainWnd.getProperties', done);
done();
})
})
console.log(msgStr + 'mainWnd.getProperties secondPro:' + JSON.stringify(secondPro.isPrivacyMode));
console.log(msgStr + 'mainWnd.getProperties secondPro:' + JSON.stringify(secondPro.isPrivacyMode));
expect(secondPro.isPrivacyMode).assertTrue();
expect(secondPro.isPrivacyMode).assertTrue();
...
@@ -941,7 +1143,6 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
...
@@ -941,7 +1143,6 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
console.log(msgStr + 'mainWnd.setPrivacyMode(false) secondPrivacyMode=' + JSON.stringify(secondPrivacyMode));
console.log(msgStr + 'mainWnd.setPrivacyMode(false) secondPrivacyMode=' + JSON.stringify(secondPrivacyMode));
let lastPro = await mainWnd.getProperties().catch((err, data) => {
let lastPro = await mainWnd.getProperties().catch((err, data) => {
unexpectedError(err, caseName, 'mainWnd.getProperties', done);
unexpectedError(err, caseName, 'mainWnd.getProperties', done);
done();
})
})
console.log(msgStr + 'mainWnd.getProperties lastPro:' + JSON.stringify(lastPro.isPrivacyMode));
console.log(msgStr + 'mainWnd.getProperties lastPro:' + JSON.stringify(lastPro.isPrivacyMode));
expect(!lastPro.isPrivacyMode).assertTrue();
expect(!lastPro.isPrivacyMode).assertTrue();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录