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

!6513 【窗口子系统】优化windowCallback_test#setSystemBarPropertiesTest5用例

Merge pull request !6513 from 华华小仙女/master
......@@ -695,6 +695,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
}
let arrLength = systemBarData.regionTint.length;
for (let i = 0; i < arrLength; i++) {
console.log(msgStr + 'for arrLenght compareCount: ' + compareCount + ' ,i:'+i);
let tempData = systemBarData.regionTint[i];
if (tempData.type === ohosWindow.WindowType.TYPE_STATUS_BAR) {
console.log(msgStr + 'systemBarTintChange compare start! arrLength= ' + arrLength);
......@@ -711,6 +712,19 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
} else {
console.log(msgStr + 'SCC tempData.contentColor:' + JSON.stringify(tempData.contentColor));
}
let ca = cloneColorArr;
let flag = ca.NCC.length || ca.NBC.length || ca.SBC.length || ca.SCC.length
if (compareCount === 18 && !flag) {
console.log(msgStr + 'if compareCount: ' + compareCount + ' ,true flag:' + flag);
try {
expect(true).assertTrue();
} catch (error) {
console.info(`ohosWindow.on catch error: ${JSON.stringify(error)}`)
}
done();
} else {
console.log(msgStr + 'compareCount: ' + compareCount + ' ,flag:' + flag);
}
console.log(msgStr + 'compareCount: ' + compareCount + ' ,length: ' + JSON.stringify(cloneColorArr.SCC.length) + ' ,cloneColorArr.SBC:' + JSON.stringify(cloneColorArr.SBC));
console.log(msgStr + 'compareCount: ' + compareCount + ' ,length: ' + JSON.stringify(cloneColorArr.SCC.length) + ' ,cloneColorArr.SCC' + JSON.stringify(cloneColorArr.SCC));
} else if (tempData.type === ohosWindow.WindowType.TYPE_NAVIGATION_BAR) {
......@@ -731,7 +745,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
let ca = cloneColorArr;
let flag = ca.NCC.length || ca.NBC.length || ca.SBC.length || ca.SCC.length
if (compareCount === 18 && !flag) {
console.log(msgStr + 'compareCount: ' + compareCount + ' ,true flag:' + flag);
console.log(msgStr + 'else compareCount: ' + compareCount + ' ,true flag:' + flag);
try {
expect(true).assertTrue();
} catch (error) {
......@@ -793,6 +807,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
listenerFlag = listenerStatus.pending;
let loopCount = commonNUMBERColorArr.length
for (let i = 0; i < loopCount; i++) {
console.log(msgStr+'tempWnd.setSystemBarEnable i:'+i);
let tempColor = commonNUMBERColorArr[i];
let systemBarProperties = {
statusBarColor: tempColor,
......@@ -811,7 +826,6 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
} catch (error) {
console.info(`tempWnd.setSystemBarProperties catch error: ${JSON.stringify(error)}`)
}
done();
}
})
}
......@@ -1188,7 +1202,9 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
}
let loopCount1 = systemWindowTypeArr;
console.log(msgStr + 'ohosWindow.windowType' + JSON.stringify(loopCount1))
for (let i = 0; i < loopCount1.length; i++) {
getData(0, loopCount1.length)
function getData(i, length) {
let tempType = ohosWindow.WindowType[loopCount1[i]];
console.log(msgStr + 'tempWnd.setWindowType ' + tempType + ' start');
tempTypeArr.push(tempType);
......@@ -1211,7 +1227,6 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
console.log(msgStr + 'tempWnd.getProperties dataProper: ' + JSON.stringify(dataProper));
console.log(msgStr + 'tempWnd.getProperties !!dataProper: ' + !!dataProper);
try {
expect(!!dataProper).assertTrue();
} catch (error) {
console.info(`tempWnd.getProperties catch error: ${JSON.stringify(error)}`)
......@@ -1223,8 +1238,14 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
console.log(msgStr + 'tempWnd.getProperties true tempTypeArr.length: ' + tempTypeArr.length);
console.log(msgStr + 'tempWnd.getProperties true loopCount1.length: ' + loopCount1.length);
console.log(msgStr + 'tempWnd.getProperties true tempTypeArr.length + 1: ' + Number(tempTypeArr.length + 1));
console.log(msgStr + 'tempWnd.getProperties true (loopCount1.length - i): ' + (loopCount1.length - i));
console.log(msgStr + 'tempWnd.getProperties true (tempTypeArr.length + 1): ' + (tempTypeArr.length + 1));
try {
expect((loopCount1.length - i) == (tempTypeArr.length + 1)).assertTrue();
expect(tempTypeArr.length === 0).assertTrue();
if (++i < length) {
getData(i, length)
console.log(msgStr + 'jixuzhixing i: ' + i);
}
} catch (error) {
console.info(`tempWnd.getProperties catch error: ${JSON.stringify(error)}`)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册