提交 f107d972 编写于 作者: Q qu-xianfei

add new device_attest testcase

Signed-off-by: Nqu-xianfei <quxianfei@huawei.com>
Change-Id: I97be992a8e42b6734b34e09a930d84f7044fabb9
上级 18bfb13a
/* /*
* Copyright (c) 2022 Huawei Device Co., Ltd. * Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -39,7 +39,7 @@ export default function deviceAttestInfoTest(context, windowStage, abilityStorag ...@@ -39,7 +39,7 @@ export default function deviceAttestInfoTest(context, windowStage, abilityStorag
*/ */
it('SUB_GRAPHIC_ENUMCOLORSPACE_JSAPI_001', 0, async function (done) { it('SUB_GRAPHIC_ENUMCOLORSPACE_JSAPI_001', 0, async function (done) {
console.info('test the enum value of attestResultInfo begin'); console.info('test the enum value of attestResultInfo begin');
try{ try {
deviceAttest.getAttestStatus().then(attestResultInfo => { deviceAttest.getAttestStatus().then(attestResultInfo => {
console.info("!!!====>[FormComponent]1:data====>" + JSON.stringify(attestResultInfo)); console.info("!!!====>[FormComponent]1:data====>" + JSON.stringify(attestResultInfo));
expect(attestResultInfo.authResult).assertEqual(""); expect(attestResultInfo.authResult).assertEqual("");
...@@ -54,7 +54,7 @@ export default function deviceAttestInfoTest(context, windowStage, abilityStorag ...@@ -54,7 +54,7 @@ export default function deviceAttestInfoTest(context, windowStage, abilityStorag
}) })
} catch(err) { } catch(err) {
console.info("!!!====>[FormComponent]1:error_2====>" + JSON.stringify(err)); console.info("!!!====>[FormComponent]1:error_2====>" + JSON.stringify(err));
expect(err.code == 202).assetTrue(); expect(err.code == 202).assertTrue();
done(); done();
} }
}) })
...@@ -68,11 +68,10 @@ export default function deviceAttestInfoTest(context, windowStage, abilityStorag ...@@ -68,11 +68,10 @@ export default function deviceAttestInfoTest(context, windowStage, abilityStorag
console.info('test the enum value of attestResultInfo begin'); console.info('test the enum value of attestResultInfo begin');
try{ try{
deviceAttest.getAttestStatus(async (err, attestResultInfo) => { deviceAttest.getAttestStatus(async (err, attestResultInfo) => {
if(err){ if (err) {
console.info("!!!====>[FormComponent]2:error_1====>" + JSON.stringify(err)); console.info("!!!====>[FormComponent]2:error_1====>" + JSON.stringify(err));
expect(err.code == 202).assertTrue(); expect(err.code == 202).assertTrue();
} } else {
else{
console.info("!!!====>[FormComponent]2:data====>" + JSON.stringify(attestResultInfo)); console.info("!!!====>[FormComponent]2:data====>" + JSON.stringify(attestResultInfo));
expect(attestResultInfo.authResult).assertEqual(""); expect(attestResultInfo.authResult).assertEqual("");
expect(attestResultInfo.softwareResult).assertEqual(""); expect(attestResultInfo.softwareResult).assertEqual("");
...@@ -83,7 +82,7 @@ export default function deviceAttestInfoTest(context, windowStage, abilityStorag ...@@ -83,7 +82,7 @@ export default function deviceAttestInfoTest(context, windowStage, abilityStorag
}); });
} catch(err) { } catch(err) {
console.info("!!!====>[FormComponent]2:error_2====>" + JSON.stringify(err)); console.info("!!!====>[FormComponent]2:error_2====>" + JSON.stringify(err));
expect(err.code == 202).assetTrue(); expect(err.code == 202).assertTrue();
done(); done();
} }
}) })
...@@ -97,16 +96,15 @@ export default function deviceAttestInfoTest(context, windowStage, abilityStorag ...@@ -97,16 +96,15 @@ export default function deviceAttestInfoTest(context, windowStage, abilityStorag
console.info('test the enum value of attestResultInfo begin'); console.info('test the enum value of attestResultInfo begin');
try{ try{
let attestResultInfo = deviceAttest.getAttestStatusSync(); let attestResultInfo = deviceAttest.getAttestStatusSync();
if(attestResultInfo != null){ if (attestResultInfo != null) {
console.info("!!!====>[FormComponent]3:data====>" + JSON.stringify(attestResultInfo)); console.info("!!!====>[FormComponent]3:data====>" + JSON.stringify(attestResultInfo));
expect(attestResultInfo.authResult).assertEqual(""); expect(attestResultInfo.authResult).assertEqual("");
expect(attestResultInfo.softwareResult).assertEqual(""); expect(attestResultInfo.softwareResult).assertEqual("");
expect(attestResultInfo.softwareResultDetail).assertEqual(""); expect(attestResultInfo.softwareResultDetail).assertEqual("");
expect(attestResultInfo.ticket).assertEqual(""); expect(attestResultInfo.ticket).assertEqual("");
} } else {
else{
console.info("!!!====>[FormComponent]3:error_1====>"); console.info("!!!====>[FormComponent]3:error_1====>");
expect().assetTrue(); expect().assertTrue();
} }
done(); done();
} catch(err) { } catch(err) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册