diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/package.json b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/package.json new file mode 100755 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/package.json @@ -0,0 +1 @@ +{} diff --git a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js index 7f0102d044740b1bdac62c4cf08416d1524bb6b2..6cc7b8012892d4d95fe93ecea98eee702f553260 100644 --- a/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js +++ b/aafwk/aafwk_standard/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js @@ -13,14 +13,21 @@ * limitations under the License. */ import featureAbility from '@ohos.ability.featureAbility' -import wantconstant from '@ohos.ability.wantconstant' +import wantconstant from '@ohos.ability.wantConstant' import bundle from '@ohos.bundle' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' import commonEvent from '@ohos.commonevent' const BUNDLES_COUNT = 7; const START_ABILITY_TIMEOUT = 5000; const TERMINATE_ABILITY_TIMEOUT = 6000; +const TIMEOUTINSTALL = 3000; +const TIMEOUTUNINSTALL = 3000; +const TIMEOUTSIX = 6000; +const TIMEOUTTERMINATE = 7000; +const TIMEOUTFORRESULT = 8000; +const TIMEOUT = 1000; + const PATH = '/data/' var subscriberInfo_ACTS_StartAbility_0100 = { events: ["ACTS_StartAbility_0100_CommonEvent"], @@ -86,13 +93,13 @@ describe('ActsFeatureAbilityTest', function () { console.debug('=======before all install========'); bundle.getBundleInstaller().then(data => { data.install([ - PATH + "FinishWithResultEmptyTest.hap", - PATH + "FinishWithResultPromiseParametersTest.hap", - PATH + "FinishWithResultTest.hap", - PATH + "GetCallingBundlePromiseTest.hap", - PATH + "StartAbility.hap", - PATH + "StartAbilityForResult.hap", - PATH + "TerminateAbilityTest.hap"], { + PATH + "FinishWithResultEmptyTest.hap", + PATH + "FinishWithResultPromiseParametersTest.hap", + PATH + "FinishWithResultTest.hap", + PATH + "GetCallingBundlePromiseTest.hap", + PATH + "StartAbility.hap", + PATH + "StartAbilityForResult.hap", + PATH + "TerminateAbilityTest.hap"], { param: { userId: 0, isKeepData: false @@ -107,18 +114,20 @@ describe('ActsFeatureAbilityTest', function () { console.info('========install finish========' + data.statusMessage); done() } + setTimeout(function () { + console.info('====> before all install finish =====>') + }, TIMEOUTINSTALL) }) afterAll((done) => { console.debug('=======after all uninstall========'); uninstall([ - "com.example.finishwithresultemptytest", - "com.example.finishwithresultpromiseparameterstest", - "com.example.finishwithresulttest", - "com.example.getcallingbundlepromisetest", - "com.example.startability", - "com.example.startabilityforresult", - "com.example.terminateabilitytest"]); - + "com.example.finishwithresultemptytest", + "com.example.finishwithresultpromiseparameterstest", + "com.example.finishwithresulttest", + "com.example.getcallingbundlepromisetest", + "com.example.startability", + "com.example.startabilityforresult", + "com.example.terminateabilitytest"]); function uninstall(bundleNames) { var uninstallArray = new Array(); bundle.getBundleInstaller().then(data => { @@ -142,8 +151,12 @@ describe('ActsFeatureAbilityTest', function () { console.debug('======uninstall all finish======='); done(); } + } } + setTimeout(function () { + console.info('====> after all uninstall finish =====>') + }, TIMEOUTUNINSTALL) }) /** @@ -152,79 +165,35 @@ describe('ActsFeatureAbilityTest', function () { * @tc.desc: Check the return type of the interface (by Promise) */ it('ACTS_wantConstant_0100', 0, async function (done) { - expect(wantconstant.Action.ACTION_HOME).assertEqual("action.system.home"); - expect(wantconstant.Action.ACTION_PLAY).assertEqual("action.system.play"); - expect(wantconstant.Action.ACTION_BUNDLE_ADD).assertEqual("action.bundle.add"); - expect(wantconstant.Action.ACTION_BUNDLE_REMOVE).assertEqual("action.bundle.remove"); - expect(wantconstant.Action.ACTION_BUNDLE_UPDATE).assertEqual("action.bundle.update"); - expect(wantconstant.Action.ACTION_ORDER_TAXI).assertEqual("ability.intent.ORDER_TAXI"); - expect(wantconstant.Action.ACTION_QUERY_TRAFFIC_RESTRICTION).assertEqual("ability.intent.QUERY" + - "_TRAFFIC_RESTRICTION"); - expect(wantconstant.Action.ACTION_PLAN_ROUTE).assertEqual("ability.intent.PLAN_ROUTE"); - expect(wantconstant.Action.ACTION_BOOK_FLIGHT).assertEqual("ability.intent.BOOK_FLIGHT"); - expect(wantconstant.Action.ACTION_BOOK_TRAIN_TICKET).assertEqual("ability.intent.BOOK_TRAIN_TICKET"); - expect(wantconstant.Action.ACTION_BOOK_HOTEL).assertEqual("ability.intent.BOOK_HOTEL"); - expect(wantconstant.Action.ACTION_QUERY_TRAVELLING_GUIDELINE).assertEqual("ability.intent.QUERY" + - "_TRAVELLING_GUIDELINE"); - expect(wantconstant.Action.ACTION_QUERY_POI_INFO).assertEqual("ability.intent.QUERY_POI_INFO"); - expect(wantconstant.Action.ACTION_QUERY_CONSTELLATION_FORTUNE).assertEqual("ability.intent.QUERY" + - "_CONSTELLATION_FORTUNE"); - expect(wantconstant.Action.ACTION_QUERY_ALMANC).assertEqual("ability.intent.QUERY_ALMANC"); - expect(wantconstant.Action.ACTION_QUERY_WEATHER).assertEqual("ability.intent.QUERY_WEATHER"); - expect(wantconstant.Action.ACTION_QUERY_ENCYCLOPEDIA).assertEqual("ability.intent.QUERY_ENCYCLOPEDIA"); - expect(wantconstant.Action.ACTION_QUERY_RECIPE).assertEqual("ability.intent.QUERY_RECIPE"); - expect(wantconstant.Action.ACTION_BUY_TAKEOUT).assertEqual("ability.intent.BUY_TAKEOUT"); - expect(wantconstant.Action.ACTION_TRANSLATE_TEXT).assertEqual("ability.intent.TRANSLATE_TEXT"); - expect(wantconstant.Action.ACTION_BUY).assertEqual("ability.intent.BUY"); - expect(wantconstant.Action.ACTION_QUERY_LOGISTICS_INFO).assertEqual("ability.intent.QUERY_LOGISTICS_INFO"); - expect(wantconstant.Action.ACTION_SEND_LOGISTICS).assertEqual("ability.intent.SEND_LOGISTICS"); - expect(wantconstant.Action.ACTION_QUERY_SPORTS_INFO).assertEqual("ability.intent.QUERY_SPORTS_INFO"); - expect(wantconstant.Action.ACTION_QUERY_NEWS).assertEqual("ability.intent.QUERY_NEWS"); - expect(wantconstant.Action.ACTION_QUERY_JOKE).assertEqual("ability.intent.QUERY_JOKE"); - expect(wantconstant.Action.ACTION_WATCH_VIDEO_CLIPS).assertEqual("ability.intent.WATCH_VIDEO_CLIPS"); - expect(wantconstant.Action.ACTION_QUERY_STOCK_INFO).assertEqual("ability.intent.QUERY_STOCK_INFO"); - expect(wantconstant.Action.ACTION_LOCALE_CHANGED).assertEqual("ability.intent.LOCALE_CHANGED"); + expect(wantconstant.Action.ACTION_HOME).assertEqual("ohos.want.action.home"); + expect(wantconstant.Action.ACTION_DIAL).assertEqual("ohos.want.action.dial"); + expect(wantconstant.Action.ACTION_SEARCH).assertEqual("ohos.want.action.search"); + expect(wantconstant.Action.ACTION_WIRELESS_SETTINGS).assertEqual("ohos.settings.wireless"); + expect(wantconstant.Action.ACTION_MANAGE_APPLICATIONS_SETTINGS).assertEqual("ohos.settings.manage.applications"); + expect(wantconstant.Action.ACTION_APPLICATION_DETAILS_SETTINGS).assertEqual("ohos.settings.application.details"); + expect(wantconstant.Action.ACTION_SET_ALARM).assertEqual("ohos.want.action.setAlarm"); + expect(wantconstant.Action.ACTION_SHOW_ALARMS).assertEqual("ohos.want.action.showAlarms"); + expect(wantconstant.Action.ACTION_SNOOZE_ALARM).assertEqual("ohos.want.action.snoozeAlarm"); + expect(wantconstant.Action.ACTION_DISMISS_ALARM).assertEqual("ohos.want.action.dismissAlarm"); + expect(wantconstant.Action.ACTION_DISMISS_TIMER).assertEqual("ohos.want.action.dismissTimer"); + expect(wantconstant.Action.ACTION_SEND_SMS).assertEqual("ohos.want.action.sendSms"); + expect(wantconstant.Action.ACTION_CHOOSE).assertEqual("ohos.want.action.choose"); + expect(wantconstant.Action.ACTION_SELECT).assertEqual("ohos.want.action.select"); + expect(wantconstant.Action.ACTION_SEND_DATA).assertEqual("ohos.want.action.sendData"); + expect(wantconstant.Action.ACTION_SEND_MULTIPLE_DATA).assertEqual("ohos.want.action.sendMultipleData"); + expect(wantconstant.Action.ACTION_SCAN_MEDIA_FILE).assertEqual("ohos.want.action.scanMediaFile"); + expect(wantconstant.Action.ACTION_VIEW_DATA).assertEqual("ohos.want.action.viewData"); + expect(wantconstant.Action.ACTION_EDIT_DATA).assertEqual("ohos.want.action.editData"); + expect(wantconstant.Action.INTENT_PARAMS_INTENT).assertEqual("ability.want.params.INTENT"); + expect(wantconstant.Action.INTENT_PARAMS_TITLE).assertEqual("ability.want.params.TITLE"); + expect(wantconstant.Action.ACTION_FILE_SELECT).assertEqual("ohos.action.fileSelect"); + expect(wantconstant.Action.PARAMS_STREAM).assertEqual("ability.params.stream"); expect(wantconstant.Entity.ENTITY_HOME).assertEqual("entity.system.home"); + expect(wantconstant.Entity.ENTITY_DEFAULT).assertEqual("entity.system.default"); + expect(wantconstant.Entity.ENTITY_VOICE).assertEqual("entity.system.voice"); + expect(wantconstant.Entity.ENTITY_BROWSABLE).assertEqual("entity.system.browsable"); expect(wantconstant.Entity.ENTITY_VIDEO).assertEqual("entity.system.video"); - - console.log("wantConstant.Action.ACTION_HOME: " + wantconstant.Action.ACTION_HOME) - console.log("wantConstant.Action.ACTION_PLAY: " + wantconstant.Action.ACTION_PLAY) - console.log("wantConstant.Action.ACTION_BUNDLE_ADD: " + wantconstant.Action.ACTION_BUNDLE_ADD) - console.log("wantConstant.Action.ACTION_BUNDLE_REMOVE: " + wantconstant.Action.ACTION_BUNDLE_REMOVE) - console.log("wantConstant.Action.ACTION_BUNDLE_UPDATE: " + wantconstant.Action.ACTION_BUNDLE_UPDATE) - console.log("wantConstant.Action.ACTION_ORDER_TAXI: " + wantconstant.Action.ACTION_ORDER_TAXI) - console.log("wantConstant.Action.ACTION_QUERY_TRAFFIC_" + - "RESTRICTION: " + wantconstant.Action.ACTION_QUERY_TRAFFIC_RESTRICTION) - console.log("wantConstant.Action.ACTION_PLAN_ROUTE: " + wantconstant.Action.ACTION_PLAN_ROUTE) - console.log("wantConstant.Action.ACTION_BOOK_FLIGHT: " + wantconstant.Action.ACTION_BOOK_FLIGHT) - console.log("wantConstant.Action.ACTION_BOOK_TRAIN_TICKET: " + wantconstant.Action.ACTION_BOOK_TRAIN_TICKET) - console.log("wantConstant.Action.ACTION_BOOK_HOTEL: " + wantconstant.Action.ACTION_BOOK_HOTEL) - console.log("wantConstant.Action.ACTION_QUERY_TRAVELLING_" + - "GUIDELINE: " + wantconstant.Action.ACTION_QUERY_TRAVELLING_GUIDELINE) - console.log("wantConstant.Action.ACTION_QUERY_POI_INFO: " + wantconstant.Action.ACTION_QUERY_POI_INFO) - console.log("wantConstant.Action.ACTION_QUERY_CONSTELLATION_" + - "FORTUNE: " + wantconstant.Action.ACTION_QUERY_CONSTELLATION_FORTUNE) - console.log("wantConstant.Action.ACTION_QUERY_ALMANC: " + wantconstant.Action.ACTION_QUERY_ALMANC) - console.log("wantConstant.Action.ACTION_QUERY_WEATHER: " + wantconstant.Action.ACTION_QUERY_WEATHER) - console.log("wantConstant.Action.ACTION_QUERY_ENCYCLOPEDIA: " + wantconstant.Action.ACTION_QUERY_ENCYCLOPEDIA) - console.log("wantConstant.Action.ACTION_QUERY_RECIPE: " + wantconstant.Action.ACTION_QUERY_RECIPE) - console.log("wantConstant.Action.ACTION_BUY_TAKEOUT: " + wantconstant.Action.ACTION_BUY_TAKEOUT) - console.log("wantConstant.Action.ACTION_TRANSLATE_TEXT: " + wantconstant.Action.ACTION_TRANSLATE_TEXT) - console.log("wantConstant.Action.ACTION_BUY: " + wantconstant.Action.ACTION_BUY) - console.log("wantConstant.Action.ACTION_QUERY_LOGISTICS_" + - "INFO: " + wantconstant.Action.ACTION_QUERY_LOGISTICS_INFO) - console.log("wantConstant.Action.ACTION_SEND_LOGISTICS: " + wantconstant.Action.ACTION_SEND_LOGISTICS) - console.log("wantConstant.Action.ACTION_QUERY_SPORTS_INFO: " + wantconstant.Action.ACTION_QUERY_SPORTS_INFO) - console.log("wantConstant.Action.ACTION_QUERY_NEWS: " + wantconstant.Action.ACTION_QUERY_NEWS) - console.log("wantConstant.Action.ACTION_QUERY_JOKE: " + wantconstant.Action.ACTION_QUERY_JOKE) - console.log("wantConstant.Action.ACTION_WATCH_VIDEO_CLIPS: " + wantconstant.Action.ACTION_WATCH_VIDEO_CLIPS) - console.log("wantConstant.Action.ACTION_QUERY_STOCK_INFO: " + wantconstant.Action.ACTION_QUERY_STOCK_INFO) - console.log("wantConstant.Action.ACTION_LOCALE_CHANGED: " + wantconstant.Action.ACTION_LOCALE_CHANGED) - - console.log("wantConstant.Entity.ENTITY_HOME: " + wantconstant.Entity.ENTITY_HOME) - console.log("wantConstant.Entity.ENTITY_VIDEO: " + wantconstant.Entity.ENTITY_VIDEO) - done(); }) @@ -239,20 +208,6 @@ describe('ActsFeatureAbilityTest', function () { done(); }) - /** - * @tc.number: ACTS_GetContext_0200 - * @tc.name: GetContext : Obtains the Context object - * @tc.desc: Check the return value of the interface (by AsyncCallback) - */ - it('ACTS_GetContext_0200', 0, async function (done) { - var result = await featureAbility.getContext( - (data) => { - expect(typeof (data)).assertEqual("object"); - done(); - }, - ); - }) - /** * @tc.number: ACTS_HasWindowFocus_0100 * @tc.name: HasWindowFocus : Checks whether the main window of this ability has window focus @@ -264,6 +219,9 @@ describe('ActsFeatureAbilityTest', function () { var info = await featureAbility.hasWindowFocus(); expect(info).assertEqual(true); done(); + setTimeout(function () { + console.info('====> ACTS_HasWindowFocus_0100 =====>') + }, TIMEOUT) }) /** @@ -281,6 +239,9 @@ describe('ActsFeatureAbilityTest', function () { } ); console.info('AceApplication : hasWindowFocus : ' + result); + setTimeout(function () { + console.info('====> ACTS_HasWindowFocus_0300 =====>') + }, TIMEOUT) }) /** @@ -300,7 +261,7 @@ describe('ActsFeatureAbilityTest', function () { done(); } - await commonEvent.createSubscriber(subscriberInfo_ACTS_StartAbility_0100).then(async (data) => { + commonEvent.createSubscriber(subscriberInfo_ACTS_StartAbility_0100).then(async (data) => { console.debug("====>Create Subscriber====>"); Subscriber = data; await commonEvent.subscribe(Subscriber, SubscribeCallBack); @@ -327,32 +288,32 @@ describe('ActsFeatureAbilityTest', function () { entities: ["entity.system.home"], type: "MIMETYPE", options: { - // indicates the grant to perform read operations on the URI + // indicates the grant to perform read operations on the URI authReadUriPermission: true, - // indicates the grant to perform write operations on the URI + // indicates the grant to perform write operations on the URI authWriteUriPermission: true, - // support forward intent result to origin ability + // support forward intent result to origin ability abilityForwardResult: true, - // used for marking the ability start-up is triggered by continuation + // used for marking the ability start-up is triggered by continuation abilityContinuation: true, - // specifies whether a component does not belong to ohos + // specifies whether a component does not belong to ohos notOhosComponent: true, - // specifies whether an ability is started + // specifies whether an ability is started abilityFormEnabled: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPersistableUriPermission: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPrefixUriPermission: true, - // support distributed scheduling system start up multiple devices + // support distributed scheduling system start up multiple devices abilitySliceMultiDevice: true, - // indicates that an ability using the service template is started regardless of whether the - // host application has been started. + // indicates that an ability using the service template is started regardless of whether the + // host application has been started. startForegroundAbility: true, - // install the specified ability if it's not installed. + // install the specified ability if it's not installed. installOnDemand: true, - // return result to origin ability slice + // return result to origin ability slice abilitySliceForwardResult: true, - // install the specified ability with background mode if it's not installed. + // install the specified ability with background mode if it's not installed. installWithBackgroundMode: true }, deviceId: "", @@ -363,7 +324,9 @@ describe('ActsFeatureAbilityTest', function () { } ); expect(promise).assertEqual(0); - + setTimeout(function () { + console.info('====> ACTS_StartAbility_0100 =====>') + }, TIMEOUTSIX) }) /** @@ -383,7 +346,7 @@ describe('ActsFeatureAbilityTest', function () { done(); } - await commonEvent.createSubscriber(subscriberInfo_ACTS_StartAbility_0200).then(async (data) => { + commonEvent.createSubscriber(subscriberInfo_ACTS_StartAbility_0200).then(async (data) => { console.debug("====>Create Subscriber====>"); Subscriber = data; await commonEvent.subscribe(Subscriber, SubscribeCallBack); @@ -411,32 +374,32 @@ describe('ActsFeatureAbilityTest', function () { entities: ["entity.system.home"], type: "MIMETYPE", options: { - // indicates the grant to perform read operations on the URI + // indicates the grant to perform read operations on the URI authReadUriPermission: true, - // indicates the grant to perform write operations on the URI + // indicates the grant to perform write operations on the URI authWriteUriPermission: true, - // support forward intent result to origin ability + // support forward intent result to origin ability abilityForwardResult: true, - // used for marking the ability start-up is triggered by continuation + // used for marking the ability start-up is triggered by continuation abilityContinuation: true, - // specifies whether a component does not belong to ohos + // specifies whether a component does not belong to ohos notOhosComponent: true, - // specifies whether an ability is started + // specifies whether an ability is started abilityFormEnabled: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPersistableUriPermission: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPrefixUriPermission: true, - // support distributed scheduling system start up multiple devices + // support distributed scheduling system start up multiple devices abilitySliceMultiDevice: true, - // indicates that an ability using the service template is started regardless of whether the - // host application has been started. + // indicates that an ability using the service template is started regardless of whether the + // host application has been started. startForegroundAbility: true, - // install the specified ability if it's not installed. + // install the specified ability if it's not installed. installOnDemand: true, - // return result to origin ability slice + // return result to origin ability slice abilitySliceForwardResult: true, - // install the specified ability with background mode if it's not installed. + // install the specified ability with background mode if it's not installed. installWithBackgroundMode: true }, deviceId: "", @@ -458,8 +421,9 @@ describe('ActsFeatureAbilityTest', function () { } ); expect(promise).assertEqual(0); - console.debug('=======no id======'); - + setTimeout(function () { + console.info('====> ACTS_StartAbility_0200 =====>') + }, TIMEOUTSIX) }) /** @@ -479,7 +443,7 @@ describe('ActsFeatureAbilityTest', function () { done(); } - await commonEvent.createSubscriber(subscriberInfo_ACTS_StartAbility_0300).then(async (data) => { + commonEvent.createSubscriber(subscriberInfo_ACTS_StartAbility_0300).then(async (data) => { console.debug("====>Create Subscriber====>"); Subscriber = data; await commonEvent.subscribe(Subscriber, SubscribeCallBack); @@ -506,32 +470,32 @@ describe('ActsFeatureAbilityTest', function () { entities: [""], type: "", options: { - // indicates the grant to perform read operations on the URI + // indicates the grant to perform read operations on the URI authReadUriPermission: true, - // indicates the grant to perform write operations on the URI + // indicates the grant to perform write operations on the URI authWriteUriPermission: true, - // support forward intent result to origin ability + // support forward intent result to origin ability abilityForwardResult: true, - // used for marking the ability start-up is triggered by continuation + // used for marking the ability start-up is triggered by continuation abilityContinuation: true, - // specifies whether a component does not belong to ohos + // specifies whether a component does not belong to ohos notOhosComponent: true, - // specifies whether an ability is started + // specifies whether an ability is started abilityFormEnabled: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPersistableUriPermission: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPrefixUriPermission: true, - // support distributed scheduling system start up multiple devices + // support distributed scheduling system start up multiple devices abilitySliceMultiDevice: true, - // indicates that an ability using the service template is started regardless of whether the - // host application has been started. + // indicates that an ability using the service template is started regardless of whether the + // host application has been started. startForegroundAbility: true, - // install the specified ability if it's not installed. + // install the specified ability if it's not installed. installOnDemand: true, - // return result to origin ability slice + // return result to origin ability slice abilitySliceForwardResult: true, - // install the specified ability with background mode if it's not installed. + // install the specified ability with background mode if it's not installed. installWithBackgroundMode: true }, deviceId: "", @@ -542,6 +506,9 @@ describe('ActsFeatureAbilityTest', function () { } ); expect(promise).assertEqual(0); + setTimeout(function () { + console.info('====> ACTS_StartAbility_0300 =====>') + }, TIMEOUTSIX) }) /** @@ -561,7 +528,7 @@ describe('ActsFeatureAbilityTest', function () { done(); } - await commonEvent.createSubscriber(subscriberInfo_ACTS_StartAbility_0400).then(async (data) => { + commonEvent.createSubscriber(subscriberInfo_ACTS_StartAbility_0400).then(async (data) => { console.debug("====>Create Subscriber====>"); Subscriber = data; await commonEvent.subscribe(Subscriber, SubscribeCallBack); @@ -588,32 +555,32 @@ describe('ActsFeatureAbilityTest', function () { entities: ["entity.system.home"], type: "MIMETYPE", options: { - // indicates the grant to perform read operations on the URI + // indicates the grant to perform read operations on the URI authReadUriPermission: true, - // indicates the grant to perform write operations on the URI + // indicates the grant to perform write operations on the URI authWriteUriPermission: true, - // support forward intent result to origin ability + // support forward intent result to origin ability abilityForwardResult: true, - // used for marking the ability start-up is triggered by continuation + // used for marking the ability start-up is triggered by continuation abilityContinuation: true, - // specifies whether a component does not belong to ohos + // specifies whether a component does not belong to ohos notOhosComponent: true, - // specifies whether an ability is started + // specifies whether an ability is started abilityFormEnabled: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPersistableUriPermission: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPrefixUriPermission: true, - // support distributed scheduling system start up multiple devices + // support distributed scheduling system start up multiple devices abilitySliceMultiDevice: true, - // indicates that an ability using the service template is started regardless of whether the - // host application has been started. + // indicates that an ability using the service template is started regardless of whether the + // host application has been started. startForegroundAbility: true, - // install the specified ability if it's not installed. + // install the specified ability if it's not installed. installOnDemand: true, - // return result to origin ability slice + // return result to origin ability slice abilitySliceForwardResult: true, - // install the specified ability with background mode if it's not installed. + // install the specified ability with background mode if it's not installed. installWithBackgroundMode: true }, deviceId: "", @@ -628,6 +595,9 @@ describe('ActsFeatureAbilityTest', function () { }, ); + setTimeout(function () { + console.info('====> ACTS_StartAbility_0400 =====>') + }, TIMEOUTSIX) }) /** @@ -647,7 +617,7 @@ describe('ActsFeatureAbilityTest', function () { done(); } - await commonEvent.createSubscriber(subscriberInfo_ACTS_StartAbility_0500).then(async (data) => { + commonEvent.createSubscriber(subscriberInfo_ACTS_StartAbility_0500).then(async (data) => { console.debug("====>Create Subscriber====>"); Subscriber = data; await commonEvent.subscribe(Subscriber, SubscribeCallBack); @@ -674,32 +644,32 @@ describe('ActsFeatureAbilityTest', function () { entities: ["entity.system.home"], type: "MIMETYPE", options: { - // indicates the grant to perform read operations on the URI + // indicates the grant to perform read operations on the URI authReadUriPermission: true, - // indicates the grant to perform write operations on the URI + // indicates the grant to perform write operations on the URI authWriteUriPermission: true, - // support forward intent result to origin ability + // support forward intent result to origin ability abilityForwardResult: true, - // used for marking the ability start-up is triggered by continuation + // used for marking the ability start-up is triggered by continuation abilityContinuation: true, - // specifies whether a component does not belong to ohos + // specifies whether a component does not belong to ohos notOhosComponent: true, - // specifies whether an ability is started + // specifies whether an ability is started abilityFormEnabled: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPersistableUriPermission: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPrefixUriPermission: true, - // support distributed scheduling system start up multiple devices + // support distributed scheduling system start up multiple devices abilitySliceMultiDevice: true, - // indicates that an ability using the service template is started regardless of whether the - // host application has been started. + // indicates that an ability using the service template is started regardless of whether the + // host application has been started. startForegroundAbility: true, - // install the specified ability if it's not installed. + // install the specified ability if it's not installed. installOnDemand: true, - // return result to origin ability slice + // return result to origin ability slice abilitySliceForwardResult: true, - // install the specified ability with background mode if it's not installed. + // install the specified ability with background mode if it's not installed. installWithBackgroundMode: true }, deviceId: "", @@ -725,6 +695,9 @@ describe('ActsFeatureAbilityTest', function () { }, ); + setTimeout(function () { + console.info('====> ACTS_StartAbility_0500 =====>') + }, TIMEOUTSIX) }) /** @@ -744,7 +717,7 @@ describe('ActsFeatureAbilityTest', function () { done(); } - await commonEvent.createSubscriber(subscriberInfo_ACTS_StartAbility_0600).then(async (data) => { + commonEvent.createSubscriber(subscriberInfo_ACTS_StartAbility_0600).then(async (data) => { console.debug("====>Create Subscriber====>"); Subscriber = data; await commonEvent.subscribe(Subscriber, SubscribeCallBack); @@ -771,32 +744,32 @@ describe('ActsFeatureAbilityTest', function () { entities: [""], type: "", options: { - // indicates the grant to perform read operations on the URI + // indicates the grant to perform read operations on the URI authReadUriPermission: true, - // indicates the grant to perform write operations on the URI + // indicates the grant to perform write operations on the URI authWriteUriPermission: true, - // support forward intent result to origin ability + // support forward intent result to origin ability abilityForwardResult: true, - // used for marking the ability start-up is triggered by continuation + // used for marking the ability start-up is triggered by continuation abilityContinuation: true, - // specifies whether a component does not belong to ohos + // specifies whether a component does not belong to ohos notOhosComponent: true, - // specifies whether an ability is started + // specifies whether an ability is started abilityFormEnabled: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPersistableUriPermission: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPrefixUriPermission: true, - // support distributed scheduling system start up multiple devices + // support distributed scheduling system start up multiple devices abilitySliceMultiDevice: true, - // indicates that an ability using the service template is started regardless of whether the - // host application has been started. + // indicates that an ability using the service template is started regardless of whether the + // host application has been started. startForegroundAbility: true, - // install the specified ability if it's not installed. + // install the specified ability if it's not installed. installOnDemand: true, - // return result to origin ability slice + // return result to origin ability slice abilitySliceForwardResult: true, - // install the specified ability with background mode if it's not installed. + // install the specified ability with background mode if it's not installed. installWithBackgroundMode: true }, deviceId: "", @@ -811,7 +784,9 @@ describe('ActsFeatureAbilityTest', function () { }, ); - + setTimeout(function () { + console.info('====> ACTS_StartAbility_0600 =====>') + }, TIMEOUTSIX) }) /** @@ -822,24 +797,21 @@ describe('ActsFeatureAbilityTest', function () { it('ACTS_StartAbilityForResult_0100', 0, async function (done) { var Subscriber; let id; - function SubscribeCallBack(err, data) { clearTimeout(id); expect(data.event).assertEqual("ACTS_StartAbilityForResult_0100_CommonEvent"); console.debug("====>Subscribe CallBack data:====>" + JSON.stringify(data)); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - done(); } - await commonEvent.createSubscriber(subscriberInfo_ACTS_StartAbilityForResult_0100).then(async (data) => { + commonEvent.createSubscriber(subscriberInfo_ACTS_StartAbilityForResult_0100).then(async (data) => { console.debug("====>Create Subscriber====>"); Subscriber = data; - await commonEvent.subscribe(Subscriber, SubscribeCallBack); + commonEvent.subscribe(Subscriber, SubscribeCallBack); }) function UnSubscribeCallback() { console.debug("====>UnSubscribe CallBack====>"); - done(); } function timeout() { @@ -858,49 +830,47 @@ describe('ActsFeatureAbilityTest', function () { entities: ["entity.system.home"], type: "MIMETYPE", options: { - // indicates the grant to perform read operations on the URI + // indicates the grant to perform read operations on the URI authReadUriPermission: true, - // indicates the grant to perform write operations on the URI + // indicates the grant to perform write operations on the URI authWriteUriPermission: true, - // support forward intent result to origin ability + // support forward intent result to origin ability abilityForwardResult: true, - // used for marking the ability start-up is triggered by continuation + // used for marking the ability start-up is triggered by continuation abilityContinuation: true, - // specifies whether a component does not belong to ohos + // specifies whether a component does not belong to ohos notOhosComponent: true, - // specifies whether an ability is started + // specifies whether an ability is started abilityFormEnabled: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPersistableUriPermission: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPrefixUriPermission: true, - // support distributed scheduling system start up multiple devices + // support distributed scheduling system start up multiple devices abilitySliceMultiDevice: true, - // indicates that an ability using the service template is started regardless of whether the - // host application has been started. + // indicates that an ability using the service template is started regardless of whether the + // host application has been started. startForegroundAbility: true, - // install the specified ability if it's not installed. + // install the specified ability if it's not installed. installOnDemand: true, - // return result to origin ability slice + // return result to origin ability slice abilitySliceForwardResult: true, - // install the specified ability with background mode if it's not installed. + // install the specified ability with background mode if it's not installed. installWithBackgroundMode: true }, deviceId: "", bundleName: "com.example.startabilityforresult", abilityName: "com.example.startabilityforresult.MainAbility", uri: "" - }, - requestCode: 2, - }, - (error, result) => { - checkOnAbilityResult(result); - console.log("featureAbilityTest ACTS_StartAbilityForResult_0100 asyncCallback " + - "errCode : " + error + " result: " + result) - done(); - }, + } + } ); - expect(promise).assertEqual(0); + console.info('====> ACTS_StartAbilityForResult_0100 start ability=====>' + JSON.stringify(promise)) + checkOnAbilityResult(promise); + done(); + setTimeout(function () { + console.info('====> ACTS_StartAbilityForResult_0100 =====>') + }, TIMEOUTSIX) }) /** @@ -911,16 +881,14 @@ describe('ActsFeatureAbilityTest', function () { it('ACTS_StartAbilityForResult_0200', 0, async function (done) { var Subscriber; let id; - function SubscribeCallBack(err, data) { clearTimeout(id); expect(data.event).assertEqual("ACTS_StartAbilityForResult_0200_CommonEvent"); console.debug("====>Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - done(); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); } - await commonEvent.createSubscriber(subscriberInfo_ACTS_StartAbilityForResult_0200).then(async (data) => { + commonEvent.createSubscriber(subscriberInfo_ACTS_StartAbilityForResult_0200).then(async (data) => { console.debug("====>Create Subscriber====>"); Subscriber = data; await commonEvent.subscribe(Subscriber, SubscribeCallBack); @@ -928,7 +896,6 @@ describe('ActsFeatureAbilityTest', function () { function UnSubscribeCallback() { console.debug("====>UnSubscribe CallBack====>"); - done(); } function timeout() { @@ -947,32 +914,32 @@ describe('ActsFeatureAbilityTest', function () { entities: ["entity.system.home"], type: "MIMETYPE", options: { - // indicates the grant to perform read operations on the URI + // indicates the grant to perform read operations on the URI authReadUriPermission: true, - // indicates the grant to perform write operations on the URI + // indicates the grant to perform write operations on the URI authWriteUriPermission: true, - // support forward intent result to origin ability + // support forward intent result to origin ability abilityForwardResult: true, - // used for marking the ability start-up is triggered by continuation + // used for marking the ability start-up is triggered by continuation abilityContinuation: true, - // specifies whether a component does not belong to ohos + // specifies whether a component does not belong to ohos notOhosComponent: true, - // specifies whether an ability is started + // specifies whether an ability is started abilityFormEnabled: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPersistableUriPermission: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPrefixUriPermission: true, - // support distributed scheduling system start up multiple devices + // support distributed scheduling system start up multiple devices abilitySliceMultiDevice: true, - // indicates that an ability using the service template is started regardless of whether the - // host application has been started. + // indicates that an ability using the service template is started regardless of whether the + // host application has been started. startForegroundAbility: true, - // install the specified ability if it's not installed. + // install the specified ability if it's not installed. installOnDemand: true, - // return result to origin ability slice + // return result to origin ability slice abilitySliceForwardResult: true, - // install the specified ability with background mode if it's not installed. + // install the specified ability with background mode if it's not installed. installWithBackgroundMode: true }, deviceId: "", @@ -990,17 +957,14 @@ describe('ActsFeatureAbilityTest', function () { mykey6: ["aaaaaa", "bbbbb", "ccccccccccc"], mykey7: true, }, - }, - requestCode: 2, - }, - (error, result) => { - checkOnAbilityResult(result); - console.log('featureAbilityTest ACTS_StartAbilityForResult_0200 asyncCallback ' + - 'errCode : ' + error + " result: " + result) - done(); - }, + } + } ); - expect(promise).assertEqual(0); + checkOnAbilityResult(promise); + done(); + setTimeout(function () { + console.info('====> ACTS_StartAbilityForResult_0200 =====>') + }, TIMEOUTFORRESULT) }) /** @@ -1017,10 +981,9 @@ describe('ActsFeatureAbilityTest', function () { expect(data.event).assertEqual("ACTS_StartAbilityForResult_0300_CommonEvent"); console.debug("====>Subscribe CallBack data:====>" + JSON.stringify(data)); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - done(); } - await commonEvent.createSubscriber(subscriberInfo_ACTS_StartAbilityForResult_0300).then(async (data) => { + commonEvent.createSubscriber(subscriberInfo_ACTS_StartAbilityForResult_0300).then(async (data) => { console.debug("====>Create Subscriber====>"); Subscriber = data; await commonEvent.subscribe(Subscriber, SubscribeCallBack); @@ -1028,7 +991,6 @@ describe('ActsFeatureAbilityTest', function () { function UnSubscribeCallback() { console.debug("====>UnSubscribe CallBack====>"); - done(); } function timeout() { @@ -1047,50 +1009,46 @@ describe('ActsFeatureAbilityTest', function () { entities: [""], type: "", options: { - // indicates the grant to perform read operations on the URI + // indicates the grant to perform read operations on the URI authReadUriPermission: true, - // indicates the grant to perform write operations on the URI + // indicates the grant to perform write operations on the URI authWriteUriPermission: true, - // support forward intent result to origin ability + // support forward intent result to origin ability abilityForwardResult: true, - // used for marking the ability start-up is triggered by continuation + // used for marking the ability start-up is triggered by continuation abilityContinuation: true, - // specifies whether a component does not belong to ohos + // specifies whether a component does not belong to ohos notOhosComponent: true, - // specifies whether an ability is started + // specifies whether an ability is started abilityFormEnabled: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPersistableUriPermission: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPrefixUriPermission: true, - // support distributed scheduling system start up multiple devices + // support distributed scheduling system start up multiple devices abilitySliceMultiDevice: true, - // indicates that an ability using the service template is started regardless of whether the - // host application has been started. + // indicates that an ability using the service template is started regardless of whether the + // host application has been started. startForegroundAbility: true, - // install the specified ability if it's not installed. + // install the specified ability if it's not installed. installOnDemand: true, - // return result to origin ability slice + // return result to origin ability slice abilitySliceForwardResult: true, - // install the specified ability with background mode if it's not installed. + // install the specified ability with background mode if it's not installed. installWithBackgroundMode: true }, deviceId: "", bundleName: "com.example.startabilityforresult", abilityName: "com.example.startabilityforresult.MainAbility", uri: "" - }, - requestCode: 2, - }, - (error, result) => { - console.log('featureAbilityTest ACTS_StartAbilityForResult_0300 asyncCallback ' + - 'errCode : ' + error + " result: " + result) - checkOnAbilityResult(result); - done(); - }, + } + } ); - expect(promise).assertEqual(0); - console.debug('=======no id======') + checkOnAbilityResult(promise); + done(); + setTimeout(function () { + console.info('====> ACTS_StartAbilityForResult_0300 =====>') + }, TIMEOUTFORRESULT) }) @@ -1110,7 +1068,7 @@ describe('ActsFeatureAbilityTest', function () { commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) } - await commonEvent.createSubscriber(subscriberInfo_ACTS_StartAbilityForResult_0400).then(async (data) => { + commonEvent.createSubscriber(subscriberInfo_ACTS_StartAbilityForResult_0400).then(async (data) => { console.debug("====>Create Subscriber====>"); Subscriber = data; await commonEvent.subscribe(Subscriber, SubscribeCallBack); @@ -1136,32 +1094,32 @@ describe('ActsFeatureAbilityTest', function () { entities: ["entity.system.home"], type: "MIMETYPE", options: { - // indicates the grant to perform read operations on the URI + // indicates the grant to perform read operations on the URI authReadUriPermission: true, - // indicates the grant to perform write operations on the URI + // indicates the grant to perform write operations on the URI authWriteUriPermission: true, - // support forward intent result to origin ability + // support forward intent result to origin ability abilityForwardResult: true, - // used for marking the ability start-up is triggered by continuation + // used for marking the ability start-up is triggered by continuation abilityContinuation: true, - // specifies whether a component does not belong to ohos + // specifies whether a component does not belong to ohos notOhosComponent: true, - // specifies whether an ability is started + // specifies whether an ability is started abilityFormEnabled: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPersistableUriPermission: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPrefixUriPermission: true, - // support distributed scheduling system start up multiple devices + // support distributed scheduling system start up multiple devices abilitySliceMultiDevice: true, - // indicates that an ability using the service template is started regardless of whether the - // host application has been started. + // indicates that an ability using the service template is started regardless of whether the + // host application has been started. startForegroundAbility: true, - // install the specified ability if it's not installed. + // install the specified ability if it's not installed. installOnDemand: true, - // return result to origin ability slice + // return result to origin ability slice abilitySliceForwardResult: true, - // install the specified ability with background mode if it's not installed. + // install the specified ability with background mode if it's not installed. installWithBackgroundMode: true }, deviceId: "", @@ -1176,14 +1134,11 @@ describe('ActsFeatureAbilityTest', function () { 'errCode : ' + error + " result: " + result) checkOnAbilityResult(result); done(); - }, - (error, result) => { - expect(result).assertEqual(0); - console.log('featureAbilityTest ACTS_StartAbilityForResult_0400 second asyncCallback ' + - 'errCode : ' + error + " result: " + result) - done(); - }, + } ); + setTimeout(function () { + console.info('====> ACTS_StartAbilityForResult_0400 =====>') + }, TIMEOUTFORRESULT) }) /** @@ -1202,7 +1157,7 @@ describe('ActsFeatureAbilityTest', function () { commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) } - await commonEvent.createSubscriber(subscriberInfo_ACTS_StartAbilityForResult_0500).then(async (data) => { + commonEvent.createSubscriber(subscriberInfo_ACTS_StartAbilityForResult_0500).then(async (data) => { console.debug("====>Create Subscriber====>"); Subscriber = data; await commonEvent.subscribe(Subscriber, SubscribeCallBack); @@ -1228,32 +1183,32 @@ describe('ActsFeatureAbilityTest', function () { entities: ["entity.system.home"], type: "MIMETYPE", options: { - // indicates the grant to perform read operations on the URI + // indicates the grant to perform read operations on the URI authReadUriPermission: true, - // indicates the grant to perform write operations on the URI + // indicates the grant to perform write operations on the URI authWriteUriPermission: true, - // support forward intent result to origin ability + // support forward intent result to origin ability abilityForwardResult: true, - // used for marking the ability start-up is triggered by continuation + // used for marking the ability start-up is triggered by continuation abilityContinuation: true, - // specifies whether a component does not belong to ohos + // specifies whether a component does not belong to ohos notOhosComponent: true, - // specifies whether an ability is started + // specifies whether an ability is started abilityFormEnabled: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPersistableUriPermission: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPrefixUriPermission: true, - // support distributed scheduling system start up multiple devices + // support distributed scheduling system start up multiple devices abilitySliceMultiDevice: true, - // indicates that an ability using the service template is started regardless of whether the - // host application has been started. + // indicates that an ability using the service template is started regardless of whether the + // host application has been started. startForegroundAbility: true, - // install the specified ability if it's not installed. + // install the specified ability if it's not installed. installOnDemand: true, - // return result to origin ability slice + // return result to origin ability slice abilitySliceForwardResult: true, - // install the specified ability with background mode if it's not installed. + // install the specified ability with background mode if it's not installed. installWithBackgroundMode: true }, deviceId: "", @@ -1271,22 +1226,18 @@ describe('ActsFeatureAbilityTest', function () { mykey6: ["aaaaaa", "bbbbb", "ccccccccccc"], mykey7: true, }, - }, - requestCode: 2, + } }, (error, result) => { checkOnAbilityResult(result); console.log('featureAbilityTest ACTS_StartAbilityForResult_0500 asyncCallback ' + 'errCode : ' + error + " result: " + result) done(); - }, - (error, result) => { - expect(result).assertEqual(0); - console.log('featureAbilityTest ACTS_StartAbilityForResult_0500 asyncCallback ' + - 'errCode : ' + error + " result: " + result) - done(); - }, + } ); + setTimeout(function () { + console.info('====> ACTS_StartAbilityForResult_0500 =====>') + }, TIMEOUTFORRESULT) }) @@ -1306,7 +1257,7 @@ describe('ActsFeatureAbilityTest', function () { commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) } - await commonEvent.createSubscriber(subscriberInfo_ACTS_StartAbilityForResult_0600).then(async (data) => { + commonEvent.createSubscriber(subscriberInfo_ACTS_StartAbilityForResult_0600).then(async (data) => { console.debug("====>Create Subscriber====>"); Subscriber = data; await commonEvent.subscribe(Subscriber, SubscribeCallBack); @@ -1332,32 +1283,32 @@ describe('ActsFeatureAbilityTest', function () { entities: [""], type: "", options: { - // indicates the grant to perform read operations on the URI + // indicates the grant to perform read operations on the URI authReadUriPermission: true, - // indicates the grant to perform write operations on the URI + // indicates the grant to perform write operations on the URI authWriteUriPermission: true, - // support forward intent result to origin ability + // support forward intent result to origin ability abilityForwardResult: true, - // used for marking the ability start-up is triggered by continuation + // used for marking the ability start-up is triggered by continuation abilityContinuation: true, - // specifies whether a component does not belong to ohos + // specifies whether a component does not belong to ohos notOhosComponent: true, - // specifies whether an ability is started + // specifies whether an ability is started abilityFormEnabled: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPersistableUriPermission: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPrefixUriPermission: true, - // support distributed scheduling system start up multiple devices + // support distributed scheduling system start up multiple devices abilitySliceMultiDevice: true, - // indicates that an ability using the service template is started regardless of whether the - // host application has been started. + // indicates that an ability using the service template is started regardless of whether the + // host application has been started. startForegroundAbility: true, - // install the specified ability if it's not installed. + // install the specified ability if it's not installed. installOnDemand: true, - // return result to origin ability slice + // return result to origin ability slice abilitySliceForwardResult: true, - // install the specified ability with background mode if it's not installed. + // install the specified ability with background mode if it's not installed. installWithBackgroundMode: true }, deviceId: "", @@ -1365,39 +1316,32 @@ describe('ActsFeatureAbilityTest', function () { abilityName: "com.example.startabilityforresult.MainAbility", uri: "" }, - requestCode: 2, }, (error, result) => { checkOnAbilityResult(result); console.log('featureAbilityTest ACTS_StartAbilityForResult_0600 asyncCallback ' + 'errCode : ' + error + " result: " + result) done(); - }, - (error, result) => { - expect(result).assertEqual(0); - console.log('featureAbilityTest ACTS_StartAbilityForResult_0600 asyncCallback ' + - 'errCode : ' + error + " result: " + result) - done(); - }, + } ); + setTimeout(function () { + console.info('====> ACTS_StartAbilityForResult_0600 =====>') + }, TIMEOUTFORRESULT) }) function checkOnAbilityResult(data) { expect(typeof (data)).assertEqual("object"); - expect(typeof (data.requestCode)).assertEqual("number"); expect(typeof (data.resultCode)).assertEqual("number"); expect(typeof (data.want.action)).assertEqual("string"); expect(Array.isArray(data.want.entities)).assertEqual(true); expect(typeof (data.want.type)).assertEqual("string"); - expect(typeof (data.want.options)).assertEqual("object"); expect(typeof (data.want.deviceId)).assertEqual("string"); expect(typeof (data.want.bundleName)).assertEqual("string"); expect(typeof (data.want.abilityName)).assertEqual("string"); expect(typeof (data.want.uri)).assertEqual("string"); console.info('featureAbilityTest onAbilityResult asyncCallback success : *************'); - console.info('requestCode : ' + data.requestCode); console.info('resultCode : ' + data.resultCode); console.info('want.action : ' + data.want.action); console.info('want.entities.length : ' + data.want.entities.length); @@ -1405,21 +1349,6 @@ describe('ActsFeatureAbilityTest', function () { console.info('want.entities : ' + data.want.entities[j]); } console.info('want.type : ' + data.want.type); - console.info('want.options : ' + data.want.options); - console.info('want.deviceId : ' + data.want.deviceId); - console.info('want.options.authReadUriPermission : ' + data.want.options.authReadUriPermission); - console.info('want.options.authWriteUriPermission : ' + data.want.options.authWriteUriPermission); - console.info('want.options.abilityForwardResult : ' + data.want.options.abilityForwardResult); - console.info('want.options.abilityContinuation : ' + data.want.options.abilityContinuation); - console.info('want.options.notOhosComponent : ' + data.want.options.notOhosComponent); - console.info('want.options.abilityFormEnabled : ' + data.want.options.abilityFormEnabled); - console.info('want.options.authPersistableUriPermission : ' + data.want.options.authPersistableUriPermission); - console.info('want.options.authPrefixUriPermission : ' + data.want.options.authPrefixUriPermission); - console.info('want.options.abilitySliceMultiDevice : ' + data.want.options.abilitySliceMultiDevice); - console.info('want.options.startForegroundAbility : ' + data.want.options.startForegroundAbility); - console.info('want.options.installOnDemand : ' + data.want.options.installOnDemand); - console.info('want.options.abilitySliceForwardResult : ' + data.want.options.abilitySliceForwardResult); - console.info('want.options.installWithBackgroundMode : ' + data.want.options.installWithBackgroundMode); console.info('want.bundleName : ' + data.want.bundleName); console.info('want.abilityName : ' + data.want.abilityName); console.info('want.uri : ' + data.want.uri); @@ -1436,6 +1365,9 @@ describe('ActsFeatureAbilityTest', function () { var info = await featureAbility.hasWindowFocus(); expect(info).assertEqual(false); done(); + setTimeout(function () { + console.info('====> ACTS_HasWindowFocus_0200 =====>') + }, TIMEOUT) }) /** @@ -1452,6 +1384,9 @@ describe('ActsFeatureAbilityTest', function () { done(); } ); + setTimeout(function () { + console.info('====> ACTS_HasWindowFocus_0400 =====>') + }, TIMEOUT) }) /** @@ -1468,9 +1403,14 @@ describe('ActsFeatureAbilityTest', function () { clearTimeout(id); events.set(data.event, 0); console.debug("====>Subscribe CallBack data:====>" + JSON.stringify(data)); + if (events.size > 1) { + checkResult(); + } else { + setTimeout(timeout, TERMINATE_ABILITY_TIMEOUT); + } } - await commonEvent.createSubscriber(subscriberInfo_ACTS_TerminateAbility_0100).then(async (data) => { + commonEvent.createSubscriber(subscriberInfo_ACTS_TerminateAbility_0100).then(async (data) => { console.debug("====>Create Subscriber====>"); Subscriber = data; await commonEvent.subscribe(Subscriber, SubscribeCallBack); @@ -1489,13 +1429,16 @@ describe('ActsFeatureAbilityTest', function () { } function checkResult() { + console.debug('==========ACTS_TerminateAbility_0100==========checkResult'); expect(events.has("ACTS_TerminateAbility_0100_CommonEvent")).assertTrue(); expect(events.has("ACTS_TerminateAbility_0100_Return")).assertTrue(); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) done(); + setTimeout(function () { + console.info('====> ACTS_TerminateAbility_0100 =====>') + }, TIMEOUTTERMINATE) } - setTimeout(checkResult, TERMINATE_ABILITY_TIMEOUT); id = setTimeout(timeout, START_ABILITY_TIMEOUT); var promise = featureAbility.startAbility( { @@ -1505,32 +1448,32 @@ describe('ActsFeatureAbilityTest', function () { entities: ["entity.system.home"], type: "MIMETYPE", options: { - // indicates the grant to perform read operations on the URI + // indicates the grant to perform read operations on the URI authReadUriPermission: true, - // indicates the grant to perform write operations on the URI + // indicates the grant to perform write operations on the URI authWriteUriPermission: true, - // support forward intent result to origin ability + // support forward intent result to origin ability abilityForwardResult: true, - // used for marking the ability start-up is triggered by continuation + // used for marking the ability start-up is triggered by continuation abilityContinuation: true, - // specifies whether a component does not belong to ohos + // specifies whether a component does not belong to ohos notOhosComponent: true, - // specifies whether an ability is started + // specifies whether an ability is started abilityFormEnabled: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPersistableUriPermission: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPrefixUriPermission: true, - // support distributed scheduling system start up multiple devices + // support distributed scheduling system start up multiple devices abilitySliceMultiDevice: true, - // indicates that an ability using the service template is started regardless of whether the - // host application has been started. + // indicates that an ability using the service template is started regardless of whether the + // host application has been started. startForegroundAbility: true, - // install the specified ability if it's not installed. + // install the specified ability if it's not installed. installOnDemand: true, - // return result to origin ability slice + // return result to origin ability slice abilitySliceForwardResult: true, - // install the specified ability with background mode if it's not installed. + // install the specified ability with background mode if it's not installed. installWithBackgroundMode: true }, deviceId: "", @@ -1557,9 +1500,14 @@ describe('ActsFeatureAbilityTest', function () { clearTimeout(id); events.set(data.event, 0); console.debug("====>Subscribe CallBack data:====>" + JSON.stringify(data)); + if (events.size > 1) { + checkResult(); + } else { + setTimeout(timeout, TERMINATE_ABILITY_TIMEOUT); + } } - await commonEvent.createSubscriber(subscriberInfo_ACTS_TerminateAbility_0200).then(async (data) => { + commonEvent.createSubscriber(subscriberInfo_ACTS_TerminateAbility_0200).then(async (data) => { console.debug("====>Create Subscriber====>"); Subscriber = data; await commonEvent.subscribe(Subscriber, SubscribeCallBack); @@ -1582,9 +1530,11 @@ describe('ActsFeatureAbilityTest', function () { expect(events.has("ACTS_TerminateAbility_0200_Return")).assertTrue(); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) done(); + setTimeout(function () { + console.info('====> ACTS_TerminateAbility_0100 =====>') + }, TIMEOUTTERMINATE) } - setTimeout(checkResult, TERMINATE_ABILITY_TIMEOUT); id = setTimeout(timeout, START_ABILITY_TIMEOUT); var promise = featureAbility.startAbility( { @@ -1613,16 +1563,14 @@ describe('ActsFeatureAbilityTest', function () { it('ACTS_FinishWithResult_0100', 0, async function (done) { var Subscriber; let id; - function SubscribeCallBack(err, data) { clearTimeout(id); expect(data.event).assertEqual("ACTS_FinishWithResult_0100_CommonEvent"); console.debug("====>Subscribe CallBack data:====>" + JSON.stringify(data)); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - done(); } - await commonEvent.createSubscriber(subscriberInfo_ACTS_FinishWithResult_0100).then(async (data) => { + commonEvent.createSubscriber(subscriberInfo_ACTS_FinishWithResult_0100).then(async (data) => { console.debug("====>Create Subscriber====>"); Subscriber = data; await commonEvent.subscribe(Subscriber, SubscribeCallBack); @@ -1630,7 +1578,6 @@ describe('ActsFeatureAbilityTest', function () { function UnSubscribeCallback() { console.debug("====>UnSubscribe CallBack====>"); - done(); } function timeout() { @@ -1649,50 +1596,46 @@ describe('ActsFeatureAbilityTest', function () { entities: ["entity.system.home"], type: "MIMETYPE", options: { - // indicates the grant to perform read operations on the URI + // indicates the grant to perform read operations on the URI authReadUriPermission: true, - // indicates the grant to perform write operations on the URI + // indicates the grant to perform write operations on the URI authWriteUriPermission: true, - // support forward intent result to origin ability + // support forward intent result to origin ability abilityForwardResult: true, - // used for marking the ability start-up is triggered by continuation + // used for marking the ability start-up is triggered by continuation abilityContinuation: true, - // specifies whether a component does not belong to ohos + // specifies whether a component does not belong to ohos notOhosComponent: true, - // specifies whether an ability is started + // specifies whether an ability is started abilityFormEnabled: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPersistableUriPermission: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPrefixUriPermission: true, - // support distributed scheduling system start up multiple devices + // support distributed scheduling system start up multiple devices abilitySliceMultiDevice: true, - // indicates that an ability using the service template is started regardless of whether the - // host application has been started. + // indicates that an ability using the service template is started regardless of whether the + // host application has been started. startForegroundAbility: true, - // install the specified ability if it's not installed. + // install the specified ability if it's not installed. installOnDemand: true, - // return result to origin ability slice + // return result to origin ability slice abilitySliceForwardResult: true, - // install the specified ability with background mode if it's not installed. + // install the specified ability with background mode if it's not installed. installWithBackgroundMode: true }, deviceId: "", bundleName: "com.example.finishwithresultpromiseparameterstest", abilityName: "com.example.finishwithresultpromiseparameterstest.MainAbility", uri: "" - }, - requestCode: 2, - }, - (error, result) => { - checkOnAbilityResult(result); - console.log('featureAbilityTest ACTS_FinishWithResult_0100 asyncCallback ' + - 'errCode : ' + error + " result: " + result) - done(); - }, + } + } ); - expect(promise).assertEqual(0); - + checkOnAbilityResult(promise); + done(); + setTimeout(function () { + console.info('====> ACTS_FinishWithResult_0100 =====>') + }, TIMEOUTFORRESULT) }) /** @@ -1704,16 +1647,14 @@ describe('ActsFeatureAbilityTest', function () { it('ACTS_FinishWithResult_0200', 0, async function (done) { var Subscriber; let id; - function SubscribeCallBack(err, data) { clearTimeout(id); expect(data.event).assertEqual("ACTS_FinishWithResult_0200_CommonEvent"); console.debug("====>Subscribe CallBack data:====>" + JSON.stringify(data)); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - done(); } - await commonEvent.createSubscriber(subscriberInfo_ACTS_FinishWithResult_0200).then(async (data) => { + commonEvent.createSubscriber(subscriberInfo_ACTS_FinishWithResult_0200).then(async (data) => { console.debug("====>Create Subscriber====>"); Subscriber = data; await commonEvent.subscribe(Subscriber, SubscribeCallBack); @@ -1721,7 +1662,6 @@ describe('ActsFeatureAbilityTest', function () { function UnSubscribeCallback() { console.debug("====>UnSubscribe CallBack====>"); - done(); } function timeout() { @@ -1740,50 +1680,46 @@ describe('ActsFeatureAbilityTest', function () { entities: ["entity.system.home"], type: "MIMETYPE", options: { - // indicates the grant to perform read operations on the URI + // indicates the grant to perform read operations on the URI authReadUriPermission: true, - // indicates the grant to perform write operations on the URI + // indicates the grant to perform write operations on the URI authWriteUriPermission: true, - // support forward intent result to origin ability + // support forward intent result to origin ability abilityForwardResult: true, - // used for marking the ability start-up is triggered by continuation + // used for marking the ability start-up is triggered by continuation abilityContinuation: true, - // specifies whether a component does not belong to ohos + // specifies whether a component does not belong to ohos notOhosComponent: true, - // specifies whether an ability is started + // specifies whether an ability is started abilityFormEnabled: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPersistableUriPermission: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPrefixUriPermission: true, - // support distributed scheduling system start up multiple devices + // support distributed scheduling system start up multiple devices abilitySliceMultiDevice: true, - // indicates that an ability using the service template is started regardless of whether the - // host application has been started. + // indicates that an ability using the service template is started regardless of whether the + // host application has been started. startForegroundAbility: true, - // install the specified ability if it's not installed. + // install the specified ability if it's not installed. installOnDemand: true, - // return result to origin ability slice + // return result to origin ability slice abilitySliceForwardResult: true, - // install the specified ability with background mode if it's not installed. + // install the specified ability with background mode if it's not installed. installWithBackgroundMode: true }, deviceId: "", bundleName: "com.example.finishwithresulttest", abilityName: "com.example.finishwithresulttest.MainAbility", uri: "" - }, - requestCode: 2, - }, - (error, result) => { - checkOnAbilityResult(result); - console.log('featureAbilityTest ACTS_FinishWithResult_0200 asyncCallback ' + - 'errCode : ' + error + " result: " + result) - done(); - }, + } + } ); - expect(promise).assertEqual(0); - + checkOnAbilityResult(promise); + done(); + setTimeout(function () { + console.info('====> ACTS_FinishWithResult_0200 =====>') + }, TIMEOUTFORRESULT) }) /** @@ -1801,10 +1737,9 @@ describe('ActsFeatureAbilityTest', function () { expect(data.event).assertEqual("ACTS_FinishWithResult_0300_CommonEvent"); console.debug("====>Subscribe CallBack data:====>" + JSON.stringify(data)); commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - done(); } - await commonEvent.createSubscriber(subscriberInfo_ACTS_FinishWithResult_0300).then(async (data) => { + commonEvent.createSubscriber(subscriberInfo_ACTS_FinishWithResult_0300).then(async (data) => { console.debug("====>Create Subscriber====>"); Subscriber = data; await commonEvent.subscribe(Subscriber, SubscribeCallBack); @@ -1812,7 +1747,6 @@ describe('ActsFeatureAbilityTest', function () { function UnSubscribeCallback() { console.debug("====>UnSubscribe CallBack====>"); - done(); } function timeout() { @@ -1831,50 +1765,46 @@ describe('ActsFeatureAbilityTest', function () { entities: ["entity.system.home"], type: "MIMETYPE", options: { - // indicates the grant to perform read operations on the URI + // indicates the grant to perform read operations on the URI authReadUriPermission: true, - // indicates the grant to perform write operations on the URI + // indicates the grant to perform write operations on the URI authWriteUriPermission: true, - // support forward intent result to origin ability + // support forward intent result to origin ability abilityForwardResult: true, - // used for marking the ability start-up is triggered by continuation + // used for marking the ability start-up is triggered by continuation abilityContinuation: true, - // specifies whether a component does not belong to ohos + // specifies whether a component does not belong to ohos notOhosComponent: true, - // specifies whether an ability is started + // specifies whether an ability is started abilityFormEnabled: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPersistableUriPermission: true, - // indicates the grant for possible persisting on the URI. + // indicates the grant for possible persisting on the URI. authPrefixUriPermission: true, - // support distributed scheduling system start up multiple devices + // support distributed scheduling system start up multiple devices abilitySliceMultiDevice: true, - // indicates that an ability using the service template is started regardless of whether the - // host application has been started. + // indicates that an ability using the service template is started regardless of whether the + // host application has been started. startForegroundAbility: true, - // install the specified ability if it's not installed. + // install the specified ability if it's not installed. installOnDemand: true, - // return result to origin ability slice + // return result to origin ability slice abilitySliceForwardResult: true, - // install the specified ability with background mode if it's not installed. + // install the specified ability with background mode if it's not installed. installWithBackgroundMode: true }, deviceId: "", bundleName: "com.example.finishwithresultemptytest", abilityName: "com.example.finishwithresultemptytest.MainAbility", uri: "" - }, - requestCode: 2, - }, - (error, result) => { - checkOnAbilityResult(result); - console.log('featureAbilityTest ACTS_FinishWithResult_0300 asyncCallback ' + - 'errCode : ' + error + " result: " + result) - done(); - }, + } + } ); - expect(promise).assertEqual(0); - + checkOnAbilityResult(promise); + done(); + setTimeout(function () { + console.info('====> ACTS_FinishWithResult_0300 =====>') + }, TIMEOUTFORRESULT) }) // checkAbilityName @@ -1895,6 +1825,9 @@ describe('ActsFeatureAbilityTest', function () { var info = await featureAbility.getAbilityName(); checkAbilityName(info); done(); + setTimeout(function () { + console.info('====> ACTS_GetAbilityName_0100 =====>') + }, TIMEOUT) }) /** @@ -1909,6 +1842,9 @@ describe('ActsFeatureAbilityTest', function () { done() } ); + setTimeout(function () { + console.info('====> ACTS_GetAbilityName_0200 =====>') + }, TIMEOUT) }) // checkApplicationInfo @@ -1972,14 +1908,14 @@ describe('ActsFeatureAbilityTest', function () { expect(info.process).assertEqual("processTest"); expect(info.supportedModes).assertEqual(0); expect(info.moduleSourceDirs[0]).assertEqual("/data/accounts/account_0/applications/" + - "com.example.actsfeatureabilitytest/com.example.actsfeatureabilitytest"); + "com.example.actsfeatureabilitytest/com.example.actsfeatureabilitytest"); expect(info.permissions[0]).assertEqual("ohos.permission.CAMERA"); expect(info.moduleInfos[0].moduleName).assertEqual("entry"); - expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/accounts/account_0/applications/" + - "com.example.actsfeatureabilitytest/com.example.actsfeatureabilitytest"); + expect(info.moduleInfos[0].moduleSourceDir).assertEqual("/data/accounts/account_0/applications/" + + "com.example.actsfeatureabilitytest/com.example.actsfeatureabilitytest"); expect(info.flags).assertEqual(0); - expect(info.entryDir).assertEqual("/data/accounts/account_0/applications/" + - "com.example.actsfeatureabilitytest/com.example.actsfeatureabilitytest"); + expect(info.entryDir).assertEqual("/data/accounts/account_0/applications/" + + "com.example.actsfeatureabilitytest/com.example.actsfeatureabilitytest"); } /** @@ -1993,6 +1929,9 @@ describe('ActsFeatureAbilityTest', function () { var info = await featureAbility.getApplicationInfo(); checkApplicationInfo(info); done(); + setTimeout(function () { + console.info('====> ACTS_GetApplicationInfo_0100 =====>') + }, TIMEOUT) }) /** @@ -2007,6 +1946,9 @@ describe('ActsFeatureAbilityTest', function () { done() } ); + setTimeout(function () { + console.info('====> ACTS_GetApplicationInfo_0200 =====>') + }, TIMEOUT) }) // checkProcessInfo @@ -2032,6 +1974,9 @@ describe('ActsFeatureAbilityTest', function () { var info = await featureAbility.getProcessInfo(); checkProcessInfo(info); done(); + setTimeout(function () { + console.info('====> ACTS_GetProcessInfo_0100 =====>') + }, TIMEOUT) }) /** @@ -2046,6 +1991,9 @@ describe('ActsFeatureAbilityTest', function () { done() } ); + setTimeout(function () { + console.info('====> ACTS_GetProcessInfo_0200 =====>') + }, TIMEOUT) }) // checkElementName @@ -2082,6 +2030,9 @@ describe('ActsFeatureAbilityTest', function () { var info = await featureAbility.getElementName(); checkElementName(info); done(); + setTimeout(function () { + console.info('====> ACTS_GetElementName_0100 =====>') + }, TIMEOUT) }) /** @@ -2096,6 +2047,9 @@ describe('ActsFeatureAbilityTest', function () { done() } ); + setTimeout(function () { + console.info('====> ACTS_GetElementName_0200 =====>') + }, TIMEOUT) }) // checkAppType @@ -2116,6 +2070,9 @@ describe('ActsFeatureAbilityTest', function () { var info = await featureAbility.getAppType(); checkAppType(info); done(); + setTimeout(function () { + console.info('====> ACTS_GetAppType_0100 =====>') + }, TIMEOUT) }) /** @@ -2130,6 +2087,9 @@ describe('ActsFeatureAbilityTest', function () { done() } ); + setTimeout(function () { + console.info('====> ACTS_GetAppType_0200 =====>') + }, TIMEOUT) }) // checkAbilityInfo @@ -2256,6 +2216,9 @@ describe('ActsFeatureAbilityTest', function () { var info = await featureAbility.getAbilityInfo(); checkAbilityInfo(info); done(); + setTimeout(function () { + console.info('====> ACTS_GetAbilityInfo_0100 =====>') + }, TIMEOUT) }) /** @@ -2270,6 +2233,9 @@ describe('ActsFeatureAbilityTest', function () { done() } ); + setTimeout(function () { + console.info('====> ACTS_GetAbilityInfo_0200 =====>') + }, TIMEOUT) }) // checkHapModuleInfo @@ -2346,6 +2312,9 @@ describe('ActsFeatureAbilityTest', function () { var info = await featureAbility.getHapModuleInfo(); checkHapModuleInfo(info); done(); + setTimeout(function () { + console.info('====> ACTS_GetHapModuleInfo_0100 =====>') + }, TIMEOUT) }) /** @@ -2360,6 +2329,9 @@ describe('ActsFeatureAbilityTest', function () { done() } ); + setTimeout(function () { + console.info('====> ACTS_GetHapModuleInfo_0200 =====>') + }, TIMEOUT) }) // checkProcessName @@ -2380,6 +2352,9 @@ describe('ActsFeatureAbilityTest', function () { var info = await featureAbility.getProcessName(); checkProcessName(info); done(); + setTimeout(function () { + console.info('====> ACTS_GetProcessName_0100 =====>') + }, TIMEOUT) }) /** @@ -2394,6 +2369,9 @@ describe('ActsFeatureAbilityTest', function () { done() } ); + setTimeout(function () { + console.info('====> ACTS_GetProcessName_0200 =====>') + }, TIMEOUT) }) /** @@ -2412,7 +2390,7 @@ describe('ActsFeatureAbilityTest', function () { console.debug("====>Subscribe CallBack data:====>" + JSON.stringify(data)); } - await commonEvent.createSubscriber(subscriberInfo_ACTS_GetCallingBundle_0100).then(async (data) => { + commonEvent.createSubscriber(subscriberInfo_ACTS_GetCallingBundle_0100).then(async (data) => { console.debug("====>Create Subscriber====>"); Subscriber = data; await commonEvent.subscribe(Subscriber, SubscribeCallBack); @@ -2451,5 +2429,8 @@ describe('ActsFeatureAbilityTest', function () { } ); expect(result).assertEqual(0); + setTimeout(function () { + console.info('====> ACTS_GetCallingBundle_0100 =====>') + }, TIMEOUTFORRESULT) }) }) diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/package.json b/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/package.json @@ -0,0 +1 @@ +{} diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/config.json b/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/config.json index 90bb94cfa0817c4837e4aa09ce2655125a523d45..90bc366fcb6bf0ac0200b3d2c47ee42a4338066e 100644 --- a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/config.json +++ b/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/config.json @@ -41,7 +41,8 @@ "description": "$string:mainability_description", "label": "$string:app_name", "type": "page", - "launchType": "standard" + "launchType": "standard", + "visible": true } ], "js": [ diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/pages/index/index.js index 684eaa4ca39d54003c45b41f02895e1b2c4565f1..66fb0cc88238914137b0c31d9598a08860338381 100644 --- a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/pages/index/index.js +++ b/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultemptytest/src/main/js/default/pages/index/index.js @@ -45,7 +45,7 @@ export default { }, } ); - featureAbility.terminateAbility( + featureAbility.terminateSelf( (err, data)=>{ console.debug('==========Terminate Ability Success==========') }); diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/package.json b/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/package.json @@ -0,0 +1 @@ +{} diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/config.json b/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/config.json index 383424a5811251bb458db4293b756f497939b8fc..501077e2c7e4eec8ebf966c9b4392c9cf0e9b44e 100644 --- a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/config.json +++ b/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/config.json @@ -41,7 +41,8 @@ "description": "$string:mainability_description", "label": "$string:app_name", "type": "page", - "launchType": "standard" + "launchType": "standard", + "visible": true } ], "js": [ diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/pages/index/index.js index f2f6c0e91d9ba26f132914be62c89096e3158741..a7c600650dc6e9b305e89c8e352da124d42542de 100644 --- a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/pages/index/index.js +++ b/aafwk/aafwk_standard/featureability/sceneproject/finishwithresultpromiseparameterstest/src/main/js/default/pages/index/index.js @@ -85,7 +85,7 @@ export default { }, } ) - featureAbility.terminateAbility( + featureAbility.terminateSelf( (err, data)=>{ console.debug('==========Terminate Ability Success=========='); }); diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/package.json b/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/package.json @@ -0,0 +1 @@ +{} diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/config.json b/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/config.json index 35957e36aa5053e14977fc48ea9cf632d57cad80..5295cdb2bf0775609d1765ef18a54159e59a2301 100644 --- a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/config.json +++ b/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/config.json @@ -41,7 +41,8 @@ "description": "$string:mainability_description", "label": "$string:app_name", "type": "page", - "launchType": "standard" + "launchType": "standard", + "visible": true } ], "js": [ diff --git a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/js/default/pages/index/index.js index 73ebb7c14c8c8cc0f1383d6a767af12bced7c13b..76c11fa8821bb3803618719faf6e118627f4eeb4 100644 --- a/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/js/default/pages/index/index.js +++ b/aafwk/aafwk_standard/featureability/sceneproject/finishwithresulttest/src/main/js/default/pages/index/index.js @@ -41,7 +41,7 @@ export default { }, } ); - featureAbility.terminateAbility( + featureAbility.terminateSelf( (err, data)=>{ console.debug('==========Terminate Ability Success=========='); }); diff --git a/aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/package.json b/aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/package.json @@ -0,0 +1 @@ +{} diff --git a/aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/config.json b/aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/config.json index dd8c9af6ae7abb4aa1442a29b995ab0ab534c9b8..5cb6ff2fa1a9b94ff4e25e3a07994e622ded106e 100644 --- a/aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/config.json +++ b/aafwk/aafwk_standard/featureability/sceneproject/getcallingbundletest/src/main/config.json @@ -41,7 +41,8 @@ "description": "$string:mainability_description", "label": "$string:app_name", "type": "page", - "launchType": "standard" + "launchType": "standard", + "visible": true } ], "js": [ diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startability/package.json b/aafwk/aafwk_standard/featureability/sceneproject/startability/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/aafwk/aafwk_standard/featureability/sceneproject/startability/package.json @@ -0,0 +1 @@ +{} diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/package.json b/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/package.json @@ -0,0 +1 @@ +{} diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/config.json b/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/config.json index 57ac90b994057202c04659d33d7bbdf2c029589e..0e66f7e0c056ff5342eaa0d406aa46100ba9df27 100644 --- a/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/config.json +++ b/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/config.json @@ -41,7 +41,8 @@ "description": "$string:mainability_description", "label": "$string:app_name", "type": "page", - "launchType": "standard" + "launchType": "standard", + "visible": true } ], "js": [ diff --git a/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/js/default/pages/index/index.js index 2f21ed8c1b60359a08e667694d1b193428ebe3da..8c337326582b22179e1d2940b522c9db53ff0ae3 100644 --- a/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/js/default/pages/index/index.js +++ b/aafwk/aafwk_standard/featureability/sceneproject/startabilityforresult/src/main/js/default/pages/index/index.js @@ -61,7 +61,7 @@ export default { }, } ); - await featureAbility.terminateAbility(); + await featureAbility.terminateSelf(); }, onReady() { }, diff --git a/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/package.json b/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/package.json @@ -0,0 +1 @@ +{} diff --git a/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/config.json b/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/config.json index b785531d37832bd69108d18c5f56af6b300f4b81..4605c10d03ed98cabdc8b6559afb1aa72ada0791 100644 --- a/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/config.json +++ b/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/config.json @@ -41,7 +41,8 @@ "description": "$string:mainability_description", "label": "$string:app_name", "type": "page", - "launchType": "standard" + "launchType": "standard", + "visible": true } ], "js": [ diff --git a/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/js/default/pages/index/index.js b/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/js/default/pages/index/index.js index 15dee84f743cdfa3c9d1e8938126623d9f1af04a..f6534d839a5fa6118c586b5475c9d4d1c2f450ed 100644 --- a/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/js/default/pages/index/index.js +++ b/aafwk/aafwk_standard/featureability/sceneproject/terminateabilitytest/src/main/js/default/pages/index/index.js @@ -41,11 +41,11 @@ export default { onShow() { commonEvent.publish("ACTS_TerminateAbility_0100_CommonEvent", PublishCallBackOne); commonEvent.publish("ACTS_TerminateAbility_0200_CommonEvent", PublishCallBackTwo); - featureAbility.terminateAbility( - (err, data)=>{ + featureAbility.terminateSelf( + async (err, data)=>{ console.debug('==========Terminate Ability Success=========='); - commonEvent.publish("ACTS_TerminateAbility_0100_Return", PublishCallBackThree); - commonEvent.publish("ACTS_TerminateAbility_0200_Return", PublishCallBackFour); + await commonEvent.publish("ACTS_TerminateAbility_0100_Return", PublishCallBackThree); + await commonEvent.publish("ACTS_TerminateAbility_0200_Return", PublishCallBackFour); } ); }, diff --git a/appexecfwk/ams_standard/BUILD.gn b/appexecfwk/ams_standard/BUILD.gn index 1d70495fbd47fc6ade5520a2ed7eed92cbbc22c0..cf897f1c68aeceb3b308d25cb8e44245aadcece5 100644 --- a/appexecfwk/ams_standard/BUILD.gn +++ b/appexecfwk/ams_standard/BUILD.gn @@ -16,6 +16,9 @@ import("//build/ohos_var.gni") group("ams_standard") { testonly = true if (is_standard_system) { - deps = [ "amszipfileunzipfilest:amsZipfileUnzipfileST" ] + deps = [ + "amszipfileunzipfilest:amsZipfileUnzipfileST", + "fwkdataaccessor:FWKDataAccessor", + ] } } diff --git a/appexecfwk/ams_standard/fwkdataaccessor/BUILD.gn b/appexecfwk/ams_standard/fwkdataaccessor/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..8fe06e236be760074901982ee529b755bfea39a6 --- /dev/null +++ b/appexecfwk/ams_standard/fwkdataaccessor/BUILD.gn @@ -0,0 +1,31 @@ +# Copyright (c) 2021 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//test/xts/tools/build/suite.gni") + +ohos_js_hap_suite("FWKDataAccessor") { + hap_profile = "./entry/src/main/config.json" + deps = [ + ":hjs_demo_js_assets", + ":hjs_demo_resources", + ] + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "FWKDataAccessor" +} +ohos_js_assets("hjs_demo_js_assets") { + source_dir = "./entry/src/main/js/default" +} +ohos_resources("hjs_demo_resources") { + sources = [ "./entry/src/main/js/resources" ] + hap_profile = "./entry/src/main/config.json" +} diff --git a/appexecfwk/ams_standard/fwkdataaccessor/Test.json b/appexecfwk/ams_standard/fwkdataaccessor/Test.json new file mode 100644 index 0000000000000000000000000000000000000000..07871cd56e96e6337805b572626ab84f3e89fdcc --- /dev/null +++ b/appexecfwk/ams_standard/fwkdataaccessor/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for hjunit demo Tests", + "driver": { + "type": "JSStTest", + "test-timeout": "60000", + "package": "com.amsst.fwkdataaccessor", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "FWKDataAccessor.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} \ No newline at end of file diff --git a/appexecfwk/ams_standard/fwkdataaccessor/entry/package.json b/appexecfwk/ams_standard/fwkdataaccessor/entry/package.json new file mode 100644 index 0000000000000000000000000000000000000000..69a88e3b65423624fe7ea8b0f8beefcc62cc3d5f --- /dev/null +++ b/appexecfwk/ams_standard/fwkdataaccessor/entry/package.json @@ -0,0 +1 @@ +{} diff --git a/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/config.json b/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..ba1f602704c7c4e9e762304de300f9da41f8cd69 --- /dev/null +++ b/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/config.json @@ -0,0 +1,62 @@ +{ + "app": { + "bundleName": "com.amsst.fwkdataaccessor", + "vendor": "amsst", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Beta1" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.amsst.fwkdataaccessor", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home", + "flag.home.intent.from.system" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.amsst.fwkdataaccessor.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard", + "visible": true + } + ], + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} \ No newline at end of file diff --git a/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/default/app.js b/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..3ee099f58926b1a7c42f02bb88ebb4998f9e4ac4 --- /dev/null +++ b/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/default/i18n/en-US.json b/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/default/i18n/zh-CN.json b/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/default/pages/index/index.css b/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..6724ec055a554cf3f9c7be83780c30df2274875b --- /dev/null +++ b/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,12 @@ +.container { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 100px; +} +.titleST { + font-size: 32px; +} \ No newline at end of file diff --git a/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/default/pages/index/index.hml b/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..4f779dcdff4fa69413976fe7032ca3656758793a --- /dev/null +++ b/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,8 @@ +
+ + {{ $t('strings.hello') }} {{ title }} + + + STDataAbility + +
diff --git a/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/default/pages/index/index.js b/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4bfa4f7e4a4085d7336a97befffb8d52882d281d --- /dev/null +++ b/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/default/pages/index/index.js @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import file from '@system.file' +import app from '@system.app' +import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index' + +export default { + data: { + title: "" + }, + onInit() { + this.title = this.$t('strings.world'); + }, + onShow() { + console.info('====onShow finish====<') + const core = Core.getInstance() + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }) + const reportExtend = new ReportExtend(file) + core.addService('expect', expectExtend) + core.addService('report', reportExtend) + core.init() + const configService = core.getDefaultService('config') + configService.setConfig(this) + + require('../../../test/List.test') + core.execute() + }, + onReady() { + }, +} \ No newline at end of file diff --git a/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/resources/base/element/string.json b/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..e0fe66e5544070f2dc986fec302f31b66d70e239 --- /dev/null +++ b/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "STDataAbility" + }, + { + "name": "mainability_description", + "value": "JS_Phone_Empty Feature Ability" + } + ] +} \ No newline at end of file diff --git a/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/resources/base/media/icon.png b/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/resources/base/media/icon.png differ diff --git a/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/test/DataAbilityHelperJsSt.test.js b/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/test/DataAbilityHelperJsSt.test.js new file mode 100644 index 0000000000000000000000000000000000000000..124c6d257c91cd102173db2ba8a74832afc83b53 --- /dev/null +++ b/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/test/DataAbilityHelperJsSt.test.js @@ -0,0 +1,595 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import featureAbility from '@ohos.ability.featureAbility' +import ohos_data_ability from '@ohos.data.dataability' +import bundle from '@ohos.bundle' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' + +describe('ActsDataAbilityHelperTest', function () { + let bundleName = "com.ix.verify.act"; + //let abilityName = "VerifyActDataAbility"; + //let dataAbilityUri = ("dataability:///com.ohos.amsst.AppDataC.AmsStDataAbilityDataC1"); + let dataAbilityUri = ("dataability:///com.ix.VerifyActDataAbility"); + + let DAHelper; + let g_setTimeout = 10 + + /* + * @tc.number: bms_getJsAbility_0100 + * @tc.name: test the multi js ability + * @tc.desc: 1.install a js hap which has an ability with full domain name + * 2.check the ability name by the interface of getBundleInfo + */ + it('bms_installAbility_0100', 0, async function (done) { + console.info('bms_installAbility_0100====" + + (" json data【") + JSON.stringify(data)+ (" 】;")); + //expect(data.abilityInfo.length).assertEqual(1); + done(); + }catch(err) { + console.error('=bms_installAbility_0100 install catch(err)====>:'+err); + expect(false).assertTrue(); + done(); + } + setTimeout(function () { + console.info('=bms_installAbility_0100====> setTimeout'); + }, g_setTimeout) + console.log('bms_installAbility_0100====" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data)+ (" 】;")); + expect(typeof err).assertEqual('object'); + expect(err.code).assertEqual(0); + expect(typeof data).assertEqual('object'); + expect(data.status).assertEqual(0); + expect(data.statusMessage).assertEqual('SUCCESS'); + } + }catch(err) { + console.error('=bms_installAbility_0100 getBundleInstaller catch(err)====>:'+err); + expect(false).assertTrue(); + } + } + +/* +* @tc.number: ACTS_GetDataAbilityHelper_0100 +* @tc.name: GetDataAbilityHelper : Connects an ability to a Service ability +* @tc.desc: Check the return value of the interface (by Promise) +*/ + it('ACTS_GetDataAbilityHelper_0100',0, async function (done) { + console.log('ACTS_GetDataAbilityHelper_0100====" + + (" json dataAbilityUri 【") + JSON.stringify(dataAbilityUri)+ (" 】; ====>")) + let ret = false; + try{ + var promise = featureAbility.getDataAbilityHelper(dataAbilityUri) + .then(function (data) { + console.debug("=ACTS_GetDataAbilityHelper_0100 then data====>" + + (" json data 【") + JSON.stringify(data)+ (" 】; ====>")+data); + expect(typeof(data)).assertEqual("object"); + console.log('=ACTS_GetDataAbilityHelper_0100 promise JSON.stringify([object])====>:' + JSON.stringify(promise)+","+promise); + ret = true; + done() + }).catch(function (err){ + console.debug("=ACTS_GetDataAbilityHelper_0100 catch err====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ====>")+err); + console.log('=ACTS_GetDataAbilityHelper_0100 promise====>:' + JSON.stringify(promise)) + ret = false; + done(); + }); + }catch(err) { + console.error('=ACTS_GetDataAbilityHelper_0100 getDataAbilityHelper catch(err)====>:'+err); + ret = false; + done(); + } + setTimeout(function(){ + expect(ret).assertTrue(); + }, g_setTimeout); + console.log('ACTS_GetDataAbilityHelper_0100====" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data)+ (" 】;")); + expect(typeof(asyncCallback)).assertEqual("object"); + DAHelper = data; + console.log('=ACTS_GetDataAbilityHelper_0200 asyncCallback err data====>:' + JSON.stringify(asyncCallback)) + console.log('=ACTS_GetDataAbilityHelper_0200 DAHelper JSON.stringify([object])====>:' + JSON.stringify(DAHelper)); + ret = true; + done(); + } + ); + }catch(err) { + console.error('=ACTS_GetDataAbilityHelper_0200 getDataAbilityHelper catch(err)====>:'+err); + ret = false; + done(); + } + console.log('=ACTS_GetDataAbilityHelper_0200 asyncCallback ====>:' + JSON.stringify(asyncCallback)) + + + setTimeout(function(){ + expect(ret).assertTrue(); + }, g_setTimeout); + console.log('ACTS_GetDataAbilityHelper_0200====: ' + JSON.stringify(DAHelper)+","+ DAHelper) + let valueBucket + try{ + DAHelper.insert(dataAbilityUri,valueBucket) + .then(function (data){ + console.debug("=ACTS_Insert_0100 insert Promise then data====>" + + ("json data 【") + JSON.stringify(data)+ (" 】")); + expect(typeof(data)).assertEqual("number"); + expect(data).assertEqual(1); + ret = true; + done(); + }).catch(function (err){ + console.debug("=ACTS_Insert_0100 insert Promise catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + ret = false; + done(); + }); + }catch(err) { + console.error('=ACTS_Insert_0100 insert Promise catch(err)====>:'+err); + ret = false; + done(); + } + + setTimeout(function(){ + expect(ret).assertTrue(); + }, g_setTimeout); + console.log('ACTS_Insert_0100====: ' + DAHelper) + let valueBucket + try{ + var asyncCallback = await DAHelper.insert(dataAbilityUri,valueBucket, + (err,data)=>{ + console.debug("=ACTS_Insert_0200 insert AsyncCallback err,data====>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data)+ (" 】;")); + expect(typeof(data)).assertEqual("number"); + expect(data).assertEqual(1); + console.log('=ACTS_Insert_0200 asyncCallback ====>:' + JSON.stringify(asyncCallback)) + ret = true; + done(); + } + ); + }catch(err) { + console.error('=ACTS_Insert_0200 insert AsyncCallback catch(err)====>:'+err); + ret = false; + done(); + } + setTimeout(function(){ + expect(ret).assertTrue(); + }, g_setTimeout); + console.log('ACTS_Insert_0200==== { + console.debug("=ACTS_Insert_0300 insert Promise then data====>" + + ("json data 【") + JSON.stringify(data)+ (" 】")); + expect(typeof(data)).assertEqual("number"); + expect(data).assertEqual(1); + ret = true; + done(); + }).catch((err)=>{ + console.debug("=ACTS_Insert_0300 insert Promise catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + //debugAnsErrorCodePrint(err.code); + ret = false; + done(); + }); + }catch(err) { + console.error('=ACTS_Insert_0300 insert Promise catch(err)====>:'+err); + ret = false; + done(); + } + + setTimeout(function(){ + expect(ret).assertTrue(); + }, g_setTimeout); + console.log('ACTS_Insert_0300====: ' + DAHelper) + const valueBucket = { + "name": "ACTS_Insert_0400_rose1", + "age": 221, + "salary": 20.5, + "blobType": "u8", + } + try{ + var asyncCallback = await DAHelper.insert(dataAbilityUri,valueBucket, + (err,data)=>{ + console.debug("=ACTS_Insert_0400 insert AsyncCallback err,data====>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data)+ (" 】;")); + expect(typeof(data)).assertEqual("number"); + expect(data).assertEqual(1); + ret = true; + done(); + } + ); + }catch(err) { + console.error('=ACTS_Insert_0400 insert AsyncCallback catch(err)====>:'+err); + ret = false + done(); + } + setTimeout(function(){ + expect(ret).assertTrue(); + }, g_setTimeout); + console.log('ACTS_Insert_0400====: ' + DAHelper) + var valueBucket; + try{ + DAHelper.batchInsert( + dataAbilityUri, + valueBucket + ).then((data) => { + console.debug("=ACTS_BatchInsert_0100 BatchInsert Promise then data====>" + + ("json data 【") + JSON.stringify(data)+ (" 】; ====>")); + expect(typeof(data)).assertEqual("number"); + ret = true; + done(); + }).catch((err)=>{ + console.debug("=ACTS_BatchInsert_0100 BatchInsert Promise catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + ret = false + done(); + }); + }catch(err) { + console.error('=ACTS_BatchInsert_0100 batchInsert AsyncCallback catch(err)====>:'+err); + ret = false + done(); + } + setTimeout(function(){ + expect(ret).assertTrue(); + }, g_setTimeout); + console.log('ACTS_BatchInsert_0100====: ' + DAHelper) + var valueBucket; + try{ + await DAHelper.batchInsert( + dataAbilityUri, + valueBucket, + (err,data) => { + console.debug("=ACTS_BatchInsert_0200 batchInsert AsyncCallback err,data=======>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data)+ (" 】;")); + expect(typeof(data)).assertEqual("number"); + ret = true; + done(); + }, + ); + }catch(err) { + console.error('=ACTS_BatchInsert_0200 batchInsert AsyncCallback catch(err)====>:'+err); + ret = false + done(); + } + setTimeout(function(){ + expect(ret).assertTrue(); + }, g_setTimeout); + console.log('ACTS_BatchInsert_0200====: ' + DAHelper) + var valueBucketArray = new Array({},{},{}) + try{ + DAHelper.batchInsert( + dataAbilityUri, + valueBucketArray, + ).then((data) => { + console.debug("=ACTS_BatchInsert_0300 BatchInsert Promise then data====>" + + ("json data 【") + JSON.stringify(data)+ (" 】; ====>")); + expect(typeof(data)).assertEqual("number"); + ret = true; + done(); + }).catch((err)=>{ + console.debug("=ACTS_BatchInsert_0300 BatchInsert Promise catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + ret = false + done(); + }); + }catch(err) { + console.error('=ACTS_BatchInsert_0300 batchInsert AsyncCallback catch(err)====>:'+err); + ret = false + done(); + } + setTimeout(function(){ + expect(ret).assertTrue(); + }, g_setTimeout); + console.log('ACTS_BatchInsert_0300====: ' + DAHelper) + var valueBucketArray = new Array({},{},{}) + try{ + await DAHelper.batchInsert( + dataAbilityUri, + valueBucketArray, + (err,data) => { + console.debug("=ACTS_BatchInsert_0400 batchInsert AsyncCallback err,data====>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data)+ (" 】;")); + expect(typeof(data)).assertEqual("number"); + ret = true + done(); + }, + ); + }catch(err) { + console.error('=ACTS_BatchInsert_0400 batchInsert AsyncCallback catch(err)====>:'+err); + ret = false + done(); + } + + setTimeout(function(){ + expect(ret).assertTrue(); + }, g_setTimeout); + console.log('ACTS_BatchInsert_0400====: ' + DAHelper) + try{ + const valueBucket = { + "name": "ACTS_BatchInsert_0500_roe1", + "age": 21, + "salary": 20.5, + } + var valueBucketArray = new Array({"name": "BatchInsert_0500_roe11", "age": 21, "salary": 20.5, }, + {"name": "BatchInsert_0500_roe12", "age": 21, "salary": 20.5, }, + {"name": "BatchInsert_0500_roe13", "age": 21, "salary": 20.5, }) + }catch(err) { + console.error('=ACTS_BatchInsert_0500 valueBucketArray catch(err)====>:'+err); + ret = false + done(); + } + try{ + DAHelper.batchInsert( + dataAbilityUri, + valueBucketArray, + ).then((data) => { + console.debug("=ACTS_BatchInsert_0300 BatchInsert Promise then data====>" + + ("json data 【") + JSON.stringify(data)+ (" 】")); + expect(typeof(data)).assertEqual("number"); + ret = true + done(); + }).catch((err)=>{ + console.debug("=ACTS_BatchInsert_0500 BatchInsert Promise catch err ====>" + + ("json err 【") + JSON.stringify(err) + (" 】 ")); + ret = false + done(); + }); + }catch(err) { + console.error('=ACTS_BatchInsert_0500 batchInsert AsyncCallback catch(err)====>:'+err); + ret = false + done(); + } + setTimeout(function(){ + expect(ret).assertTrue(); + }, g_setTimeout); + console.log('ACTS_BatchInsert_0500====: ' + DAHelper) + const valueBucket = { + "name": "BatchInsert_0600_roe1", + "age": 21, + "salary": 20.5, + } + var valueBucketArray = new Array({"name": "BatchInsert_0600_roe11", "age": 21, "salary": 20.5, }, + {"name": "BatchInsert_0600_roe12", "age": 21, "salary": 20.5, }, + {"name": "BatchInsert_0600_roe13", "age": 21, "salary": 20.5, }) + try{ + await DAHelper.batchInsert( + dataAbilityUri, + valueBucketArray, + (err,data) => { + console.debug("=ACTS_BatchInsert_0600 batchInsert AsyncCallback err,data====>" + + ("json err【") + JSON.stringify(err) + (" 】json data【") + JSON.stringify(data)+ (" 】;")); + expect(typeof(data)).assertEqual("number"); + ret = true + done(); + }, + ); + }catch(err) { + console.error('=ACTS_BatchInsert_0600 batchInsert AsyncCallback catch(err)====>:'+err); + ret = false + done(); + } + setTimeout(function(){ + expect(ret).assertTrue(); + }, g_setTimeout); + console.log('ACTS_BatchInsert_0600====:'+err); + expect(false).assertTrue(); + done(); + } + setTimeout(function () { + console.info('bms_uninstallAbility_0100====< setTimeout'); + }, g_setTimeout) + console.info('bms_uninstallAbility_0100====< end'); + }) + async function uninstall(bundleName) + { + try{ + var installer = await bundle.getBundleInstaller(); + installer.uninstall(bundleName, { + param: { + userId: 0, + installFlag: 1, + isKeepData: false + } + }, onReceiveUninstallEvent); + + function onReceiveUninstallEvent(err, data) { + console.info('========uninstall Finish========'); + expect(typeof err).assertEqual('object'); + expect(err.code).assertEqual(0); + expect(typeof data).assertEqual('object'); + expect(data.status).assertEqual(0); + expect(data.statusMessage).assertEqual('SUCCESS'); + } + }catch(err) { + console.error('=bms_uninstallAbility_0100 onReceiveUninstallEvent catch(err)====>:'+err); + expect(false).assertTrue(); + } + } +}) \ No newline at end of file diff --git a/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/test/List.test.js b/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/test/List.test.js new file mode 100644 index 0000000000000000000000000000000000000000..40e23cd987e9f45fd75ed42256496946b3cc3cdf --- /dev/null +++ b/appexecfwk/ams_standard/fwkdataaccessor/entry/src/main/js/test/List.test.js @@ -0,0 +1,15 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +require('./DataAbilityHelperJsSt.test.js') \ No newline at end of file diff --git a/appexecfwk/ams_standard/fwkdataaccessor/hap/amsStDataAbility.hap b/appexecfwk/ams_standard/fwkdataaccessor/hap/amsStDataAbility.hap new file mode 100644 index 0000000000000000000000000000000000000000..8a04fcd944dbbfe18474160e6cf9c2ea938aad50 Binary files /dev/null and b/appexecfwk/ams_standard/fwkdataaccessor/hap/amsStDataAbility.hap differ diff --git a/appexecfwk/ams_standard/fwkdataaccessor/signature/openharmony_sx.p7b b/appexecfwk/ams_standard/fwkdataaccessor/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5 Binary files /dev/null and b/appexecfwk/ams_standard/fwkdataaccessor/signature/openharmony_sx.p7b differ diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/Test.json b/appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/Test.json index 975f5d63962e296b82b0266e33667a8fccce57e5..17091a533b083dcf5ba7dddf79ac3172e7538636 100644 --- a/appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/Test.json +++ b/appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/Test.json @@ -28,6 +28,12 @@ "bmsJstest9.hap->/data/bmsJstest9.hap" ] + }, + { + "type": "ShellKit", + "run-command": [ + "chmod 644 /data/*.hap" + ] } ] } diff --git a/appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js b/appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js index f379cb12430c7f3c54a9d8b0a53b03b0a8d4ad16..acd803bc2d6fdb59e2e9e2d4c997589923bb0dd6 100644 --- a/appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js +++ b/appexecfwk/bundle_standard/bundlemanager/actsbundlemanagertest/entry/src/main/js/test/ExampleJsunit.test.js @@ -48,6 +48,7 @@ const SYSTEMDIR1 = "/data/accounts/account_0/applications/com.ohos.launcher/com. const CAMERA = 'com.permission.CAMERA' const MUSIC = 'com.permission.music' const WECHAT = 'com.permission.WeChat' +const TIMEOUT = 1000 describe('ActsBundleManagerTest', function () { /** @@ -56,7 +57,7 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test getBundleInfo interfaces with one hap. */ it('getBundleInfo_0100', 0, async function (done) { - await demo.getBundleInstaller().then((data) => { + demo.getBundleInstaller().then((data) => { data.install([PATH + BMSJSTEST1], { param: { userId: 0, @@ -81,7 +82,6 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.appInfo.labelId).assertEqual(16777216) expect(datainfo.appInfo.systemApp).assertEqual(false) expect(datainfo.appInfo.supportedModes).assertEqual(0) - expect(datainfo.appInfo.entryDir).assertEqual(DIR1) for (var j = 0; j < datainfo.appInfo.moduleInfos; j++) { expect(datainfo.appInfo.moduleInfos[j].moduleName).assertEqual("entry") expect(datainfo.appInfo.moduleInfos[j].moduleSourceDir).assertEqual(DIR1) @@ -89,7 +89,9 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.appInfo.enabled).assertEqual(true) done() } - done() + setTimeout(function() { + console.info('====> getBundleInfo_0100 =====>') + },TIMEOUT) }) /** @@ -114,15 +116,16 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.appInfo.labelId).assertEqual(16777216) expect(datainfo.appInfo.systemApp).assertEqual(false) expect(datainfo.appInfo.supportedModes).assertEqual(0) - expect(datainfo.appInfo.entryDir).assertEqual(DIR1) for (var j = 0; j < datainfo.appInfo.moduleInfos; j++) { expect(datainfo.appInfo.moduleInfos[j].moduleName).assertEqual("entry") expect(datainfo.appInfo.moduleInfos[j].moduleSourceDir).assertEqual(DIR1) } expect(datainfo.appInfo.enabled).assertEqual(true) + done() } - - done() + setTimeout(function() { + console.info('====> getBundleInfo_0600 =====>') + },1000) }) /** @@ -146,9 +149,11 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.appInfo.labelId).assertEqual(16777216) expect(datainfo.appInfo.systemApp).assertEqual(false) expect(datainfo.appInfo.supportedModes).assertEqual(0) - expect(datainfo.appInfo.entryDir).assertEqual(DIR1) expect(datainfo.appInfo.enabled).assertEqual(true) done() + setTimeout(function() { + console.info('====> getBundleInfo_1100 =====>') + },1000) }) /** @@ -174,15 +179,16 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.appInfo.labelId).assertEqual(16777216) expect(datainfo.appInfo.systemApp).assertEqual(false) expect(datainfo.appInfo.supportedModes).assertEqual(0) - expect(datainfo.appInfo.entryDir).assertEqual(DIR1) for (var j = 0; j < datainfo.appInfo.moduleInfos; j++) { expect(datainfo.appInfo.moduleInfos[j].moduleName).assertEqual("entry") expect(datainfo.appInfo.moduleInfos[j].moduleSourceDir).assertEqual(DIR1) } expect(datainfo.appInfo.enabled).assertEqual(true) + done() } - - done() + setTimeout(function() { + console.info('====> getBundleInfo_1200 =====>') + },1000) }) /** @@ -194,6 +200,9 @@ describe('ActsBundleManagerTest', function () { var datainfo = await demo.getApplicationInfos(8, 0) checkgetApplicationInfos(datainfo) done() + setTimeout(function() { + console.info('====> getApplicationInfos_0100 =====>') + },1000) }) function checkgetApplicationInfos(datainfo) { console.log("=============datainfo.length===============" + datainfo.length) @@ -203,7 +212,6 @@ describe('ActsBundleManagerTest', function () { expect(datainfo[i].description.length).assertLarger(0) expect(datainfo[i].icon.length).assertLarger(0) expect(datainfo[i].label.length).assertLarger(0) - expect(datainfo[i].entryDir.length).assertLarger(0) expect(datainfo[i].moduleSourceDirs.length).assertLarger(0) expect(datainfo[i].moduleInfos.length).assertLarger(0) expect(datainfo[i].supportedModes).assertEqual(0) @@ -213,6 +221,7 @@ describe('ActsBundleManagerTest', function () { expect(datainfo[i].moduleInfos[j].moduleSourceDir.length).assertLarger(0) } } + } /** @@ -228,7 +237,6 @@ describe('ActsBundleManagerTest', function () { expect(datainfo[i].description.length).assertLarger(0) expect(datainfo[i].icon.length).assertLarger(0) expect(datainfo[i].label.length).assertLarger(0) - expect(datainfo[i].entryDir.length).assertLarger(0) expect(datainfo[i].moduleSourceDirs.length).assertLarger(0) expect(datainfo[i].moduleInfos.length).assertLarger(0) expect(datainfo[i].supportedModes).assertEqual(0) @@ -238,8 +246,12 @@ describe('ActsBundleManagerTest', function () { expect(datainfo[i].moduleInfos[j].moduleSourceDir.length).assertLarger(0) } } + done() }); - done() + + setTimeout(function() { + console.info('====> getApplicationInfos_0600 =====>') + },1000) }) /** @@ -253,7 +265,6 @@ describe('ActsBundleManagerTest', function () { expect(data.length).assertLarger(0) for (var i = 0; i < data.length; i++) { expect(data[i].name.length).assertLarger(0) - expect(data[i].entryModuleName.length).assertLarger(0) expect(data[i].appInfo.name.length).assertLarger(0) expect(data[i].appInfo.description.length).assertLarger(0) expect(data[i].appInfo.icon.length).assertLarger(0) @@ -262,6 +273,9 @@ describe('ActsBundleManagerTest', function () { expect(data[i].appInfo.moduleInfos.length).assertLarger(0) } done(); + setTimeout(function() { + console.info('====> getBundleInfos_0100 =====>') + },1000) }) /** @@ -276,7 +290,7 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.description.length).assertLarger(0) expect(datainfo.icon.length).assertLarger(0) expect(datainfo.label.length).assertLarger(0) - expect(datainfo.entryDir.length).assertLarger(0) + expect(datainfo.moduleSourceDirs.length).assertLarger(0) expect(datainfo.moduleInfos.length).assertLarger(0) expect(datainfo.name).assertEqual(NAME1) @@ -291,7 +305,6 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.process).assertEqual("") expect(datainfo.enabled).assertEqual(true) expect(datainfo.flags).assertEqual(0) - expect(datainfo.entryDir).assertEqual(DIR1) expect(datainfo.moduleSourceDirs).assertEqual(DIR1) for(var j = 0; j < datainfo.moduleInfos; j++) { expect(datainfo.moduleInfos[j].moduleName).assertEqual("entry") @@ -299,6 +312,9 @@ describe('ActsBundleManagerTest', function () { } done() + setTimeout(function() { + console.info('====> getApplicationInfo_0100 =====>') + },1000) }) /** @@ -307,12 +323,10 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test getBundleInfos interfaces with one hap. */ it('getBundleInfos_0600', 0, async function (done) { - await demo.getBundleInfos(0, (error, data) => { + await demo.getAllBundleInfo(0, (error, data) => { expect(typeof data).assertEqual(OBJECT) - expect(data.length).assertLarger(0) for (var i = 0; i < data.length; i++) { expect(data[i].name.length).assertLarger(0) - expect(data[i].entryModuleName.length).assertLarger(0) expect(data[i].appInfo.name.length).assertLarger(0) expect(data[i].appInfo.description.length).assertLarger(0) expect(data[i].appInfo.icon.length).assertLarger(0) @@ -320,8 +334,12 @@ describe('ActsBundleManagerTest', function () { expect(data[i].appInfo.supportedModes).assertEqual(0) expect(data[i].appInfo.moduleInfos.length).assertLarger(0) } + done(); }) - done(); + + setTimeout(function() { + console.info('====> getBundleInfos_0600 =====>') + },1000) }) /** @@ -345,15 +363,18 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.labelId).assertEqual(16777216) expect(datainfo.systemApp).assertEqual(false) expect(datainfo.supportedModes).assertEqual(0) - expect(datainfo.entryDir).assertEqual(DIR1) expect(datainfo.enabled).assertEqual(true) for(var j = 0; j < datainfo.moduleInfos; j++) { expect(datainfo.moduleInfos[j].moduleName).assertEqual("entry") expect(datainfo.moduleInfos[j].moduleSourceDir).assertEqual(DIR1) } + done() }) - done() + + setTimeout(function() { + console.info('====> getApplicationInfo_0600 =====>') + },1000) }) /** @@ -378,6 +399,9 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.systemApp).assertEqual(false) expect(datainfo.supportedModes).assertEqual(0) done() + setTimeout(function() { + console.info('====> getApplicationInfo_1100 =====>') + },1000) }) /** @@ -401,8 +425,12 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.labelId).assertEqual(16777216) expect(datainfo.systemApp).assertEqual(false) expect(datainfo.supportedModes).assertEqual(0) + done() }) - done() + + setTimeout(function() { + console.info('====> getApplicationInfo_1200 =====>') + },1000) }) /** @@ -439,6 +467,9 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.abilityInfos[j].moduleName).assertEqual("entry") } done() + setTimeout(function() { + console.info('====> getBundleArchiveInfo_0100 =====>') + },1000) }) /** @@ -466,6 +497,9 @@ describe('ActsBundleManagerTest', function () { }) expect(datainfo.name.length).assertEqual(0) done(); + setTimeout(function() { + console.info('====> queryAbilityByWant_0400 =====>') + },1000) }) /** @@ -493,6 +527,9 @@ describe('ActsBundleManagerTest', function () { }) expect(datainfo.name.length).assertEqual(0) done(); + setTimeout(function() { + console.info('====> queryAbilityByWant_0500 =====>') + },1000) }) /** @@ -508,18 +545,16 @@ describe('ActsBundleManagerTest', function () { elementName: { deviceId: "0", bundleName: "com.example.myapplication1", - abilityName: ".MainAbility", + abilityName: "com.example.myapplication1.MainAbility", }, } - }, { - params: { - flags: 8, - userId: "0", - } - }, OnReceiveEvent) + },0,0,OnReceiveEvent) + console.info('====>queryAbilityByWant finish=====>') function OnReceiveEvent(err, datainfo) { - expect(datainfo.name).assertEqual(".MainAbility") + console.info('====>queryAbilityByWantOnReceiveEvent=====>' + JSON.stringify(datainfo)) + console.info('====>queryAbilityByWant_0600 OnReceiveEvent=====>') + expect(datainfo.name).assertEqual("com.example.myapplication1.MainAbility") expect(datainfo.label).assertEqual("$string:app_name") expect(datainfo.description).assertEqual("$string:mainability_description") expect(datainfo.icon).assertEqual("$media:icon") @@ -534,14 +569,18 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.applicationInfo.labelId).assertEqual(16777216) expect(datainfo.applicationInfo.systemApp).assertEqual(false) expect(datainfo.applicationInfo.supportedModes).assertEqual(0) - expect(datainfo.applicationInfo.entryDir).assertEqual(DIR1) expect(datainfo.applicationInfo.enabled).assertEqual(true) for (var j = 0; j < datainfo.applicationInfo.moduleInfos; j++) { expect(datainfo.applicationInfo.moduleInfos[j].moduleName).assertEqual("entry") expect(datainfo.applicationInfo.moduleInfos[j].moduleSourceDir).assertEqual(DIR1) } + console.info('====> queryAbili =====>') done() + } + setTimeout(function() { + console.info('====> queryAbilityByWant_0600 =====>') + },1000) }) /** @@ -560,17 +599,15 @@ describe('ActsBundleManagerTest', function () { abilityName: "", }, } - }, { - params: { - flags: 8, - userId: "0", - } - }, OnReceiveEvent) + },0,0,OnReceiveEvent) function OnReceiveEvent(err, datainfo) { expect(datainfo.name.length).assertEqual(0) done(); } + setTimeout(function() { + console.info('====> queryAbilityByWant_0900 =====>') + },1000) }) /** @@ -609,6 +646,9 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.appInfo.labelId).assertEqual(16777216) expect(datainfo.appInfo.systemApp).assertEqual(false) done() + setTimeout(function() { + console.info('====> getBundleInfo_0200 =====>') + },1000) }) /** @@ -636,6 +676,9 @@ describe('ActsBundleManagerTest', function () { } done() + setTimeout(function() { + console.info('====> getBundleInfo_0700 =====>') + },1000) }) /** @@ -648,6 +691,9 @@ describe('ActsBundleManagerTest', function () { console.info("==========ActsBmsGetInfosSecondScene is =========="+ JSON.stringify(datainfo)); checkgetApplicationInfos(datainfo) done() + setTimeout(function() { + console.info('====> getApplicationInfos_0200 =====>') + },1000) }) /** @@ -660,6 +706,9 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.length).assertLarger(0) checkgetApplicationInfos(datainfo) done() + setTimeout(function() { + console.info('====> getApplicationInfos_0400 =====>') + },1000) }) /** @@ -669,13 +718,11 @@ describe('ActsBundleManagerTest', function () { */ it('getApplicationInfos_0700', 0, async function (done) { await demo.getApplicationInfos(8, 0, (error, datainfo) => { - expect(datainfo.length).assertLarger(0) for (var i = 0; i < datainfo.length; i++) { expect(datainfo[i].name.length).assertLarger(0) expect(datainfo[i].description.length).assertLarger(0) expect(datainfo[i].icon.length).assertLarger(0) expect(datainfo[i].label.length).assertLarger(0) - expect(datainfo[i].entryDir.length).assertLarger(0) expect(datainfo[i].moduleSourceDirs.length).assertLarger(0) expect(datainfo[i].moduleInfos.length).assertLarger(0) expect(datainfo[i].supportedModes).assertEqual(0) @@ -685,8 +732,12 @@ describe('ActsBundleManagerTest', function () { expect(datainfo[i].moduleInfos[j].moduleSourceDir.length).assertLarger(0) } } + done() }); - done() + + setTimeout(function() { + console.info('====> getApplicationInfos_0700 =====>') + },1000) }) /** @@ -695,14 +746,13 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test getApplicationInfos interfaces with two haps and different param. */ it('getApplicationInfos_0900', 0, async function (done) { + await demo.getApplicationInfos(0, 0, (error, datainfo) => { - expect(datainfo.length).assertLarger(0) for (var i = 0; i < datainfo.length; i++) { expect(datainfo[i].name.length).assertLarger(0) expect(datainfo[i].description.length).assertLarger(0) expect(datainfo[i].icon.length).assertLarger(0) expect(datainfo[i].label.length).assertLarger(0) - expect(datainfo[i].entryDir.length).assertLarger(0) expect(datainfo[i].moduleSourceDirs.length).assertLarger(0) expect(datainfo[i].moduleInfos.length).assertLarger(0) expect(datainfo[i].supportedModes).assertEqual(0) @@ -712,8 +762,12 @@ describe('ActsBundleManagerTest', function () { expect(datainfo[i].moduleInfos[j].moduleSourceDir.length).assertLarger(0) } } + done() }); - done() + + setTimeout(function() { + console.info('====> getApplicationInfos_0900 =====>') + },1000) }) /** @@ -722,20 +776,31 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test getBundleInfos interfaces with two haps. */ it('getBundleInfos_0200', 0, async function (done) { - var data = await demo.getBundleInfos(0) + var data = await demo.getAllBundleInfo(0) expect(typeof data).assertEqual(OBJECT) - expect(data.length).assertLarger(0) + for (var i = 0; i < data.length; i++) { + console.info('====> getBundleInfos_02200 =====>' + JSON.stringify(data[i].name.length)) + console.info('====> getBundleInfos_03300 =====>' + JSON.stringify(data[i].entryModuleName.length)) + console.info('====> getBundleInfos_04400 =====>' + JSON.stringify(data[i].appInfo.name.length)) + console.info('====> getBundleInfos_05500 =====>' + JSON.stringify(data[i].appInfo.description.length)) + console.info('====> getBundleInfos_06600 =====>' + JSON.stringify(data[i].appInfo.icon.length)) + console.info('====> getBundleInfos_07700 =====>' + JSON.stringify(data[i].appInfo.label.length)) + console.info('====> getBundleInfos_08800 =====>' + JSON.stringify(data[i].appInfo.supportedModes)) + console.info('====> getBundleInfos_09900 =====>' + JSON.stringify(data[i].appInfo.moduleInfos.length)) expect(data[i].name.length).assertLarger(0) - expect(data[i].entryModuleName.length).assertLarger(0) expect(data[i].appInfo.name.length).assertLarger(0) expect(data[i].appInfo.description.length).assertLarger(0) expect(data[i].appInfo.icon.length).assertLarger(0) expect(data[i].appInfo.label.length).assertLarger(0) expect(data[i].appInfo.supportedModes).assertEqual(0) expect(data[i].appInfo.moduleInfos.length).assertLarger(0) + } done(); + setTimeout(function() { + console.info('====> getBundleInfos_0200 =====>') + },1000) }) /** @@ -744,12 +809,11 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test getBundleInfos interfaces with two haps and different param. */ it('getBundleInfos_0400', 0, async function (done) { - var data = await demo.getBundleInfos(1) + var data = await demo.getAllBundleInfo(1) expect(typeof data).assertEqual(OBJECT) - expect(data.length).assertLarger(0) + for (var i = 0; i < data.length; i++) { expect(data[i].name.length).assertLarger(0) - expect(data[i].entryModuleName.length).assertLarger(0) expect(data[i].appInfo.name.length).assertLarger(0) expect(data[i].appInfo.description.length).assertLarger(0) expect(data[i].appInfo.icon.length).assertLarger(0) @@ -758,6 +822,9 @@ describe('ActsBundleManagerTest', function () { expect(data[i].appInfo.moduleInfos.length).assertLarger(0) } done(); + setTimeout(function() { + console.info('====> getBundleInfos_0400 =====>') + },1000) }) /** @@ -766,12 +833,11 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test getBundleInfos interfaces with two haps. */ it('getBundleInfos_0700', 0, async function (done) { - await demo.getBundleInfos(0, (error, data) => { + await demo.getAllBundleInfo(0, (error, data) => { expect(typeof data).assertEqual(OBJECT) - expect(data.length).assertLarger(0) + for (var i = 0; i < data.length; i++) { expect(data[i].name.length).assertLarger(0) - expect(data[i].entryModuleName.length).assertLarger(0) expect(data[i].appInfo.name.length).assertLarger(0) expect(data[i].appInfo.description.length).assertLarger(0) expect(data[i].appInfo.icon.length).assertLarger(0) @@ -779,8 +845,12 @@ describe('ActsBundleManagerTest', function () { expect(data[i].appInfo.supportedModes).assertEqual(0) expect(data[i].appInfo.moduleInfos.length).assertLarger(0) } + done() }) - done() + + setTimeout(function() { + console.info('====> getBundleInfos_0700 =====>') + },1000) }) /** @@ -789,12 +859,11 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test getBundleInfos interfaces with two haps and different param. */ it('getBundleInfos_0900', 0, async function (done) { - await demo.getBundleInfos(1, (error, data) => { + await demo.getAllBundleInfo(1, (error, data) => { expect(typeof data).assertEqual(OBJECT) - expect(data.length).assertLarger(0) + for (var i = 0; i < data.length; i++) { expect(data[i].name.length).assertLarger(0) - expect(data[i].entryModuleName.length).assertLarger(0) expect(data[i].appInfo.name.length).assertLarger(0) expect(data[i].appInfo.description.length).assertLarger(0) expect(data[i].appInfo.icon.length).assertLarger(0) @@ -802,8 +871,12 @@ describe('ActsBundleManagerTest', function () { expect(data[i].appInfo.supportedModes).assertEqual(0) expect(data[i].appInfo.moduleInfos.length).assertLarger(0) } + done() }) - done() + + setTimeout(function() { + console.info('====> getBundleInfos_0900 =====>') + },1000) }) /** @@ -828,6 +901,9 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.systemApp).assertEqual(false) expect(datainfo.supportedModes).assertEqual(0) done() + setTimeout(function() { + console.info('====> getApplicationInfo_0200 =====>') + },1000) }) /** @@ -851,8 +927,12 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.labelId).assertEqual(16777216) expect(datainfo.systemApp).assertEqual(false) expect(datainfo.supportedModes).assertEqual(0) + done() }) - done() + + setTimeout(function() { + console.info('====> getApplicationInfo_0700 =====>') + },1000) }) /** @@ -875,6 +955,9 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.appInfo.labelId).assertEqual(16777216) expect(datainfo.appInfo.systemApp).assertEqual(false) done() + setTimeout(function() { + console.info('====> getBundleArchiveInfo_0200 =====>') + },1000) }) /** @@ -901,6 +984,9 @@ describe('ActsBundleManagerTest', function () { } done() + setTimeout(function() { + console.info('====> getBundleArchiveInfo_0700 =====>') + },1000) }) /** @@ -917,16 +1003,11 @@ describe('ActsBundleManagerTest', function () { elementName: { deviceId: "0", bundleName: "com.example.myapplication2", - abilityName: ".MainAbility", + abilityName: "com.example.myapplication1.MainAbility", }, } - }, { - params: { - flags: 8, - userId: "0", - } - }) - expect(datainfo.name).assertEqual(".MainAbility") + },0,0) + expect(datainfo.name).assertEqual("com.example.myapplication1.MainAbility") expect(datainfo.label).assertEqual("$string:app_name") expect(datainfo.description).assertEqual("$string:mainability_description") expect(datainfo.icon).assertEqual("$media:icon") @@ -941,13 +1022,15 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.applicationInfo.labelId).assertEqual(16777216) expect(datainfo.applicationInfo.systemApp).assertEqual(false) expect(datainfo.applicationInfo.supportedModes).assertEqual(0) - expect(datainfo.applicationInfo.entryDir).assertEqual(DIR2) expect(datainfo.applicationInfo.enabled).assertEqual(true) for (var j = 0; j < datainfo.applicationInfo.moduleInfos; j++) { expect(datainfo.applicationInfo.moduleInfos[j].moduleName).assertEqual("entry") expect(datainfo.applicationInfo.moduleInfos[j].moduleSourceDir).assertEqual(DIR2) } done(); + setTimeout(function() { + console.info('====> queryAbilityByWant_0200 =====>') + },1000) }) /** @@ -963,18 +1046,13 @@ describe('ActsBundleManagerTest', function () { elementName: { deviceId: "0", bundleName: "com.example.myapplication2", - abilityName: ".MainAbility", + abilityName: "com.example.myapplication1.MainAbility", }, } - }, { - params: { - flags: 8, - userId: "0", - } - }, OnReceiveEvent) + },0,0,OnReceiveEvent) function OnReceiveEvent(err, datainfo) { - expect(datainfo.name).assertEqual(".MainAbility") + expect(datainfo.name).assertEqual("com.example.myapplication1.MainAbility") expect(datainfo.label).assertEqual("$string:app_name") expect(datainfo.description).assertEqual("$string:mainability_description") expect(datainfo.icon).assertEqual("$media:icon") @@ -989,7 +1067,6 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.applicationInfo.labelId).assertEqual(16777216) expect(datainfo.applicationInfo.systemApp).assertEqual(false) expect(datainfo.applicationInfo.supportedModes).assertEqual(0) - expect(datainfo.applicationInfo.entryDir).assertEqual(DIR2) expect(datainfo.applicationInfo.enabled).assertEqual(true) for (var j = 0; j < datainfo.applicationInfo.moduleInfos; j++) { expect(datainfo.applicationInfo.moduleInfos[j].moduleName).assertEqual("entry") @@ -997,6 +1074,9 @@ describe('ActsBundleManagerTest', function () { } done() } + setTimeout(function() { + console.info('====> queryAbilityByWant_0700 =====>') + },1000) }) /** @@ -1040,6 +1120,9 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.appInfo.labelId).assertEqual(16777216) expect(datainfo.appInfo.systemApp).assertEqual(false) done() + setTimeout(function() { + console.info('====> getBundleInfo_0300 =====>') + },1000) }) /** @@ -1065,8 +1148,10 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.appInfo.labelId).assertEqual(16777216) expect(datainfo.appInfo.systemApp).assertEqual(false) } - done() + setTimeout(function() { + console.info('====> getBundleInfo_0800 =====>') + },1000) }) /** @@ -1080,6 +1165,9 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.length).assertLarger(0) checkgetApplicationInfos(datainfo) done() + setTimeout(function() { + console.info('====> getApplicationInfos_0300 =====>') + },1000) }) /** @@ -1088,25 +1176,29 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test getApplicationInfos interfaces with three haps and different param. */ it('getApplicationInfos_0500', 0, async function (done) { - await demo.getApplicationInfos(0, 0, (error, datainfo) => { - expect(datainfo.length).assertLarger(0) + await demo.getAllApplicationInfo(0, 0, (error, datainfo) => { + for (var i = 0; i < datainfo.length; i++) { expect(datainfo[i].name.length).assertLarger(0) expect(datainfo[i].description.length).assertLarger(0) expect(datainfo[i].icon.length).assertLarger(0) expect(datainfo[i].label.length).assertLarger(0) - expect(datainfo[i].entryDir.length).assertLarger(0) expect(datainfo[i].moduleSourceDirs.length).assertLarger(0) expect(datainfo[i].moduleInfos.length).assertLarger(0) expect(datainfo[i].supportedModes).assertEqual(0) expect(datainfo[i].flags).assertEqual(0) + for(var j = 0; j < datainfo[i].moduleInfos; j++) { expect(datainfo[i].moduleInfos[j].moduleName.length).assertLarger(0) expect(datainfo[i].moduleInfos[j].moduleSourceDir.length).assertLarger(0) } } + done() }); - done() + + setTimeout(function() { + console.info('====> getApplicationInfos_0500 =====>') + },1000) }) /** @@ -1115,14 +1207,13 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test getApplicationInfos interfaces with three haps. */ it('getApplicationInfos_0800', 0, async function (done) { - await demo.getApplicationInfos(8, 0, (error, datainfo) => { - expect(datainfo.length).assertLarger(0) + await demo.getAllApplicationInfo(8, 0, (error, datainfo) => { + for (var i = 0; i < datainfo.length; i++) { expect(datainfo[i].name.length).assertLarger(0) expect(datainfo[i].description.length).assertLarger(0) expect(datainfo[i].icon.length).assertLarger(0) expect(datainfo[i].label.length).assertLarger(0) - expect(datainfo[i].entryDir.length).assertLarger(0) expect(datainfo[i].moduleSourceDirs.length).assertLarger(0) expect(datainfo[i].moduleInfos.length).assertLarger(0) expect(datainfo[i].supportedModes).assertEqual(0) @@ -1132,8 +1223,12 @@ describe('ActsBundleManagerTest', function () { expect(datainfo[i].moduleInfos[j].moduleSourceDir.length).assertLarger(0) } } + done() }) - done() + + setTimeout(function() { + console.info('====> getApplicationInfos_0800 =====>') + },1000) }) /** @@ -1142,14 +1237,13 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test getApplicationInfos interfaces with three haps and different param. */ it('getApplicationInfos_1000', 0, async function (done) { - await demo.getApplicationInfos(0, 0, (error, datainfo) => { - expect(datainfo.length).assertLarger(0) + await demo.getAllApplicationInfo(0, 0, (error, datainfo) => { + for (var i = 0; i < datainfo.length; i++) { expect(datainfo[i].name.length).assertLarger(0) expect(datainfo[i].description.length).assertLarger(0) expect(datainfo[i].icon.length).assertLarger(0) expect(datainfo[i].label.length).assertLarger(0) - expect(datainfo[i].entryDir.length).assertLarger(0) expect(datainfo[i].moduleSourceDirs.length).assertLarger(0) expect(datainfo[i].moduleInfos.length).assertLarger(0) expect(datainfo[i].supportedModes).assertEqual(0) @@ -1159,8 +1253,12 @@ describe('ActsBundleManagerTest', function () { expect(datainfo[i].moduleInfos[j].moduleSourceDir.length).assertLarger(0) } } + done() }) - done() + + setTimeout(function() { + console.info('====> getApplicationInfos_1000 =====>') + },1000) }) /** @@ -1169,11 +1267,10 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test getBundleInfos interfaces with three haps. */ it('getBundleInfos_0300', 0, async function (done) { - var data = await demo.getBundleInfos(0) - expect(data.length).assertLarger(0) + var data = await demo.getAllBundleInfo(0) + for (var i = 0; i < data.length; i++) { expect(data[i].name.length).assertLarger(0) - expect(data[i].entryModuleName.length).assertLarger(0) expect(data[i].appInfo.name.length).assertLarger(0) expect(data[i].appInfo.description.length).assertLarger(0) expect(data[i].appInfo.icon.length).assertLarger(0) @@ -1182,6 +1279,9 @@ describe('ActsBundleManagerTest', function () { expect(data[i].appInfo.moduleInfos.length).assertLarger(0) } done() + setTimeout(function() { + console.info('====> getBundleInfos_0300 =====>') + },1000) }) /** @@ -1190,19 +1290,22 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test getBundleInfos interfaces with three haps and different param. */ it('getBundleInfos_0500', 0, async function (done) { - var data = await demo.getBundleInfos(1) - expect(data.length).assertLarger(0) + var data = await demo.getAllBundleInfo(1) + for (var i = 0; i < data.length; i++) { expect(data[i].name.length).assertLarger(0) - expect(data[i].entryModuleName.length).assertLarger(0) expect(data[i].appInfo.name.length).assertLarger(0) expect(data[i].appInfo.description.length).assertLarger(0) expect(data[i].appInfo.icon.length).assertLarger(0) expect(data[i].appInfo.label.length).assertLarger(0) expect(data[i].appInfo.supportedModes).assertEqual(0) expect(data[i].appInfo.moduleInfos.length).assertLarger(0) + } done() + setTimeout(function() { + console.info('====> getBundleInfos_0500 =====>') + },1000) }) /** @@ -1211,11 +1314,10 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test getBundleInfos interfaces with three haps. */ it('getBundleInfos_0800', 0, async function (done) { - await demo.getBundleInfos(0, (error, data) => { - expect(data.length).assertLarger(0) + await demo.getAllBundleInfo(0, (error, data) => { + for (var i = 0; i < data.length; i++) { expect(data[i].name.length).assertLarger(0) - expect(data[i].entryModuleName.length).assertLarger(0) expect(data[i].appInfo.name.length).assertLarger(0) expect(data[i].appInfo.description.length).assertLarger(0) expect(data[i].appInfo.icon.length).assertLarger(0) @@ -1223,8 +1325,12 @@ describe('ActsBundleManagerTest', function () { expect(data[i].appInfo.supportedModes).assertEqual(0) expect(data[i].appInfo.moduleInfos.length).assertLarger(0) } + done() }) - done() + + setTimeout(function() { + console.info('====> getBundleInfos_0800 =====>') + },1000) }) /** @@ -1233,11 +1339,10 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test getBundleInfos interfaces with three haps and different param. */ it('getBundleInfos_1000', 0, async function (done) { - await demo.getBundleInfos(1, (error, data) => { - expect(data.length).assertLarger(0) + await demo.getAllBundleInfo(1, (error, data) => { + for (var i = 0; i < data.length; i++) { expect(data[i].name.length).assertLarger(0) - expect(data[i].entryModuleName.length).assertLarger(0) expect(data[i].appInfo.name.length).assertLarger(0) expect(data[i].appInfo.description.length).assertLarger(0) expect(data[i].appInfo.icon.length).assertLarger(0) @@ -1245,8 +1350,12 @@ describe('ActsBundleManagerTest', function () { expect(data[i].appInfo.supportedModes).assertEqual(0) expect(data[i].appInfo.moduleInfos.length).assertLarger(0) } + done() }) - done() + + setTimeout(function() { + console.info('====> getBundleInfos_1000 =====>') + },1000) }) /** @@ -1270,6 +1379,9 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.systemApp).assertEqual(false) expect(datainfo.supportedModes).assertEqual(0) done() + setTimeout(function() { + console.info('====> getApplicationInfo_0300 =====>') + },1000) }) /** @@ -1292,8 +1404,12 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.labelId).assertEqual(16777216) expect(datainfo.systemApp).assertEqual(false) expect(datainfo.supportedModes).assertEqual(0) + done() }) - done() + + setTimeout(function() { + console.info('====> getApplicationInfo_0800 =====>') + },1000) }) /** @@ -1316,6 +1432,9 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.appInfo.labelId).assertEqual(16777216) expect(datainfo.appInfo.systemApp).assertEqual(false) done() + setTimeout(function() { + console.info('====> getBundleArchiveInfo_0300 =====>') + },1000) }) /** @@ -1339,9 +1458,12 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.appInfo.label).assertEqual("$string:app_name") expect(datainfo.appInfo.labelId).assertEqual(16777216) expect(datainfo.appInfo.systemApp).assertEqual(false) + done() } - done() + setTimeout(function() { + console.info('====> getBundleArchiveInfo_0800 =====>') + },1000) }) /** @@ -1358,16 +1480,11 @@ describe('ActsBundleManagerTest', function () { elementName: { deviceId: "0", bundleName: "com.example.myapplication4", - abilityName: ".MainAbility", + abilityName: "com.example.myapplication.MainAbility", }, } - }, { - params: { - flags: 8, - userId: "0", - } - }) - expect(datainfo.name).assertEqual(".MainAbility") + },0,0) + expect(datainfo.name).assertEqual("com.example.myapplication.MainAbility") expect(datainfo.label).assertEqual("$string:app_name") expect(datainfo.description).assertEqual("$string:mainability_description") expect(datainfo.icon).assertEqual("$media:icon") @@ -1387,6 +1504,9 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.applicationInfo.moduleInfos[j].moduleName).assertEqual("entry") } done(); + setTimeout(function() { + console.info('====> queryAbilityByWant_0300 =====>') + },1000) }) /** @@ -1402,18 +1522,13 @@ describe('ActsBundleManagerTest', function () { elementName: { deviceId: "0", bundleName: "com.example.myapplication4", - abilityName: ".MainAbility", + abilityName: "com.example.myapplication.MainAbility", }, } - }, { - params: { - flags: 8, - userId: "0", - } - }, OnReceiveEvent) + },0,0,OnReceiveEvent) function OnReceiveEvent(err, datainfo) { - expect(datainfo.name).assertEqual(".MainAbility") + expect(datainfo.name).assertEqual("com.example.myapplication.MainAbility") expect(datainfo.label).assertEqual("$string:app_name") expect(datainfo.description).assertEqual("$string:mainability_description") expect(datainfo.icon).assertEqual("$media:icon") @@ -1434,6 +1549,9 @@ describe('ActsBundleManagerTest', function () { } done() } + setTimeout(function() { + console.info('====> queryAbilityByWant_0800 =====>') + },1000) }) /** @@ -1445,6 +1563,9 @@ describe('ActsBundleManagerTest', function () { var datainfo = await demo.getBundleInfo('error', 1); expect(datainfo.name.length).assertEqual(0) done(); + setTimeout(function() { + console.info('====> getBundleInfo_0400 =====>') + },1000) }) /** @@ -1460,6 +1581,9 @@ describe('ActsBundleManagerTest', function () { } done() + setTimeout(function() { + console.info('====> getBundleInfo_0900 =====>') + },1000) }) /** @@ -1471,6 +1595,9 @@ describe('ActsBundleManagerTest', function () { var datainfo = await demo.getApplicationInfo(ERROR, 8, 1) checkgetApplicationInfoe(datainfo) done() + setTimeout(function() { + console.info('====> getApplicationInfo_0400 =====>') + },1000) }) function checkgetApplicationInfoe(datainfo) { expect(datainfo.name.length).assertEqual(0) @@ -1484,8 +1611,12 @@ describe('ActsBundleManagerTest', function () { it('getApplicationInfo_0900', 0, async function (done) { await demo.getApplicationInfo(ERROR, 8, 1, (error, datainfo) => { expect(datainfo.name.length).assertEqual(0) + done() }) - done() + + setTimeout(function() { + console.info('====> getApplicationInfo_0900 =====>') + },1000) }) /** @@ -1497,6 +1628,9 @@ describe('ActsBundleManagerTest', function () { var datainfo = await demo.getBundleArchiveInfo(PATH + ERROR, 1) expect(datainfo.name.length).assertEqual(0) done() + setTimeout(function() { + console.info('====> getBundleArchiveInfo_0400 =====>') + },1000) }) /** @@ -1509,9 +1643,12 @@ describe('ActsBundleManagerTest', function () { function OnReceiveEvent(err, datainfo) { expect(datainfo.name.length).assertEqual(0) + done() } - done() + setTimeout(function() { + console.info('====> getBundleArchiveInfo_0900 =====>') + },1000) }) /** @@ -1524,9 +1661,13 @@ describe('ActsBundleManagerTest', function () { function OnReceiveEvent(err, datainfo) { expect(datainfo.name.length).assertEqual(0) + done() } - done() + + setTimeout(function() { + console.info('====> getBundleInfo_1000 =====>') + },1000) }) /** @@ -1537,8 +1678,12 @@ describe('ActsBundleManagerTest', function () { it('getApplicationInfo_0500', 0, async function (done) { await demo.getApplicationInfo('', 8, 1, (error, datainfo) => { expect(datainfo.name.length).assertEqual(0) + done() }) - done() + + setTimeout(function() { + console.info('====> getApplicationInfo_0500 =====>') + },1000) }) /** @@ -1550,6 +1695,9 @@ describe('ActsBundleManagerTest', function () { var datainfo = await demo.getBundleInfo(' ', 1); expect(datainfo.name.length).assertEqual(0) done(); + setTimeout(function() { + console.info('====> getBundleInfo_0500 =====>') + },1000) }) /** @@ -1560,8 +1708,12 @@ describe('ActsBundleManagerTest', function () { it('getApplicationInfo_1000', 0, async function (done) { await demo.getApplicationInfo('', 8, 1, (error, datainfo) => { expect(datainfo.name.length).assertEqual(0) + done() }) - done() + + setTimeout(function() { + console.info('====> getApplicationInfo_1000 =====>') + },1000) }) /** @@ -1573,6 +1725,9 @@ describe('ActsBundleManagerTest', function () { var datainfo = await demo.getBundleArchiveInfo(' ', 1) expect(datainfo.name.length).assertEqual(0) done() + setTimeout(function() { + console.info('====> getBundleArchiveInfo_0500 =====>') + },1000) }) /** @@ -1610,9 +1765,12 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.abilityInfos[j].bundleName).assertEqual(NAME1) expect(datainfo.abilityInfos[j].moduleName).assertEqual("entry") } + done() } - done() + setTimeout(function() { + console.info('====> getBundleArchiveInfo_0600 =====>') + },1000) }) /** @@ -1625,9 +1783,13 @@ describe('ActsBundleManagerTest', function () { function OnReceiveEvent(err, datainfo) { expect(datainfo.name.length).assertEqual(0) + done() } - done() + + setTimeout(function() { + console.info('====> getBundleArchiveInfo_1000 =====>') + },1000) }) /** @@ -1665,9 +1827,12 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.abilityInfos[j].bundleName).assertEqual(NAME1) expect(datainfo.abilityInfos[j].moduleName).assertEqual("entry") } + done() } - done() + setTimeout(function() { + console.info('====> getBundleArchiveInfo_1100 =====>') + },1000) }) /** @@ -1705,9 +1870,12 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.abilityInfos[j].bundleName).assertEqual(NAME1) expect(datainfo.abilityInfos[j].moduleName).assertEqual("entry") } + done() } - done() + setTimeout(function() { + console.info('====> getBundleArchiveInfo_1200 =====>') + },1000) }) /** @@ -1724,16 +1892,11 @@ describe('ActsBundleManagerTest', function () { elementName: { deviceId: "0", bundleName: "com.example.myapplication1", - abilityName: ".MainAbility", + abilityName: "com.example.myapplication1.MainAbility", }, } - }, { - params: { - flags: 8, - userId: "0", - } - }) - expect(datainfo.name).assertEqual(".MainAbility") + },0,0) + expect(datainfo.name).assertEqual("com.example.myapplication1.MainAbility") expect(datainfo.label).assertEqual("$string:app_name") expect(datainfo.description).assertEqual("$string:mainability_description") expect(datainfo.icon).assertEqual("$media:icon") @@ -1748,13 +1911,15 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.applicationInfo.labelId).assertEqual(16777216) expect(datainfo.applicationInfo.systemApp).assertEqual(false) expect(datainfo.applicationInfo.supportedModes).assertEqual(0) - expect(datainfo.applicationInfo.entryDir).assertEqual(DIR1) expect(datainfo.applicationInfo.enabled).assertEqual(true) for (var j = 0; j < datainfo.applicationInfo.moduleInfos; j++) { expect(datainfo.applicationInfo.moduleInfos[j].moduleName).assertEqual("entry") expect(datainfo.applicationInfo.moduleInfos[j].moduleSourceDir).assertEqual(DIR1) } done(); + setTimeout(function() { + console.info('====> queryAbilityByWant_0100 =====>') + },1000) }) /** @@ -1768,21 +1933,17 @@ describe('ActsBundleManagerTest', function () { expect(datainfo.vendor).assertEqual("ohos") expect(datainfo.versionCode).assertEqual(1000000) expect(datainfo.versionName).assertEqual('1.0.0') - expect(datainfo.entryModuleName).assertEqual("settings") expect(datainfo.uid).assertLarger(2099) expect(datainfo.appInfo.name).assertEqual(LAUNCHER) expect(datainfo.appInfo.description).assertEqual("$string:mainability_description") - expect(datainfo.appInfo.descriptionId).assertEqual(16777217) - expect(datainfo.appInfo.icon).assertEqual("$media:icon") - expect(datainfo.appInfo.iconId).assertEqual(16777218) - expect(datainfo.appInfo.label).assertEqual("$string:app_name") - expect(datainfo.appInfo.labelId).assertEqual(16777216) expect(datainfo.appInfo.systemApp).assertEqual(true) expect(datainfo.appInfo.supportedModes).assertEqual(0) - expect(datainfo.appInfo.entryDir).assertEqual(SYSTEMDIR1) expect(datainfo.appInfo.moduleInfos.length).assertLarger(0) expect(datainfo.appInfo.enabled).assertEqual(true) done() + setTimeout(function() { + console.info('====> getBundleInfo_1300 =====>') + },1000) }) /** @@ -1801,17 +1962,15 @@ describe('ActsBundleManagerTest', function () { abilityName: "", }, } - }, { - params: { - flags: 8, - userId: "0", - } - }, OnReceiveEvent) + }, 0,0,OnReceiveEvent) function OnReceiveEvent(err, datainfo) { expect(datainfo.name.length).assertEqual(0) done() } + setTimeout(function() { + console.info('====> queryAbilityByWant_1000 =====>') + },1000) }) /** @@ -1820,14 +1979,18 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test getPermissionDef interfaces. */ it('getPermissionDef_0100', 0, async function(done){ - await demo.getPermissionDef(CAMERA).then((infos) => { + demo.getPermissionDef(CAMERA).then((infos) => { expect(infos.name).assertEqual("com.permission.CAMERA"); expect(infos.grantMode).assertEqual(1); expect(infos.availableScope).assertEqual(2); expect(infos.label).assertEqual("CAMERA permission"); expect(infos.description).assertEqual("CAMERA permission in detail"); + done(); }); - done(); + + setTimeout(function() { + console.info('====> getPermissionDef_0100 =====>') + },1000) }) /** @@ -1836,21 +1999,25 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test getPermissionDef interfaces. */ it('getPermissionDef_0200', 0, async function(done){ - await demo.getPermissionDef(CAMERA).then((infos) => { + demo.getPermissionDef(CAMERA).then((infos) => { expect(infos.name).assertEqual("com.permission.CAMERA"); expect(infos.grantMode).assertEqual(1); expect(infos.availableScope).assertEqual(2); expect(infos.label).assertEqual("CAMERA permission"); expect(infos.description).assertEqual("CAMERA permission in detail"); }); - await demo.getPermissionDef(MUSIC).then((infos) => { + demo.getPermissionDef(MUSIC).then((infos) => { expect(infos.name).assertEqual("com.permission.music"); expect(infos.grantMode).assertEqual(1); expect(infos.availableScope).assertEqual(2); expect(infos.label).assertEqual("music permission"); expect(infos.description).assertEqual("music permission in detail"); + done(); }); - done(); + + setTimeout(function() { + console.info('====> getPermissionDef_0200 =====>') + },1000) }) /** @@ -1859,7 +2026,7 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test getPermissionDef interfaces. */ it('getPermissionDef_0300', 0, async function(done){ - await demo.getPermissionDef(CAMERA).then((infos) => { + demo.getPermissionDef(CAMERA).then((infos) => { expect(infos.name).assertEqual("com.permission.CAMERA"); expect(infos.grantMode).assertEqual(1); expect(infos.availableScope).assertEqual(2); @@ -1867,7 +2034,7 @@ describe('ActsBundleManagerTest', function () { expect(infos.description).assertEqual("CAMERA permission in detail"); }); - await demo.getPermissionDef(MUSIC).then((infos) => { + demo.getPermissionDef(MUSIC).then((infos) => { expect(infos.name).assertEqual("com.permission.music"); expect(infos.grantMode).assertEqual(1); expect(infos.availableScope).assertEqual(2); @@ -1875,15 +2042,19 @@ describe('ActsBundleManagerTest', function () { expect(infos.description).assertEqual("music permission in detail"); }); - await demo.getPermissionDef(WECHAT).then((infos) => { + demo.getPermissionDef(WECHAT).then((infos) => { expect(infos.name).assertEqual("com.permission.WeChat"); expect(infos.grantMode).assertEqual(1); expect(infos.availableScope).assertEqual(2); expect(infos.label).assertEqual("WeChat permission"); expect(infos.description).assertEqual("WeChat permission in detail"); + done(); }); - done(); + + setTimeout(function() { + console.info('====> getPermissionDef_0300 =====>') + },1000) }) @@ -1893,14 +2064,17 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test getPermissionDef interfaces. */ it('getPermissionDef_0400', 0, async function(done){ - await demo.getPermissionDef('').then((infos) => { + demo.getPermissionDef('').then((infos) => { expect(infos.name).assertEqual(""); expect(infos.grantMode).assertEqual(""); expect(infos.availableScope).assertEqual(0); expect(infos.label).assertEqual(""); expect(infos.description).assertEqual(""); + done(); }); - done(); + setTimeout(function() { + console.info('====> getPermissionDef_0400 =====>') + },1000) }) /** @@ -1916,9 +2090,12 @@ describe('ActsBundleManagerTest', function () { expect(infos.availableScope).assertEqual(0); expect(infos.label).assertEqual(""); expect(infos.description).assertEqual(""); + done(); }); - done(); + setTimeout(function() { + console.info('====> getPermissionDef_0500 =====>') + },1000) }) /** @@ -1935,8 +2112,12 @@ describe('ActsBundleManagerTest', function () { expect(data.availableScope).assertEqual(2); expect(data.label).assertEqual("CAMERA permission"); expect(data.description).assertEqual("CAMERA permission in detail"); + done(); } - done(); + + setTimeout(function() { + console.info('====> getPermissionDef_0600 =====>') + },1000) }) /** @@ -1963,9 +2144,12 @@ describe('ActsBundleManagerTest', function () { expect(data.availableScope).assertEqual(2); expect(data.label).assertEqual("music permission"); expect(data.description).assertEqual("music permission in detail"); + done(); } - done(); + setTimeout(function() { + console.info('====> getPermissionDef_0700 =====>') + },1000) }) /** @@ -2015,8 +2199,11 @@ describe('ActsBundleManagerTest', function () { isKeepData: false } }); + done(); }) - done(); + setTimeout(function() { + console.info('====> getPermissionDef_0800 =====>') + },1000) }) function OnReceiveEvent1(err, data) { expect(data.name).assertEqual("com.permission.CAMERA"); @@ -2055,9 +2242,11 @@ describe('ActsBundleManagerTest', function () { expect(data.grantMode).assertEqual(""); expect(data.label).assertEqual(""); expect(data.description).assertEqual(""); + done(); } - - done(); + setTimeout(function() { + console.info('====> getPermissionDef_0900 =====>') + },1000) }) /** @@ -2073,9 +2262,11 @@ describe('ActsBundleManagerTest', function () { expect(data.grantMode).assertEqual(""); expect(data.label).assertEqual(""); expect(data.description).assertEqual(""); - + done(); } - done(); + setTimeout(function() { + console.info('====> getPermissionDef_1000 =====>') + },1000) }) /** @@ -2084,7 +2275,7 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test install interfaces. */ it('install_0100', 0, async function (done) { - await demo.getBundleInstaller().then((data) => { + demo.getBundleInstaller().then((data) => { data.uninstall(NAME1, { param: { userId: 0, @@ -2122,22 +2313,26 @@ describe('ActsBundleManagerTest', function () { } }, OnReceiveinstallEventO); }); - var datainfo = await demo.getBundleInfo(NAME1, 1); - expect(datainfo.name).assertEqual(NAME1); - expect(datainfo.uid).assertLarger(UIDMINVALUE); - await demo.getBundleInstaller().then((data) => { + demo.getBundleInstaller().then((data) => { data.uninstall(NAME1, { param: { userId: 0, isKeepData: false } }); + done(); }); - done(); + setTimeout(function() { + console.info('====> install_0100 =====>') + },1000) }) - function OnReceiveinstallEventO(err, data) { + async function OnReceiveinstallEventO(err, data) { expect(typeof data).assertEqual(OBJECT); expect(data.statusMessage).assertEqual(SUCCESS); + var datainfo = await demo.getBundleInfo(NAME1, 1); + console.info('====> install_0100 =====>'+ datainfo.name); + expect(datainfo.name).assertEqual(NAME1); + expect(datainfo.uid).assertLarger(UIDMINVALUE); } /** @@ -2146,7 +2341,7 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test install interfaces. */ it('install_0200', 0, async function (done) { - await demo.getBundleInstaller().then((data) => { + demo.getBundleInstaller().then((data) => { data.install([PATH + BMSJSTEST2], { param: { userId: 0, @@ -2160,16 +2355,20 @@ describe('ActsBundleManagerTest', function () { } }, OnReceiveinstallEvent); - function OnReceiveinstallEvent(err, data) { + async function OnReceiveinstallEvent(err, data) { expect(typeof data).assertEqual(OBJECT); expect(data.statusMessage).assertEqual(SUCCESS); + var datainfo = await demo.getBundleInfo(NAME2, 1); + expect(datainfo.name).assertEqual(NAME2); + expect(datainfo.uid).assertLarger(UIDMINVALUE); + done(); } + setTimeout(function() { + console.info('====> install_0200 =====>') + },1000) }); - var datainfo = await demo.getBundleInfo(NAME2, 1); - expect(datainfo.name).assertEqual(NAME2); - expect(datainfo.uid).assertLarger(UIDMINVALUE); - done(); + }) /** @@ -2178,7 +2377,7 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test install interfaces. */ it('install_0300', 0, async function (done) { - await demo.getBundleInstaller().then((data) => { + demo.getBundleInstaller().then((data) => { data.install([PATH + BMSJSTEST4], { param: { userId: 0, @@ -2198,21 +2397,26 @@ describe('ActsBundleManagerTest', function () { } }, OnReceiveinstallEvent); - function OnReceiveinstallEvent(err, data) { + async function OnReceiveinstallEvent(err, data) { expect(typeof data).assertEqual(OBJECT); expect(data.statusMessage).assertEqual(SUCCESS); + var datainfo1 = await demo.getBundleInfo(NAME3, 1); + expect(datainfo1.name).assertEqual(NAME3); + expect(datainfo1.uid).assertLarger(UIDMINVALUE); + var datainfo2 = await demo.getBundleInfo(NAME4, 1); + expect(datainfo2.name).assertEqual(NAME4); + expect(datainfo2.uid).assertLarger(UIDMINVALUE); + var datainfo3 = await demo.getBundleInfo(NAME5, 1); + expect(datainfo3.name).assertEqual(NAME5); + expect(datainfo3.uid).assertLarger(UIDMINVALUE); + done(); } + setTimeout(function() { + console.info('====> install_0300 =====>') + },1000) }); - var datainfo1 = await demo.getBundleInfo(NAME3, 1); - expect(datainfo1.name).assertEqual(NAME3); - expect(datainfo1.uid).assertLarger(UIDMINVALUE); - var datainfo2 = await demo.getBundleInfo(NAME4, 1); - expect(datainfo2.name).assertEqual(NAME4); - expect(datainfo2.uid).assertLarger(UIDMINVALUE); - var datainfo3 = await demo.getBundleInfo(NAME5, 1); - expect(datainfo3.name).assertEqual(NAME5); - expect(datainfo3.uid).assertLarger(UIDMINVALUE); - done(); + + }) /** @@ -2221,7 +2425,7 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test install interfaces. */ it('install_0400', 0, async function (done) { - await demo.getBundleInstaller().then((data) => { + demo.getBundleInstaller().then((data) => { data.install([PATH + ERROR], { param: { userId: 0, @@ -2233,8 +2437,12 @@ describe('ActsBundleManagerTest', function () { expect(typeof data).assertEqual(OBJECT); expect(data.statusMessage).assertEqual("STATUS_INSTALL_FAILURE_INVALID"); } + done(); }); - done(); + + setTimeout(function() { + console.info('====> install_0400 =====>') + },1000) }) /** @@ -2243,7 +2451,7 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test install interfaces. */ it('install_0500', 0, async function (done) { - await demo.getBundleInstaller().then((data) => { + demo.getBundleInstaller().then((data) => { data.install([''], { param: { userId: 0, @@ -2255,9 +2463,11 @@ describe('ActsBundleManagerTest', function () { expect(typeof data).assertEqual(OBJECT); expect(data.statusMessage).assertEqual("STATUS_INSTALL_FAILURE_INVALID"); } - + done(); }); - done(); + setTimeout(function() { + console.info('====> install_0500 =====>') + },1000) }) /** @@ -2266,7 +2476,7 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test install interfaces. */ it('install_0600', 0, async function (done) { - await demo.getBundleInstaller().then((data) => { + demo.getBundleInstaller().then((data) => { data.install([PATH + BMSJSTEST1], { param: { userId: 0, @@ -2282,15 +2492,18 @@ describe('ActsBundleManagerTest', function () { var datainfo1 = await demo.getBundleInfo(NAME1, 1); expect(datainfo1.name).assertEqual(NAME1); expect(datainfo1.uid).assertLarger(UIDMINVALUE); - await demo.getBundleInstaller().then((info) => { + demo.getBundleInstaller().then((info) => { info.uninstall(NAME1, { param: { userId: 0, isKeepData: true } }); + done(); }); - done(); + setTimeout(function() { + console.info('====> install_0600 =====>') + },1000) }) /** @@ -2299,7 +2512,7 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test install interfaces. */ it('install_0700', 0, async function (done) { - await demo.getBundleInstaller().then((data) => { + demo.getBundleInstaller().then((data) => { data.install([PATH + BMSJSTEST7], { param: { userId: 0, @@ -2311,9 +2524,11 @@ describe('ActsBundleManagerTest', function () { expect(typeof data).assertEqual(OBJECT); expect(data.statusMessage).assertEqual("STATUS_INSTALL_FAILURE_INVALID"); } - + done(); }); - done(); + setTimeout(function() { + console.info('====> install_0700 =====>') + },1000) }) /** @@ -2322,7 +2537,7 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test install interfaces. */ it('install_0800', 0, async function (done) { - await demo.getBundleInstaller().then((data) => { + demo.getBundleInstaller().then((data) => { data.install([PATH + BMSJSTEST8], { param: { userId: 0, @@ -2330,17 +2545,17 @@ describe('ActsBundleManagerTest', function () { } }, OnReceiveinstallEvent); - function OnReceiveinstallEvent(err, data) { + async function OnReceiveinstallEvent(err, data) { expect(typeof data).assertEqual(OBJECT); expect(data.statusMessage).assertEqual(SUCCESS); + var datainfo = await demo.getBundleInfo(THIRD1, 1); + expect(datainfo.name).assertEqual(THIRD1); + expect(datainfo.uid).assertLarger(UIDMINVALUE); + expect(datainfo.versionCode).assertEqual(VERSIONCODE1); + expect(datainfo.versionName).assertEqual(VERSIONNAME1); } }); - var datainfo = await demo.getBundleInfo(THIRD1, 1); - expect(datainfo.name).assertEqual(THIRD1); - expect(datainfo.uid).assertLarger(UIDMINVALUE); - expect(datainfo.versionCode).assertEqual(VERSIONCODE1); - expect(datainfo.versionName).assertEqual(VERSIONNAME1); - await demo.getBundleInstaller().then((info) => { + demo.getBundleInstaller().then((info) => { info.install([PATH + BMSJSTEST9], { param: { userId: 0, @@ -2348,25 +2563,29 @@ describe('ActsBundleManagerTest', function () { } }, OnReceiveinstallEvent); - function OnReceiveinstallEvent(err, data) { + async function OnReceiveinstallEvent(err, data) { expect(typeof data).assertEqual(OBJECT); expect(data.statusMessage).assertEqual(SUCCESS); + var datainfo = await demo.getBundleInfo(THIRD1, 1); + expect(datainfo.name).assertEqual(THIRD1); + expect(datainfo.uid).assertLarger(UIDMINVALUE); + expect(datainfo.versionCode).assertEqual(VERSIONCODE2); + expect(datainfo.versionName).assertEqual(VERSIONNAME2); } }); - var datainfo = await demo.getBundleInfo(THIRD1, 1); - expect(datainfo.name).assertEqual(THIRD1); - expect(datainfo.uid).assertLarger(UIDMINVALUE); - expect(datainfo.versionCode).assertEqual(VERSIONCODE2); - expect(datainfo.versionName).assertEqual(VERSIONNAME2); - await demo.getBundleInstaller().then((data) => { + demo.getBundleInstaller().then((data) => { data.uninstall(THIRD1, { param: { userId: 0, isKeepData: false } }); + done(); }); - done(); + + setTimeout(function() { + console.info('====> install_0800 =====>') + },1000) }) /** @@ -2375,7 +2594,7 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test install interfaces. */ it('install_0900', 0, async function (done) { - await demo.getBundleInstaller().then((data) => { + demo.getBundleInstaller().then((data) => { data.install([PATH + BMSJSTEST9], { param: { userId: 0, @@ -2383,17 +2602,18 @@ describe('ActsBundleManagerTest', function () { } }, OnReceiveinstallEvent); - function OnReceiveinstallEvent(err, data) { + async function OnReceiveinstallEvent(err, data) { expect(typeof data).assertEqual(OBJECT); expect(data.statusMessage).assertEqual(SUCCESS); + var datainfo = await demo.getBundleInfo(THIRD1, 1); + expect(datainfo.name).assertEqual(THIRD1); + expect(datainfo.uid).assertLarger(UIDMINVALUE); + expect(datainfo.versionCode).assertEqual(VERSIONCODE2); + expect(datainfo.versionName).assertEqual(VERSIONNAME2); } }); - var datainfo = await demo.getBundleInfo(THIRD1, 1); - expect(datainfo.name).assertEqual(THIRD1); - expect(datainfo.uid).assertLarger(UIDMINVALUE); - expect(datainfo.versionCode).assertEqual(VERSIONCODE2); - expect(datainfo.versionName).assertEqual(VERSIONNAME2); - await demo.getBundleInstaller().then((info) => { + + demo.getBundleInstaller().then((info) => { info.install([PATH + BMSJSTEST8], { param: { userId: 0, @@ -2401,25 +2621,29 @@ describe('ActsBundleManagerTest', function () { } }, OnReceiveinstallEvent); - function OnReceiveinstallEvent(err, data) { + async function OnReceiveinstallEvent(err, data) { expect(typeof data).assertEqual(OBJECT); expect(data.statusMessage).assertEqual("STATUS_INSTALL_FAILURE_INCOMPATIBLE"); + var datainfo = await demo.getBundleInfo(THIRD1, 1); + expect(datainfo.name).assertEqual(THIRD1); + expect(datainfo.uid).assertLarger(UIDMINVALUE); + expect(datainfo.versionCode).assertEqual(VERSIONCODE2); + expect(datainfo.versionName).assertEqual(VERSIONNAME2); } }); - var datainfo = await demo.getBundleInfo(THIRD1, 1); - expect(datainfo.name).assertEqual(THIRD1); - expect(datainfo.uid).assertLarger(UIDMINVALUE); - expect(datainfo.versionCode).assertEqual(VERSIONCODE2); - expect(datainfo.versionName).assertEqual(VERSIONNAME2); - await demo.getBundleInstaller().then((data) => { + + demo.getBundleInstaller().then((data) => { data.uninstall(THIRD1, { param: { userId: 0, isKeepData: false } }); + done(); }); - done(); + setTimeout(function() { + console.info('====> install_0900 =====>') + },1000) }) /** @@ -2428,7 +2652,7 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test uninstall interfaces. */ it('uninstall_0100', 0, async function (done) { - await demo.getBundleInstaller().then((data) => { + demo.getBundleInstaller().then((data) => { data.install([PATH + BMSJSTEST1], { param: { userId: 0, @@ -2438,7 +2662,7 @@ describe('ActsBundleManagerTest', function () { }); var datainfo1 = await demo.getBundleInfo(NAME1, 1); expect(datainfo1.name).assertEqual(NAME1); - await demo.getBundleInstaller().then((data) => { + demo.getBundleInstaller().then((data) => { data.uninstall(NAME1, { param: { userId: 0, @@ -2454,6 +2678,9 @@ describe('ActsBundleManagerTest', function () { var datainfo2 = await demo.getBundleInfo(NAME1, 1); expect(datainfo2.name).assertEqual(''); done(); + setTimeout(function() { + console.info('====> uninstall_0100 =====>') + },1000) }) /** @@ -2462,25 +2689,28 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test uninstall interfaces. */ it('uninstall_0200', 0, async function (done) { - await demo.getBundleInstaller().then((data) => { + demo.getBundleInstaller().then((data) => { data.install([PATH + BMSJSTEST1], { param: { userId: 0, isKeepData: false } + }, async (err, data)=>{ + var datainfo1 = await demo.getBundleInfo(NAME1, 1); + expect(datainfo1.name).assertEqual(NAME1); }); data.install([PATH + BMSJSTEST2], { param: { userId: 0, isKeepData: false } + }, async (err, data)=>{ + var datainfo2 = await demo.getBundleInfo(NAME2, 1); + expect(datainfo2.name).assertEqual(NAME2); }); }); - var datainfo1 = await demo.getBundleInfo(NAME1, 1); - expect(datainfo1.name).assertEqual(NAME1); - var datainfo2 = await demo.getBundleInfo(NAME2, 1); - expect(datainfo2.name).assertEqual(NAME2); - await demo.getBundleInstaller().then((data) => { + + demo.getBundleInstaller().then((data) => { data.uninstall(NAME1, { param: { userId: 0, @@ -2494,16 +2724,19 @@ describe('ActsBundleManagerTest', function () { } }, OnReceiveinstallEvent); - function OnReceiveinstallEvent(err, data) { + async function OnReceiveinstallEvent(err, data) { expect(typeof data).assertEqual(OBJECT); expect(data.statusMessage).assertEqual(SUCCESS); + var datainfo3 = await demo.getBundleInfo(NAME1, 1); + expect(datainfo3.name).assertEqual(''); + var datainfo4 = await demo.getBundleInfo(NAME2, 1); + expect(datainfo4.name).assertEqual(''); + done(); } }); - var datainfo3 = await demo.getBundleInfo(NAME1, 1); - expect(datainfo3.name).assertEqual(''); - var datainfo4 = await demo.getBundleInfo(NAME2, 1); - expect(datainfo4.name).assertEqual(''); - done(); + setTimeout(function() { + console.info('====> uninstall_0200 =====>') + },1000) }) /** @@ -2512,32 +2745,35 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test uninstall interfaces. */ it('uninstall_0300', 0, async function (done) { - await demo.getBundleInstaller().then((data) => { + demo.getBundleInstaller().then((data) => { data.install([PATH + BMSJSTEST4], { param: { userId: 0, isKeepData: false } + }, async (err, data)=>{ + var datainfo1 = await demo.getBundleInfo(NAME3, 1); + expect(datainfo1.name).assertEqual(NAME3); }); data.install([PATH + BMSJSTEST5], { param: { userId: 0, isKeepData: false } + }, async (err, data)=>{ + var datainfo2 = await demo.getBundleInfo(NAME4, 1); + expect(datainfo2.name).assertEqual(NAME4); }); data.install([PATH + BMSJSTEST6], { param: { userId: 0, isKeepData: false } + }, async (err, data)=>{ + var datainfo3 = await demo.getBundleInfo(NAME5, 1); + expect(datainfo3.name).assertEqual(NAME5); }); }); - var datainfo1 = await demo.getBundleInfo(NAME3, 1); - expect(datainfo1.name).assertEqual(NAME3); - var datainfo2 = await demo.getBundleInfo(NAME4, 1); - expect(datainfo2.name).assertEqual(NAME4); - var datainfo3 = await demo.getBundleInfo(NAME5, 1); - expect(datainfo3.name).assertEqual(NAME5); await demo.getBundleInstaller().then((data) => { data.uninstall(NAME3, { param: { @@ -2558,18 +2794,22 @@ describe('ActsBundleManagerTest', function () { } }, OnReceiveinstallEvent); - function OnReceiveinstallEvent(err, data) { + async function OnReceiveinstallEvent(err, data) { expect(typeof data).assertEqual(OBJECT); expect(data.statusMessage).assertEqual(SUCCESS); + var datainfo4 = await demo.getBundleInfo(NAME3, 1); + expect(datainfo4.name).assertEqual(''); + var datainfo5 = await demo.getBundleInfo(NAME4, 1); + expect(datainfo5.name).assertEqual(''); + var datainfo6 = await demo.getBundleInfo(NAME5, 1); + expect(datainfo6.name).assertEqual(''); + done(); } }); - var datainfo4 = await demo.getBundleInfo(NAME3, 1); - expect(datainfo4.name).assertEqual(''); - var datainfo5 = await demo.getBundleInfo(NAME4, 1); - expect(datainfo5.name).assertEqual(''); - var datainfo6 = await demo.getBundleInfo(NAME5, 1); - expect(datainfo6.name).assertEqual(''); - done(); + + setTimeout(function() { + console.info('====> uninstall_0300 =====>') + },1000) }) /** @@ -2578,7 +2818,7 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test uninstall interfaces. */ it('uninstall_0400', 0, async function (done) { - await demo.getBundleInstaller().then((data) => { + demo.getBundleInstaller().then((data) => { data.uninstall(ERROR, { param: { userId: 0, @@ -2590,8 +2830,12 @@ describe('ActsBundleManagerTest', function () { expect(typeof data).assertEqual(OBJECT); expect(data.statusMessage).assertEqual("STATUS_UNINSTALL_FAILURE"); } + done(); }); - done(); + + setTimeout(function() { + console.info('====> uninstall_0400 =====>') + },1000) }) /** @@ -2600,7 +2844,7 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test uninstall interfaces. */ it('uninstall_0500', 0, async function (done) { - await demo.getBundleInstaller().then((data) => { + demo.getBundleInstaller().then((data) => { data.uninstall('', { param: { userId: 0, @@ -2612,8 +2856,11 @@ describe('ActsBundleManagerTest', function () { expect(typeof data).assertEqual(OBJECT); expect(data.statusMessage).assertEqual("STATUS_UNINSTALL_FAILURE_ABORTED"); } + done(); }); - done(); + setTimeout(function() { + console.info('====> uninstall_0500 =====>') + },1000) }) /** @@ -2622,7 +2869,7 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test uninstall interfaces. */ it('uninstall_0600', 0, async function (done) { - await demo.getBundleInstaller().then((data) => { + demo.getBundleInstaller().then((data) => { data.uninstall(LAUNCHER, { param: { userId: 0, @@ -2634,8 +2881,11 @@ describe('ActsBundleManagerTest', function () { expect(typeof data).assertEqual(OBJECT); expect(data.statusMessage).assertEqual("STATUS_UNINSTALL_FAILURE_CONFLICT"); } + done(); }); - done(); + setTimeout(function() { + console.info('====> uninstall_0600 =====>') + },1000) }) /** @@ -2644,7 +2894,7 @@ describe('ActsBundleManagerTest', function () { * @tc.desc Test uninstall interfaces. */ it('uninstall_0700', 0, async function (done) { - await demo.getBundleInstaller().then((data) => { + demo.getBundleInstaller().then((data) => { data.install([PATH + BMSJSTEST1], { param: { userId: 0, @@ -2671,5 +2921,8 @@ describe('ActsBundleManagerTest', function () { expect(datainfo2.name).assertEqual(''); done(); }) + setTimeout(function() { + console.info('====> uninstall_0700 =====>') + },1000) })