提交 c7400cfb 编写于 作者: L liziqiang

fixed afc3ee46 from https://gitee.com/lzq142876/xts_acts_2/pulls/2650

fix window screen time and fix interface errocode
Signed-off-by: Nliziqiang <liziqiang8@huawei.com>
上级 d762b06a
......@@ -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,49 +29,48 @@ 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) => {
window.getTopWindow((err, data) => {
if (err.code != 0) {
console.log('jsunittest faModelOnOffTest1 getTopWindow callback fail ' + JSON.stringify(err.code));
expect().assertFail();
done();
}
expect(data != null).assertTrue();
data.setLayoutFullScreen(true, (err) => {
if (err.code != 0) {
console.log('jsunittest faModelOnOffTest1 getTopWindow callback fail ' + JSON.stringify(err.code));
console.log('jsunittest faModelOnOffTest1 setLayoutFullScreen callback fail ' + JSON.stringify(err.code));
expect().assertFail();
done();
}
expect(data != null).assertTrue();
data.setLayoutFullScreen(true, (err) => {
if (err.code != 0) {
console.log('jsunittest faModelOnOffTest1 setLayoutFullScreen callback fail ' + JSON.stringify(err.code));
expect().assertFail();
done();
} else {
} 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) {
console.log('jsunittest faModelOnOffTest1 setLayoutFullScreen callback fail ' + JSON.stringify(err.code));
expect().assertFail();
done();
} else {
console.log('jsunittest faModelOnOffTest1 listenerStatus 3:' + listenerStatus);
console.log('jsunittest faModelOnOffTest1 off callback success');
done();
}
})
})
data.setLayoutFullScreen(false, (err) => {
console.log('jsunittest faModelOnOffTest1 listenerStatus 2:' + listenerStatus);
if (err.code != 0 || listenerStatus == 1) {
console.log('jsunittest faModelOnOffTest1 setLayoutFullScreen callback fail ' + JSON.stringify(err.code));
expect().assertFail();
done();
} else {
console.log('jsunittest faModelOnOffTest1 listenerStatus 3:' + listenerStatus);
console.log('jsunittest faModelOnOffTest1 off callback success');
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.
先完成此消息的编辑!
想要评论请 注册