提交 fb54873d 编写于 作者: 耿文广

新增校验fingerprint字段的XTS用例

Signed-off-by: N耿文广 <gengwenguang@huawei.com>
上级 896b4cd5
......@@ -35,6 +35,7 @@ const BUNDLE_OTHER = 'com.example.third1';
const BUNDLE_NOTEXIST = 'com.ohos.package';
const FLAG_DEFAULT = Bundle.BundleFlag.GET_BUNDLE_DEFAULT;
const PATH = "/data/app/el1/bundle/public";
const TEST_DEMO = "8E93863FC32EE238060BF69A9B37E2608FFFB21F93C862DD511CBAC9F30024B5";
let userId = 0;
export default function applicationBundleJsunit() {
......@@ -396,18 +397,27 @@ export default function applicationBundleJsunit() {
it('getApplicationInfo_1800', 0, async function (done) {
await Bundle.getApplicationInfo(BUNDLE_NAME,
Bundle.BundleFlag.GET_APPLICATION_INFO_WITH_CERTIFICATE_FINGERPRINT).then((data) => {
expect(data.fingerprint).assertEqual("8E93863FC32EE238060BF69A9B37E2608FFFB21F93C862DD511CBAC9F30024B5");
expect(data.fingerprint).assertEqual(TEST_DEMO);
}).catch((error) => {
expect(error).assertEqual(1);
});
done()
});
/**
* @tc.number: getApplicationInfo_1900
* @tc.name: getApplicationInfo : Obtains based on a given bundle name and flag.
* @tc.desc: Check whether fingerprint gets
*/
it('getApplicationInfo_1900', 0, async function (done) {
Bundle.getApplicationInfo(BUNDLE_NAME,
Bundle.BundleFlag.GET_APPLICATION_INFO_WITH_CERTIFICATE_FINGERPRINT, (error, data) => {
expect(data.fingerprint).assertEqual("8E93863FC32EE238060BF69A9B37E2608FFFB21F93C862DD511CBAC9F30024B5");
if(error){
expect(err).assertEqual(1);
}
expect(data.fingerprint).assertEqual(TEST_DEMO);
if(error){
expect(err).assertEqual(1);
}
done();
});
});
});
function expectData(msg, data) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册