提交 d661dc77 编写于 作者: Y yaocui

update

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