From fb54873d96d9068ebdb670a0f386912017783942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=BF=E6=96=87=E5=B9=BF?= Date: Mon, 13 Jun 2022 20:29:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=A0=A1=E9=AA=8Cfingerprint?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=9A=84XTS=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 耿文广 --- .../test/getApplicationInfoJsunit.test.ets | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getApplicationInfoJsunit.test.ets b/appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getApplicationInfoJsunit.test.ets index 1148cc32d..18eef18f6 100644 --- a/appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getApplicationInfoJsunit.test.ets +++ b/appexecfwk/bundle_standard/bundlemanager/actsbundlemanageretstest/entry/src/main/ets/test/getApplicationInfoJsunit.test.ets @@ -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) { -- GitLab