提交 e5b222d0 编写于 作者: Y yaocui

update

Signed-off-by: Nyaocui <yaocui2@h-partners.com>
上级 d661dc77
...@@ -730,13 +730,14 @@ export default function windowCallbackTest(context, windowStage, abilityStorage) ...@@ -730,13 +730,14 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
function setSystemBarPropertiesFun(tempWnd, systemBarProperties) { function setSystemBarPropertiesFun(tempWnd, systemBarProperties) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
tempWnd.setSystemBarProperties(systemBarProperties, (err) => { tempWnd.setSystemBarProperties(systemBarProperties, (err, data) => {
if (err && err.code) { if (err && err.code) {
reject(err) reject(null)
} else { } else {
console.log(msgStr + 'tempWnd.setSystemBarProperties ' + JSON.stringify(systemBarProperties) + ' success'); console.log(msgStr + 'tempWnd.setSystemBarProperties ' + JSON.stringify(systemBarProperties) + ' success');
resolve(true) resolve(true)
} }
}) })
}) })
} }
...@@ -761,10 +762,8 @@ export default function windowCallbackTest(context, windowStage, abilityStorage) ...@@ -761,10 +762,8 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
}; };
await setSystemBarPropertiesFun(tempWnd, systemBarProperties).catch((err) => { await setSystemBarPropertiesFun(tempWnd, systemBarProperties).catch((err) => {
console.info(msgStr + 'setSystemBarProperties error : ' + JSON.stringify(err)); console.info(msgStr + 'setSystemBarProperties error : ' + JSON.stringify(err));
if(err.code!==801){ expect().assertFail();
expect().assertFail(); done();
done();
}
}); });
} }
done(); done();
...@@ -908,7 +907,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage) ...@@ -908,7 +907,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
tempWnd.setSystemBarProperties(systemBarProperties, (err, data) => { tempWnd.setSystemBarProperties(systemBarProperties, (err, data) => {
console.log(msgStr + 'tempWnd.setSystemBarProperties err' + JSON.stringify(err)); console.log(msgStr + 'tempWnd.setSystemBarProperties err' + JSON.stringify(err));
console.log(msgStr + 'tempWnd.setSystemBarProperties data' + JSON.stringify(data)); console.log(msgStr + 'tempWnd.setSystemBarProperties data' + JSON.stringify(data));
if (err.code && err.code!==801) { if (err && err.code) {
try { try {
expect(TRUE_FLAG).assertFail(); expect(TRUE_FLAG).assertFail();
} catch (error) { } catch (error) {
...@@ -1004,7 +1003,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage) ...@@ -1004,7 +1003,7 @@ export default function windowCallbackTest(context, windowStage, abilityStorage)
tempWnd.setSystemBarProperties(systemBarProperties, (err, data) => { tempWnd.setSystemBarProperties(systemBarProperties, (err, data) => {
console.log(msgStr + 'tempWnd.setSystemBarProperties err' + JSON.stringify(err)); console.log(msgStr + 'tempWnd.setSystemBarProperties err' + JSON.stringify(err));
console.log(msgStr + 'tempWnd.setSystemBarProperties data' + JSON.stringify(data)); console.log(msgStr + 'tempWnd.setSystemBarProperties data' + JSON.stringify(data));
if (err.code && err.code!==801) { if (err && err.code) {
try { try {
expect(TRUE_FLAG).assertFail(); expect(TRUE_FLAG).assertFail();
} catch (error) { } catch (error) {
......
...@@ -774,10 +774,7 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -774,10 +774,7 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
console.log(msgStr + 'tempWnd.setSystemBarProperties ' + tempColor + ' success'); console.log(msgStr + 'tempWnd.setSystemBarProperties ' + tempColor + ' success');
}, (err) => { }, (err) => {
console.log(msgStr + 'tempWnd.setSystemBarProperties failed, err : ' + JSON.stringify(err)); console.log(msgStr + 'tempWnd.setSystemBarProperties failed, err : ' + JSON.stringify(err));
if(err.code!==801){ expect(TRUE_FLAG).assertFail();
expect(TRUE_FLAG).assertFail();
done();
}
}) })
} }
}) })
...@@ -875,10 +872,7 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -875,10 +872,7 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
console.log(msgStr + 'tempWnd.setSystemBarProperties ' + tempColor + ' success'); console.log(msgStr + 'tempWnd.setSystemBarProperties ' + tempColor + ' success');
}, (err) => { }, (err) => {
console.log(msgStr + 'tempWnd.setSystemBarProperties failed, err : ' + JSON.stringify(err)); console.log(msgStr + 'tempWnd.setSystemBarProperties failed, err : ' + JSON.stringify(err));
if(err.code!==801){ expect(TRUE_FLAG).assertFail();
expect(TRUE_FLAG).assertFail();
done();
}
}) })
} }
}) })
...@@ -953,10 +947,8 @@ export default function windowPromiseTest(context, windowStage, abilityStorage) ...@@ -953,10 +947,8 @@ export default function windowPromiseTest(context, windowStage, abilityStorage)
console.log(msgStr + 'tempWnd.setSystemBarProperties ' + tempColor + ' success'); console.log(msgStr + 'tempWnd.setSystemBarProperties ' + tempColor + ' success');
}, (err) => { }, (err) => {
console.log(msgStr + 'tempWnd.setSystemBarProperties failed, err : ' + JSON.stringify(err)); console.log(msgStr + 'tempWnd.setSystemBarProperties failed, err : ' + JSON.stringify(err));
if(err.code!==801){ expect(TRUE_FLAG).assertFail();
expect(TRUE_FLAG).assertFail(); done();
done();
}
}) })
} }
}) })
......
...@@ -162,10 +162,12 @@ export default function windowRefactorInterfaceTest(context, windowStage, abilit ...@@ -162,10 +162,12 @@ export default function windowRefactorInterfaceTest(context, windowStage, abilit
} }
}).catch(err => { }).catch(err => {
console.info('setWindowSystemBarPropertiesTest1 error : ' + JSON.stringify(err)); console.info('setWindowSystemBarPropertiesTest1 error : ' + JSON.stringify(err));
if(err.code!==801){ if(err.code==801){
expect(TRUE_FLAG).assertTrue();
} else {
expect().assertFail() expect().assertFail()
done();
} }
done();
}) })
} }
}) })
...@@ -274,10 +276,12 @@ export default function windowRefactorInterfaceTest(context, windowStage, abilit ...@@ -274,10 +276,12 @@ export default function windowRefactorInterfaceTest(context, windowStage, abilit
} }
}).catch(err => { }).catch(err => {
console.info('setWindowSystemBarPropertiesTest2 error : ' + JSON.stringify(err)); console.info('setWindowSystemBarPropertiesTest2 error : ' + JSON.stringify(err));
if(err.code!==801){ if(err.code==801){
expect(TRUE_FLAG).assertTrue();
} else {
expect().assertFail() expect().assertFail()
done();
} }
done();
}) })
} }
}) })
...@@ -356,10 +360,12 @@ export default function windowRefactorInterfaceTest(context, windowStage, abilit ...@@ -356,10 +360,12 @@ export default function windowRefactorInterfaceTest(context, windowStage, abilit
} }
}).catch(err => { }).catch(err => {
console.info('setWindowSystemBarPropertiesTest3 error : ' + JSON.stringify(err)); console.info('setWindowSystemBarPropertiesTest3 error : ' + JSON.stringify(err));
if(err.code!==801){ if(err.code==801){
expect(TRUE_FLAG).assertTrue();
} else {
expect().assertFail() expect().assertFail()
done();
} }
done();
}) })
} }
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册