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 @@ +