From 870c925f15c6e6dd83e48f15919959cb94e449b4 Mon Sep 17 00:00:00 2001 From: chengxingzhen Date: Wed, 22 Jun 2022 16:43:46 +0800 Subject: [PATCH] fix wantAgent testcase Signed-off-by: chengxingzhen --- .../amsabilitymultiinstancetest/Test.json | 2 +- .../actscalltest/systemcallentrytest/Test.json | 2 +- .../actscalltest/thirdcalltest/Test.json | 2 +- .../actsusers/ActsAmsUsersKillProcessAppA/BUILD.gn | 8 ++++++-- .../actsusers/ActsAmsUsersKillProcessAppB/BUILD.gn | 8 ++++++-- .../actsusers/ActsAmsUsersKillProcessAppC/BUILD.gn | 8 ++++++-- .../actsusers/actsserviceabilityrelytest/BUILD.gn | 8 ++++++-- .../actsamsextensionmodulehap/BUILD.gn | 8 ++++++-- .../actsamsstaticextensioninfohap/BUILD.gn | 8 ++++++-- .../actsamsstatichapa/BUILD.gn | 8 ++++++-- .../actsamsstatichapb/BUILD.gn | 8 ++++++-- .../actsamsstaticquerytesttwohap/BUILD.gn | 8 ++++++-- .../entry/src/main/ets/test/Ability.test.ets | 2 -- .../src/main/js/test/FeatureAbilityJsunit.test.js | 11 +++-------- .../ActsKillProcessWithAccountRelyHap/BUILD.gn | 8 ++++++-- .../acts_systemappone_rely_test/BUILD.gn | 8 ++++++-- .../zidltest/actsamszidlclienttest/Test.json | 2 +- 17 files changed, 73 insertions(+), 36 deletions(-) diff --git a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/Test.json b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/Test.json index f3c05f6ca..ab88a5292 100755 --- a/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/Test.json +++ b/aafwk/aafwk_standard/abilitymultiinstance/amsabilitymultiinstancetest/Test.json @@ -2,7 +2,7 @@ "description": "Configuration for hjunit demo Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "1000000", + "test-timeout": "500000", "package": "com.example.abilitymultiinstance", "shell-timeout": "300000" }, diff --git a/aafwk/aafwk_standard/actscalltest/systemcallentrytest/Test.json b/aafwk/aafwk_standard/actscalltest/systemcallentrytest/Test.json index 9e244efab..87ac89c4f 100755 --- a/aafwk/aafwk_standard/actscalltest/systemcallentrytest/Test.json +++ b/aafwk/aafwk_standard/actscalltest/systemcallentrytest/Test.json @@ -2,7 +2,7 @@ "description": "Configuration for hjunit demo Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "1000000", + "test-timeout": "300000", "package": "com.example.systemcalltest", "shell-timeout": "60000" }, diff --git a/aafwk/aafwk_standard/actscalltest/thirdcalltest/Test.json b/aafwk/aafwk_standard/actscalltest/thirdcalltest/Test.json index be829fa64..5ff5006bf 100755 --- a/aafwk/aafwk_standard/actscalltest/thirdcalltest/Test.json +++ b/aafwk/aafwk_standard/actscalltest/thirdcalltest/Test.json @@ -2,7 +2,7 @@ "description": "Configuration for hjunit demo Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "1000000", + "test-timeout": "100000", "package": "com.example.thirdcalltest", "shell-timeout": "60000" }, diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/BUILD.gn b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/BUILD.gn index b3dd9ae9b..5e0fe0295 100755 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/BUILD.gn +++ b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppA/BUILD.gn @@ -13,15 +13,19 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsAmsUsersKillProcessAppA") { +ohos_hap("ActsAmsUsersKillProcessAppA") { hap_profile = "entry/src/main/module.json" + hap_name = "ActsAmsUsersKillProcessAppA" + subsystem_name = XTS_SUITENAME + final_hap_path = + "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" + testonly = true deps = [ ":actsamsuserskillprocessappa_js_assets", ":actsamsuserskillprocessappa_resources", ] ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsAmsUsersKillProcessAppA" } ohos_app_scope("actsamsuserskillprocessappa_app_profile") { diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/BUILD.gn b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/BUILD.gn index 9e4027b42..1cee2c826 100755 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/BUILD.gn +++ b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppB/BUILD.gn @@ -13,15 +13,19 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsAmsUsersKillProcessAppB") { +ohos_hap("ActsAmsUsersKillProcessAppB") { hap_profile = "entry/src/main/module.json" + hap_name = "ActsAmsUsersKillProcessAppB" + subsystem_name = XTS_SUITENAME + final_hap_path = + "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" + testonly = true deps = [ ":actsamsuserskillprocessappb_js_assets", ":actsamsuserskillprocessappb_resources", ] ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsAmsUsersKillProcessAppB" } ohos_app_scope("actsamsuserskillprocessappb_app_profile") { diff --git a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/BUILD.gn b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/BUILD.gn index 9e83279c4..cd1e0ed22 100755 --- a/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/BUILD.gn +++ b/aafwk/aafwk_standard/actsusers/ActsAmsUsersKillProcessAppC/BUILD.gn @@ -13,15 +13,19 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsAmsUsersKillProcessAppC") { +ohos_hap("ActsAmsUsersKillProcessAppC") { hap_profile = "entry/src/main/module.json" + hap_name = "ActsAmsUsersKillProcessAppC" + subsystem_name = XTS_SUITENAME + final_hap_path = + "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" + testonly = true deps = [ ":actsamsuserskillprocessappc_js_assets", ":actsamsuserskillprocessappc_resources", ] ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsAmsUsersKillProcessAppC" } ohos_app_scope("actsamsuserskillprocessappc_app_profile") { diff --git a/aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/BUILD.gn b/aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/BUILD.gn index eeaa839ab..2c0778690 100755 --- a/aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/BUILD.gn +++ b/aafwk/aafwk_standard/actsusers/actsserviceabilityrelytest/BUILD.gn @@ -13,15 +13,19 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("actsServiceAbilityRelyHap") { +ohos_hap("actsServiceAbilityRelyHap") { hap_profile = "entry/src/main/module.json" + hap_name = "actsServiceAbilityRelyHap" + subsystem_name = XTS_SUITENAME + final_hap_path = + "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" + testonly = true deps = [ ":actsserviceabilityrelytest_js_assets", ":actsserviceabilityrelytest_resources", ] ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "actsServiceAbilityRelyHap" } ohos_app_scope("actsserviceabilityrelytest_app_profile") { diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/BUILD.gn b/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/BUILD.gn index 360d52861..9ca60e9bc 100644 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/BUILD.gn +++ b/aafwk/aafwk_standard/amscontextualinforquery/actsamsextensionmodulehap/BUILD.gn @@ -13,15 +13,19 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsAmsExtensionModuleRelyHap") { +ohos_hap("ActsAmsExtensionModuleRelyHap") { hap_profile = "entry/src/main/module.json" + hap_name = "ActsAmsExtensionModuleRelyHap" + subsystem_name = XTS_SUITENAME + final_hap_path = + "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" + testonly = true deps = [ ":actsamsextensionmodulerelyhap_js_assets", ":actsamsextensionmodulerelyhap_resources", ] ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsAmsExtensionModuleRelyHap" } ohos_app_scope("actsamsextensionmodulerelyhap_app_profile") { diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/BUILD.gn b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/BUILD.gn index 73fef6379..faf67aba5 100644 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/BUILD.gn +++ b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticextensioninfohap/BUILD.gn @@ -13,15 +13,19 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsAmsStaticExtensionInfoRelyHap") { +ohos_hap("ActsAmsStaticExtensionInfoRelyHap") { hap_profile = "entry/src/main/module.json" + hap_name = "ActsAmsStaticExtensionInfoRelyHap" + subsystem_name = XTS_SUITENAME + final_hap_path = + "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" + testonly = true deps = [ ":actsamsstaticextensioninforelyhap_js_assets", ":actsamsstaticextensioninforelyhap_resources", ] ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsAmsStaticExtensionInfoRelyHap" } ohos_app_scope("actsamsstaticextensioninforelyhap_app_profile") { diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/BUILD.gn b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/BUILD.gn index 2e0822e76..14e681ef1 100644 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/BUILD.gn +++ b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapa/BUILD.gn @@ -13,15 +13,19 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsAmsStaticARelyHap") { +ohos_hap("ActsAmsStaticARelyHap") { hap_profile = "entry/src/main/module.json" + hap_name = "ActsAmsStaticARelyHap" + subsystem_name = XTS_SUITENAME + final_hap_path = + "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" + testonly = true deps = [ ":actsamsstaticarelyhap_js_assets", ":actsamsstaticarelyhap_resources", ] ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsAmsStaticARelyHap" } ohos_app_scope("actsamsstaticarelyhap_app_profile") { diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/BUILD.gn b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/BUILD.gn index 2550f6187..4de043201 100644 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/BUILD.gn +++ b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstatichapb/BUILD.gn @@ -13,15 +13,19 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsAmsStaticBRelyHap") { +ohos_hap("ActsAmsStaticBRelyHap") { hap_profile = "entry/src/main/module.json" + hap_name = "ActsAmsStaticBRelyHap" + subsystem_name = XTS_SUITENAME + final_hap_path = + "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" + testonly = true deps = [ ":actsamsstaticbrelyhap_js_assets", ":actsamsstaticbrelyhap_resources", ] ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsAmsStaticBRelyHap" } ohos_app_scope("actsamsstaticbrelyhap_app_profile") { diff --git a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/BUILD.gn b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/BUILD.gn index 54cfa87f7..ca18977cc 100644 --- a/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/BUILD.gn +++ b/aafwk/aafwk_standard/amscontextualinforquery/actsamsstaticquerytesttwohap/BUILD.gn @@ -13,15 +13,19 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsAmsStaticQueryTestTwoRelyHap") { +ohos_hap("ActsAmsStaticQueryTestTwoRelyHap") { hap_profile = "entry/src/main/module.json" + hap_name = "ActsAmsStaticQueryTestTwoRelyHap" + subsystem_name = XTS_SUITENAME + final_hap_path = + "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" + testonly = true deps = [ ":actsamsstaticquerytesttworelyhap_js_assets", ":actsamsstaticquerytesttworelyhap_resources", ] ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsAmsStaticQueryTestTwoRelyHap" } ohos_app_scope("actsamsstaticquerytesttworelyhap_app_profile") { diff --git a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/test/Ability.test.ets b/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/test/Ability.test.ets index d76e7f621..c93b7093f 100644 --- a/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/test/Ability.test.ets +++ b/aafwk/aafwk_standard/amsdisplayIdtest/actsamsstartabilitytest/entry/src/main/ets/test/Ability.test.ets @@ -74,8 +74,6 @@ export default function abilityTest(abilityContext) { describe('ActsGetDisplayIdStartAbilityTest', function () { afterEach(async (done) => { - let installer = await bundle.getBundleInstaller(); - var count = 0; var testMissionId; testMissionId = await getMissionId(); 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 aea8ccf58..f98cddd8d 100755 --- 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 @@ -21,6 +21,7 @@ import wantAgent from '@ohos.wantAgent'; import particleAbility from '@ohos.ability.particleAbility' import backgroundTaskManager from '@ohos.backgroundTaskManager' +const CREATELOCALDIR = "/data/storage/el2/base/haps/entry"; const START_ABILITY_TIMEOUT = 4000; const TERMINATE_ABILITY_TIMEOUT = 1000; const TIMEOUT = 1000; @@ -1815,12 +1816,6 @@ describe('ActsFeatureAbilityTest', function () { ); }) - // checkGetOrCreateLocalDir - function checkGetOrCreateLocalDir(info) { - console.log("checkGetOrCreateLocalDir root dir : " + info); - expect(typeof (info)).assertEqual("string"); - } - // @tc.number: ACTS_GetOrCreateLocalDir_0100 // @tc.name: GetProcessName : Obtains the name of the current process. // @tc.desc: Check the return value of the interface (by promise) @@ -1829,7 +1824,7 @@ describe('ActsFeatureAbilityTest', function () { var promise = context.getOrCreateLocalDir(); expect(typeof (promise)).assertEqual("object"); var info = await context.getOrCreateLocalDir(); - checkGetOrCreateLocalDir(info); + expect(info).assertEqual(CREATELOCALDIR); done(); setTimeout(function () { console.info('====> ACTS_GetOrCreateLocalDir_0100 =====>') @@ -1843,7 +1838,7 @@ describe('ActsFeatureAbilityTest', function () { var context = featureAbility.getContext(); var result = context.getOrCreateLocalDir( (err, data) => { - checkGetOrCreateLocalDir(data); + expect(data).assertEqual(CREATELOCALDIR); done() } ); diff --git a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/BUILD.gn b/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/BUILD.gn index ee3d4bb15..ab5874b35 100755 --- a/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/BUILD.gn +++ b/aafwk/aafwk_standard/killprocesswithaccountstage/ActsKillProcessWithAccountRelyHap/BUILD.gn @@ -13,15 +13,19 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsKillProcessWithAccountRelyHap") { +ohos_hap("ActsKillProcessWithAccountRelyHap") { hap_profile = "entry/src/main/module.json" + hap_name = "ActsKillProcessWithAccountRelyHap" + subsystem_name = XTS_SUITENAME + final_hap_path = + "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" + testonly = true deps = [ ":actskillprocesswithaccountrelyhap_js_assets", ":actskillprocesswithaccountrelyhap_resources", ] ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsKillProcessWithAccountRelyHap" } ohos_app_scope("actskillprocesswithaccountrelyhap_app_profile") { diff --git a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/BUILD.gn b/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/BUILD.gn index 29f5958df..5b8bb03ca 100755 --- a/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/BUILD.gn +++ b/aafwk/aafwk_standard/non_concurrent/acts_systemappone_rely_test/BUILD.gn @@ -13,15 +13,19 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ActsSystemAppOneRelyHap") { +ohos_hap("ActsSystemAppOneRelyHap") { hap_profile = "entry/src/main/module.json" + hap_name = "ActsSystemAppOneRelyHap" + subsystem_name = XTS_SUITENAME + final_hap_path = + "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" + testonly = true deps = [ ":acts_systemappone_rely_test_js_assets", ":acts_systemappone_rely_test_resources", ] ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsSystemAppOneRelyHap" } ohos_app_scope("acts_systemappone_rely_test_app_profile") { diff --git a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/Test.json b/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/Test.json index 00594c184..dd53882af 100755 --- a/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/Test.json +++ b/aafwk/aafwk_standard/zidltest/actsamszidlclienttest/Test.json @@ -2,7 +2,7 @@ "description": "Configuration for hjunit demo Tests", "driver": { "type": "JSUnitTest", - "test-timeout": "1000000", + "test-timeout": "300000", "package": "com.example.zidlclienttest", "shell-timeout": "300000" }, -- GitLab