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

!2650 【窗口子系统】修改窗口截屏用例耗时 和 修改接口错误码

Merge pull request !2650 from liziqiang/master
......@@ -24,5 +24,8 @@ export default {
},
onInit() {
this.title = this.$t('strings.world');
const configService = core.getDefaultService('config');
this.timeout = 15000;
configService.setConfig(this);
}
}
......@@ -17,5 +17,5 @@ require('./window.api.part2.js')
require('./window.test.js')
require('./window.parameter.js')
require('./window.promise.js')
require('./display.screenshot.api.js')
require('./screenshot.test.js')
......@@ -29,16 +29,15 @@ describe('window_api_test', function() {
* @tc.name Test faModelOnOffTest1.
* @tc.desc To verify the function of enabling and disabling the monitoring function for tone change on the system bar..
*/
it('faModelOnOffTest1', 0, async function(done) {
it('faModelOnOffTest1', 0, async function(done) {
console.log('jsunittest faModelOnOffTest1 begin');
var listenerStatus; //1表示开启 其他为关闭
var listenerStatus;
var callback = (data) => {
console.log('jsunittest faModelOnOffTest1 create callback ' + JSON.stringify(data));
listenerStatus = 1;
console.log('jsunittest faModelOnOffTest1 listenerStatus 1: ' + listenerStatus);
}
window.on('systemBarTintChange', callback);
setTimeout(() => {
window.getTopWindow((err, data) => {
if (err.code != 0) {
console.log('jsunittest faModelOnOffTest1 getTopWindow callback fail ' + JSON.stringify(err.code));
......@@ -52,10 +51,10 @@ describe('window_api_test', function() {
expect().assertFail();
done();
} else {
setTimeout(() => {
expect(listenerStatus == 1).assertTrue();
window.off('systemBarTintChange');
listenerStatus = 0;
}
data.setLayoutFullScreen(false, (err) => {
console.log('jsunittest faModelOnOffTest1 listenerStatus 2:' + listenerStatus);
if (err.code != 0 || listenerStatus == 1) {
......@@ -68,10 +67,10 @@ describe('window_api_test', function() {
done();
}
})
}, 2000);
}
})
})
}, 1000);
})
/**
......@@ -101,7 +100,6 @@ describe('window_api_test', function() {
if (err.code != 0) {
console.log('jsunittest faModelOnOffTest2 setLayoutFullScreen callback fail ' + JSON.stringify(err.code));
expect().assertFail();
done();
} else {
setTimeout((async function() {
console.log('jsunittest faModelOnOffTest2 listenerStatus 111: ' + listenerStatus);
......@@ -759,7 +757,7 @@ describe('window_api_test', function() {
console.log('jsunittest faModelSetColorSpaceTest4 setColorSpace callback begin' + JSON.stringify(err));
if (err.code != 0) {
console.log('jsunittest faModelSetColorSpaceTest4 setColorSpace callback fail' + JSON.stringify(err.code));
expect(err.code).assertEqual(120);
expect(err.code).assertEqual(130);
done();
} else {
expect().assertFail();
......
......@@ -84,7 +84,7 @@ describe('window_test', function() {
done();
}).catch((err) => {
console.log('jsunittest faModelSetColorSpaceTest2 wnd.setColorSpace failed, err :' + JSON.stringify(err));
expect(err.code).assertEqual(120);
expect(err.code).assertEqual(130);
done();
})
}).catch((err) => {
......@@ -462,7 +462,7 @@ describe('window_test', function() {
done();
})
})
}, 1000)
}, 3000)
}).catch((err) => {
console.log('jsunittest faModelMinimizeAllTest1 minimizeAll failed, err :' + JSON.stringify(err));
expect().assertFail();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册