diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/Test.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/Test.json index b7ed08ebb5437bc1b8398a30442d82f9da3e71a1..2759e09a7ec5a27835991f2441f4f2c4290e35c7 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/Test.json +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/Test.json @@ -20,6 +20,7 @@ "type": "ShellKit", "run-command": [ "remount", + "param set persist.sys.suspend_manager_enabled 0", "mkdir /data/test/" ] }, diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/config.json b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/config.json index acdffda30fa4546cc034ff80b0364f472fecb598..b3318373d86fb440755781df368a3c62e83cfad0 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/config.json +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/config.json @@ -44,7 +44,7 @@ "formsEnabled": false, "label": "$string:MainAbility_label", "type": "page", - "launchType": "standard" + "launchType": "singleton" }, { "orientation": "unspecified", diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/app.ets index e50dc2a8943d97888deef5b4b36106f52663efc1..b29c8974fa850c06194f75c059dcc8bff64ee553 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/app.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/app.ets @@ -12,10 +12,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import { Hypium } from '@ohos/hypium' +import testsuite from "./test/List.test"; export default { onCreate() { console.info('Application onCreate') + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + console.info('start run testcase!!!') + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) }, onDestroy() { console.info('Application onDestroy') diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/pages/index.ets index 2fb0fdf90bd41c7ded1e7b863c96947703d0d297..ccab691e36398896206b6b9fee6da9960897da57 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/pages/index.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/pages/index.ets @@ -38,12 +38,6 @@ async function routePage() { struct Index { aboutToAppear() { console.info("aboutToAppear start!!!!") - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) } build() { diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult.test.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult.test.ets index 721bc3f77cff4306e122ac3430c1b0b34ca75b5c..f4cab635c44f8785fa1d827d0cac1fdee7107283 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult.test.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/actsfreeinstallstartabilityforresultfatest/entry/src/main/ets/MainAbility/test/StartAbilityForResult.test.ets @@ -74,6 +74,18 @@ export default function StartAbilityForResult() { console.info("executeShellCommand4: err : " + JSON.stringify(err), " data : " + JSON.stringify(d)); }) await Utils.sleep(500); + var str = { + 'want': { + "bundleName": "com.open.harmony.startAbilityForResult", + "abilityName": "com.open.harmony.startAbilityForResult.MainAbility", + } + } + await featureAbility.startAbility(str).then((data) => { + console.info(' StartAbilityPromise successful. Data: ' + JSON.stringify(data)) + }).catch((error) => { + console.info(' StartAbilityPromise failed. Cause: ' + JSON.stringify(error)); + }) + await Utils.sleep(500); } if ("FreeInstall_FA_StartAbilityForResult_3200" === TAG) { diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfaentry/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfaentry/entry/src/main/ets/MainAbility/app.ets index c3a2854faa2a78073ca79b7e4801ea1ba870ba84..d779e6c276a31e1412c0d654c2c8719eef0aefad 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfaentry/entry/src/main/ets/MainAbility/app.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfaentry/entry/src/main/ets/MainAbility/app.ets @@ -40,7 +40,6 @@ export default { }, } ); - featureAbility.terminateSelf(); console.info('fAStartAbilityForResultPromise terminateSelfWithResult END'); }, 1000); }, diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/ets/MainAbility/app.ets index 881d9152e264e8415299fdcab1052e1f68f9ce73..f9c7aa4179805e4010f742aa28fcef016eed746b 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/ets/MainAbility/app.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm1/entry/src/main/ets/MainAbility/app.ets @@ -33,7 +33,6 @@ export default { }, } ); - featureAbility.terminateSelf(); console.info('fAStartAbilityForResultPromise terminateSelfWithResult END'); }, 1000); }, diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/ets/MainAbility/app.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/ets/MainAbility/app.ets index 881d9152e264e8415299fdcab1052e1f68f9ce73..f9c7aa4179805e4010f742aa28fcef016eed746b 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/ets/MainAbility/app.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultfatest/atomizationresultfahm2/entry/src/main/ets/MainAbility/app.ets @@ -33,7 +33,6 @@ export default { }, } ); - featureAbility.terminateSelf(); console.info('fAStartAbilityForResultPromise terminateSelfWithResult END'); }, 1000); },