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 df4051cf73db31ef0a26bfb9e9c5b572e2e86860..d0126354f270acbc5ff94db79c2ef5a053305f3f 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() { @@ -388,6 +389,35 @@ export default function applicationBundleJsunit() { }); }); + /** + * @tc.number: getApplicationInfo_1800 + * @tc.name: getApplicationInfo : Obtains based on a given bundle name and flag. + * @tc.desc: Check whether fingerprint gets + */ + 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(TEST_DEMO); + }).catch((error) => { + expect(error).assertFail(); + }); + 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(TEST_DEMO); + expect(error).assertEqual(0); + done(); + }); + }); + function expectData(msg, data) { expect(typeof (data)).assertEqual('object'); expect(typeof (data.name)).assertEqual('string'); @@ -408,6 +438,7 @@ export default function applicationBundleJsunit() { expect(typeof (data.enabled)).assertEqual('boolean'); expect(typeof (data.uid)).assertEqual('number'); expect(typeof (data.entityType)).assertEqual('string'); + expect(typeof (data.fingerprint)).assertEqual('string'); expect(typeof (data.removable)).assertEqual('boolean'); expect(Array.isArray(data.permissions)).assertEqual(true); expect(Array.isArray(data.moduleSourceDirs)).assertEqual(true);