From 53dbad5d05eef0289f7892d209321f85cc5f3b14 Mon Sep 17 00:00:00 2001 From: jy Date: Fri, 18 Mar 2022 16:19:53 +0800 Subject: [PATCH] add 3.1 test Signed-off-by: jy --- .../fa/fa_applicationinfo_test/BUILD.gn | 0 .../fa/fa_applicationinfo_test/Test.json | 0 .../entry/src/main/config.json | 172 ++-- .../js/test/ApplicationInfoJsunit.test.js | 332 ++++--- .../entry/src/main/js/test/List.test.js | 30 +- .../main/resources/base/element/string.json | 38 +- .../signature/openharmony_sx.p7b | Bin .../fa/fa_auxstate_test/BUILD.gn | 0 .../fa/fa_auxstate_test/Test.json | 0 .../entry/src/main/config.json | 126 +-- .../main/resources/base/element/string.json | 22 +- .../signature/openharmony_sx.p7b | Bin .../fa/fa_auxsumstate_test/BUILD.gn | 0 .../fa/fa_auxsumstate_test/Test.json | 0 .../entry/src/main/config.json | 126 +-- .../main/resources/base/element/string.json | 22 +- .../signature/openharmony_sx.p7b | Bin .../aafwk_standard/fa/fa_clear_test/BUILD.gn | 0 .../aafwk_standard/fa/fa_clear_test/Test.json | 0 .../fa_clear_test/entry/src/main/config.json | 280 +++--- .../entry/src/main/js/MainAbility/app.js | 0 .../src/main/js/MainAbility/i18n/en-US.json | 0 .../src/main/js/MainAbility/i18n/zh-CN.json | 0 .../main/js/MainAbility/pages/index/index.css | 0 .../main/js/MainAbility/pages/index/index.hml | 0 .../main/js/MainAbility/pages/index/index.js | 0 .../js/MainAbility/pages/second/second.css | 0 .../js/MainAbility/pages/second/second.hml | 0 .../js/MainAbility/pages/second/second.js | 0 .../entry/src/main/js/MainAbility2/app.js | 0 .../src/main/js/MainAbility2/i18n/en-US.json | 0 .../src/main/js/MainAbility2/i18n/zh-CN.json | 0 .../js/MainAbility2/pages/index/index.css | 0 .../js/MainAbility2/pages/index/index.hml | 0 .../main/js/MainAbility2/pages/index/index.js | 0 .../js/MainAbility2/pages/second/second.css | 0 .../js/MainAbility2/pages/second/second.hml | 0 .../js/MainAbility2/pages/second/second.js | 0 .../entry/src/main/js/MainAbility3/app.js | 0 .../src/main/js/MainAbility3/i18n/en-US.json | 0 .../src/main/js/MainAbility3/i18n/zh-CN.json | 0 .../js/MainAbility3/pages/index/index.css | 0 .../js/MainAbility3/pages/index/index.hml | 0 .../main/js/MainAbility3/pages/index/index.js | 0 .../js/MainAbility3/pages/second/second.css | 0 .../js/MainAbility3/pages/second/second.hml | 0 .../js/MainAbility3/pages/second/second.js | 0 .../entry/src/main/js/MainAbility4/app.js | 0 .../src/main/js/MainAbility4/i18n/en-US.json | 0 .../src/main/js/MainAbility4/i18n/zh-CN.json | 0 .../js/MainAbility4/pages/index/index.css | 0 .../js/MainAbility4/pages/index/index.hml | 0 .../main/js/MainAbility4/pages/index/index.js | 0 .../js/MainAbility4/pages/second/second.css | 0 .../js/MainAbility4/pages/second/second.hml | 0 .../js/MainAbility4/pages/second/second.js | 0 .../src/main/js/ServiceAbility/service.js | 0 .../src/main/js/test/AbilityDisableTest.js | 510 +++++------ .../entry/src/main/js/test/List.test.js | 30 +- .../main/resources/base/element/string.json | 78 +- .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../fa/fa_configurationconstant_test/BUILD.gn | 0 .../fa_configurationconstant_test/Test.json | 0 .../entry/.gitignore | 4 +- .../entry/build.gradle | 42 +- .../entry/package.json | 2 +- .../entry/src/main/config.json | 87 +- .../entry/src/main/js/MainAbility/app.js | 22 +- .../src/main/js/MainAbility/i18n/zh-CN.json | 10 +- .../main/js/MainAbility/pages/index/index.hml | 26 +- .../main/js/MainAbility/pages/index/index.js | 46 +- .../js/MainAbility/pages/second/second.hml | 26 +- .../js/MainAbility/pages/second/second.js | 1 + .../entry/src/main/js/MainAbility2/app.js | 32 - .../src/main/js/MainAbility2/i18n/en-US.json | 11 - .../src/main/js/MainAbility2/i18n/zh-CN.json | 11 - .../js/MainAbility2/pages/index/index.css | 38 - .../js/MainAbility2/pages/index/index.hml | 20 - .../main/js/MainAbility2/pages/index/index.js | 59 -- .../js/MainAbility2/pages/second/second.css | 38 - .../js/MainAbility2/pages/second/second.hml | 20 - .../entry/src/main/js/MainAbility3/app.js | 40 - .../src/main/js/MainAbility3/i18n/en-US.json | 11 - .../src/main/js/MainAbility3/i18n/zh-CN.json | 11 - .../js/MainAbility3/pages/index/index.css | 38 - .../js/MainAbility3/pages/index/index.hml | 20 - .../main/js/MainAbility3/pages/index/index.js | 55 -- .../js/MainAbility3/pages/second/second.css | 38 - .../js/MainAbility3/pages/second/second.hml | 20 - .../entry/src/main/js/MainAbility4/app.js | 29 - .../src/main/js/MainAbility4/i18n/en-US.json | 11 - .../src/main/js/MainAbility4/i18n/zh-CN.json | 11 - .../js/MainAbility4/pages/index/index.css | 38 - .../js/MainAbility4/pages/index/index.hml | 20 - .../main/js/MainAbility4/pages/index/index.js | 56 -- .../js/MainAbility4/pages/second/second.css | 38 - .../js/MainAbility4/pages/second/second.hml | 20 - .../src/main/js/test/AbilityDisableTest.js | 390 -------- .../entry/src/main/js/test/ClearTest.js | 126 --- .../js/test/JSMyapplicationJsunit.test.js | 191 ++++ .../entry/src/main/js/test/List.test.js | 34 +- .../main/resources/base/element/string.json | 58 +- .../signature/openharmony_sx.p7b | Bin .../fa/fa_coverapi_test/BUILD.gn | 0 .../fa/fa_coverapi_test/Test.json | 0 .../entry/src/main/config.json | 126 +-- .../entry/src/main/js/MainAbility/app.js | 0 .../src/main/js/MainAbility/i18n/en-US.json | 0 .../src/main/js/MainAbility/i18n/zh-CN.json | 0 .../main/js/MainAbility/pages/index/index.css | 0 .../main/js/MainAbility/pages/index/index.hml | 0 .../main/js/MainAbility/pages/index/index.js | 0 .../js/MainAbility/pages/second/second.css | 0 .../js/MainAbility/pages/second/second.hml | 0 .../js/MainAbility/pages/second/second.js | 0 .../entry/src/main/js/test/List.test.js | 30 +- .../entry/src/main/js/test/coverApiTest.js | 248 ++--- .../main/resources/base/element/string.json | 22 +- .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../fa/fa_equeryabilitybywant_test/BUILD.gn | 0 .../fa/fa_equeryabilitybywant_test/Test.json | 0 .../entry/src/main/config.json | 280 +++--- .../entry/src/main/js/MainAbility/app.js | 0 .../src/main/js/MainAbility/i18n/en-US.json | 0 .../src/main/js/MainAbility/i18n/zh-CN.json | 0 .../main/js/MainAbility/pages/index/index.css | 0 .../main/js/MainAbility/pages/index/index.hml | 0 .../main/js/MainAbility/pages/index/index.js | 0 .../js/MainAbility/pages/second/second.css | 0 .../js/MainAbility/pages/second/second.hml | 0 .../js/MainAbility/pages/second/second.js | 0 .../entry/src/main/js/MainAbility2/app.js | 0 .../src/main/js/MainAbility2/i18n/en-US.json | 0 .../src/main/js/MainAbility2/i18n/zh-CN.json | 0 .../js/MainAbility2/pages/index/index.css | 0 .../js/MainAbility2/pages/index/index.hml | 0 .../main/js/MainAbility2/pages/index/index.js | 0 .../js/MainAbility2/pages/second/second.css | 0 .../js/MainAbility2/pages/second/second.hml | 0 .../js/MainAbility2/pages/second/second.js | 0 .../entry/src/main/js/MainAbility3/app.js | 0 .../src/main/js/MainAbility3/i18n/en-US.json | 0 .../src/main/js/MainAbility3/i18n/zh-CN.json | 0 .../js/MainAbility3/pages/index/index.css | 0 .../js/MainAbility3/pages/index/index.hml | 0 .../main/js/MainAbility3/pages/index/index.js | 0 .../js/MainAbility3/pages/second/second.css | 0 .../js/MainAbility3/pages/second/second.hml | 0 .../js/MainAbility3/pages/second/second.js | 0 .../entry/src/main/js/MainAbility4/app.js | 0 .../src/main/js/MainAbility4/i18n/en-US.json | 0 .../src/main/js/MainAbility4/i18n/zh-CN.json | 0 .../js/MainAbility4/pages/index/index.css | 0 .../js/MainAbility4/pages/index/index.hml | 0 .../main/js/MainAbility4/pages/index/index.js | 0 .../js/MainAbility4/pages/second/second.css | 0 .../js/MainAbility4/pages/second/second.hml | 0 .../js/MainAbility4/pages/second/second.js | 0 .../src/main/js/ServiceAbility/service.js | 0 .../src/main/js/test/AbilityDisableTest.js | 262 +++--- .../entry/src/main/js/test/List.test.js | 30 +- .../main/resources/base/element/string.json | 78 +- .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin aafwk/aafwk_standard/fa/fa_lock_test/BUILD.gn | 0 .../aafwk_standard/fa/fa_lock_test/Test.json | 0 .../fa/fa_lock_test/entry/.gitignore | 4 +- .../fa/fa_lock_test/entry/build.gradle | 42 +- .../fa/fa_lock_test/entry/package.json | 2 +- .../fa_lock_test/entry/src/main/config.json | 368 ++++---- .../entry/src/main/js/test/List.test.js | 34 +- .../src/main/js/test/LockMission.test.js | 538 +++++------ .../entry/src/main/js/test/LockNew.js | 752 ++++++++-------- .../main/resources/base/element/string.json | 86 +- .../fa_lock_test/signature/openharmony_sx.p7b | Bin .../fa_missionmanager_test/entry/.gitignore | 4 +- .../fa_missionmanager_test/entry/build.gradle | 42 +- .../fa_missionmanager_test/entry/package.json | 2 +- .../entry/src/main/config.json | 138 +-- .../entry/src/main/js/test/List.test.js | 28 +- .../src/main/js/test/MissionManager.test.js | 364 ++++---- .../main/resources/base/element/string.json | 22 +- .../fa_missionmanager_test/entry2/.gitignore | 4 +- .../entry2/build.gradle | 46 +- .../entry2/package.json | 2 +- .../entry2/src/main/config.json | 164 ++-- .../entry2/src/main/js/test2/List2.test.js | 30 +- .../entry2/src/main/js/test2/entry2.test.js | 30 +- .../main/resources/base/element/string.json | 38 +- .../fa/fa_movemissiontofront_test/BUILD.gn | 0 .../fa/fa_movemissiontofront_test/Test.json | 0 .../entry/.gitignore | 4 +- .../entry/build.gradle | 42 +- .../entry/package.json | 2 +- .../src/main/js/test/AbilityDisableTest.js | 816 ++++++++--------- .../entry/src/main/js/test/List.test.js | 30 +- .../main/resources/base/element/string.json | 78 +- .../signature/openharmony_sx.p7b | Bin .../aafwk_standard/fa/fa_state_test/BUILD.gn | 0 .../aafwk_standard/fa/fa_state_test/Test.json | 0 .../fa_state_test/entry/src/main/config.json | 178 ++-- .../entry/src/main/js/test/List.test.js | 28 +- .../entry/src/main/js/test/startFULL.test.js | 162 ++-- .../main/resources/base/element/string.json | 22 +- .../signature/openharmony_sx.p7b | Bin .../fa/fa_statelistener_test/BUILD.gn | 0 .../fa/fa_statelistener_test/Test.json | 0 .../entry/src/main/config.json | 172 ++-- .../entry/src/main/js/MainAbility/app.js | 0 .../src/main/js/MainAbility/i18n/en-US.json | 0 .../src/main/js/MainAbility/i18n/zh-CN.json | 0 .../main/js/MainAbility/pages/index/index.css | 0 .../main/js/MainAbility/pages/index/index.hml | 0 .../main/js/MainAbility/pages/index/index.js | 0 .../js/MainAbility/pages/second/second.css | 0 .../js/MainAbility/pages/second/second.hml | 0 .../js/MainAbility/pages/second/second.js | 0 .../entry/src/main/js/MainAbility2/app.js | 0 .../src/main/js/MainAbility2/i18n/en-US.json | 0 .../src/main/js/MainAbility2/i18n/zh-CN.json | 0 .../js/MainAbility2/pages/index/index.css | 0 .../js/MainAbility2/pages/index/index.hml | 0 .../main/js/MainAbility2/pages/index/index.js | 0 .../js/MainAbility2/pages/second/second.css | 0 .../js/MainAbility2/pages/second/second.hml | 0 .../js/MainAbility2/pages/second/second.js | 0 .../entry/src/main/js/test/List.test.js | 34 +- .../entry/src/main/js/test/startFULL.test.js | 142 +-- .../main/resources/base/element/string.json | 38 +- .../src/main/resources/base/media/icon.png | Bin .../signature/openharmony_sx.p7b | Bin .../fa/fa_sumstate_test/BUILD.gn | 0 .../fa/fa_sumstate_test/Test.json | 0 .../entry/src/main/config.json | 224 ++--- .../entry/src/main/js/test/List.test.js | 28 +- .../entry/src/main/js/test/startFULL.test.js | 402 ++++----- .../main/resources/base/element/string.json | 38 +- .../signature/openharmony_sx.p7b | Bin .../fa/fa_taskmanager_test/entry/.gitignore | 4 +- .../fa/fa_taskmanager_test/entry/build.gradle | 42 +- .../fa/fa_taskmanager_test/entry/package.json | 2 +- .../entry/src/main/js/test/List.test.js | 30 +- .../src/main/js/test/MissionManagerTest.js | 852 +++++++++--------- .../main/resources/base/element/string.json | 86 +- .../fa/fa_taskswiting_test/BUILD.gn | 0 .../fa/fa_taskswiting_test/Test.json | 0 .../entry/src/main/js/test/List.test.js | 30 +- .../src/main/js/test/taskSwitchJsunit.test.js | 676 +++++++------- .../main/resources/base/element/string.json | 70 +- .../signature/openharmony_sx.p7b | Bin aafwk/aafwk_standard/stage/BUILD.gn | 5 +- .../stage/stageenvchangetest/BUILD.gn | 32 + .../stage/stageenvchangetest/Test.json | 18 + .../entry/src/main/config.json | 97 ++ .../entry/src/main/ets/AbilityStage.ts} | 49 +- .../src/main/ets/MainAbility/MainAbility.ts | 49 + .../entry/src/main/ets/MainAbility/app.ets} | 18 +- .../src/main/ets/MainAbility/pages/index.ets | 63 ++ .../src/main/ets/MainAbility/pages/second.ets | 43 + .../entry/src/main/ets/test/List.test.ets} | 48 +- .../src/main/ets/test/MissionManager_test.ets | 155 ++++ .../main/resources/base/element/string.json | 12 + .../src/main/resources/base/media/icon.png | Bin 0 -> 6790 bytes .../signature/openharmony_sx.p7b | Bin 0 -> 3437 bytes 266 files changed, 5764 insertions(+), 6389 deletions(-) mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_applicationinfo_test/BUILD.gn mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_applicationinfo_test/Test.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_applicationinfo_test/signature/openharmony_sx.p7b mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_auxstate_test/BUILD.gn mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_auxstate_test/Test.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_auxstate_test/signature/openharmony_sx.p7b mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_auxsumstate_test/BUILD.gn mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_auxsumstate_test/Test.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_auxsumstate_test/signature/openharmony_sx.p7b mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/BUILD.gn mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/Test.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/config.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/app.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/i18n/en-US.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/i18n/zh-CN.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/pages/index/index.css mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/pages/index/index.hml mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/pages/index/index.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/pages/second/second.css mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/pages/second/second.hml mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/pages/second/second.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/app.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/i18n/en-US.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/i18n/zh-CN.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/pages/index/index.css mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/pages/index/index.hml mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/pages/index/index.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/pages/second/second.css mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/pages/second/second.hml mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/pages/second/second.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/app.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/i18n/en-US.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/i18n/zh-CN.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/pages/index/index.css mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/pages/index/index.hml mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/pages/index/index.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/pages/second/second.css mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/pages/second/second.hml mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/pages/second/second.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/app.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/i18n/en-US.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/i18n/zh-CN.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/pages/index/index.css mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/pages/index/index.hml mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/pages/index/index.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/pages/second/second.css mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/pages/second/second.hml mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/pages/second/second.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/ServiceAbility/service.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/test/AbilityDisableTest.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/test/List.test.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/resources/base/element/string.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/resources/base/media/icon.png mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_clear_test/signature/openharmony_sx.p7b mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_configurationconstant_test/BUILD.gn mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_configurationconstant_test/Test.json delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/app.js delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/i18n/en-US.json delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/i18n/zh-CN.json delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/pages/index/index.css delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/pages/index/index.hml delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/pages/index/index.js delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/pages/second/second.css delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/pages/second/second.hml delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/app.js delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/i18n/en-US.json delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/i18n/zh-CN.json delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/pages/index/index.css delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/pages/index/index.hml delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/pages/index/index.js delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/pages/second/second.css delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/pages/second/second.hml delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/app.js delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/i18n/en-US.json delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/i18n/zh-CN.json delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/pages/index/index.css delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/pages/index/index.hml delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/pages/index/index.js delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/pages/second/second.css delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/pages/second/second.hml delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/test/AbilityDisableTest.js delete mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/test/ClearTest.js create mode 100644 aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/test/JSMyapplicationJsunit.test.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_configurationconstant_test/signature/openharmony_sx.p7b mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_coverapi_test/BUILD.gn mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_coverapi_test/Test.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/config.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/app.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/i18n/en-US.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/i18n/zh-CN.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/pages/index/index.css mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/pages/index/index.hml mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/pages/index/index.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/pages/second/second.css mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/pages/second/second.hml mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/pages/second/second.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/test/List.test.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/test/coverApiTest.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/resources/base/element/string.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/resources/base/media/icon.png mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_coverapi_test/signature/openharmony_sx.p7b mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/BUILD.gn mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/Test.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/config.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/app.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/i18n/en-US.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/i18n/zh-CN.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/pages/index/index.css mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/pages/index/index.hml mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/pages/index/index.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/pages/second/second.css mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/pages/second/second.hml mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/pages/second/second.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/app.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/i18n/en-US.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/i18n/zh-CN.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/pages/index/index.css mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/pages/index/index.hml mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/pages/index/index.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/pages/second/second.css mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/pages/second/second.hml mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/pages/second/second.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/app.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/i18n/en-US.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/i18n/zh-CN.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/pages/index/index.css mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/pages/index/index.hml mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/pages/index/index.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/pages/second/second.css mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/pages/second/second.hml mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/pages/second/second.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/app.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/i18n/en-US.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/i18n/zh-CN.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/pages/index/index.css mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/pages/index/index.hml mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/pages/index/index.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/pages/second/second.css mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/pages/second/second.hml mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/pages/second/second.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/ServiceAbility/service.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/test/AbilityDisableTest.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/test/List.test.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/resources/base/element/string.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/resources/base/media/icon.png mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/signature/openharmony_sx.p7b mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_lock_test/BUILD.gn mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_lock_test/Test.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_lock_test/signature/openharmony_sx.p7b mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_movemissiontofront_test/BUILD.gn mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_movemissiontofront_test/Test.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_movemissiontofront_test/signature/openharmony_sx.p7b mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_state_test/BUILD.gn mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_state_test/Test.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_state_test/signature/openharmony_sx.p7b mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/BUILD.gn mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/Test.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/config.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/app.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/i18n/en-US.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/i18n/zh-CN.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/pages/index/index.css mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/pages/index/index.hml mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/pages/index/index.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/pages/second/second.css mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/pages/second/second.hml mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/pages/second/second.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/app.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/i18n/en-US.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/i18n/zh-CN.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/pages/index/index.css mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/pages/index/index.hml mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/pages/index/index.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/pages/second/second.css mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/pages/second/second.hml mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/pages/second/second.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/test/List.test.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/test/startFULL.test.js mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/resources/base/element/string.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/resources/base/media/icon.png mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_statelistener_test/signature/openharmony_sx.p7b mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_sumstate_test/BUILD.gn mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_sumstate_test/Test.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_sumstate_test/signature/openharmony_sx.p7b mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_taskswiting_test/BUILD.gn mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_taskswiting_test/Test.json mode change 100644 => 100755 aafwk/aafwk_standard/fa/fa_taskswiting_test/signature/openharmony_sx.p7b create mode 100644 aafwk/aafwk_standard/stage/stageenvchangetest/BUILD.gn create mode 100644 aafwk/aafwk_standard/stage/stageenvchangetest/Test.json create mode 100644 aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/config.json rename aafwk/aafwk_standard/{fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/pages/second/second.js => stage/stageenvchangetest/entry/src/main/ets/AbilityStage.ts} (67%) create mode 100644 aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/MainAbility/MainAbility.ts rename aafwk/aafwk_standard/{fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/pages/second/second.js => stage/stageenvchangetest/entry/src/main/ets/MainAbility/app.ets} (76%) create mode 100644 aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/MainAbility/pages/index.ets create mode 100644 aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/MainAbility/pages/second.ets rename aafwk/aafwk_standard/{fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/pages/second/second.js => stage/stageenvchangetest/entry/src/main/ets/test/List.test.ets} (66%) create mode 100644 aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/test/MissionManager_test.ets create mode 100644 aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/resources/base/element/string.json create mode 100644 aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/resources/base/media/icon.png create mode 100644 aafwk/aafwk_standard/stage/stageenvchangetest/signature/openharmony_sx.p7b diff --git a/aafwk/aafwk_standard/fa/fa_applicationinfo_test/BUILD.gn b/aafwk/aafwk_standard/fa/fa_applicationinfo_test/BUILD.gn old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_applicationinfo_test/Test.json b/aafwk/aafwk_standard/fa/fa_applicationinfo_test/Test.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_applicationinfo_test/entry/src/main/config.json b/aafwk/aafwk_standard/fa/fa_applicationinfo_test/entry/src/main/config.json index ff28e61a9..6daf6bd8a 100644 --- a/aafwk/aafwk_standard/fa/fa_applicationinfo_test/entry/src/main/config.json +++ b/aafwk/aafwk_standard/fa/fa_applicationinfo_test/entry/src/main/config.json @@ -1,87 +1,87 @@ -{ - "app": { - "bundleName": "com.example.applicationinfo", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.applicationinfo", - "name": ".MyApplication", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_mainability", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "orientation": "unspecified", - "srcPath": "MainAbility2", - "name": ".MainAbility2", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_mainability2", - "formsEnabled": false, - "label": "$string:entry_MainAbility2", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility2", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } +{ + "app": { + "bundleName": "com.example.applicationinfo", + "vendor": "example", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.applicationinfo", + "name": ".MyApplication", + "mainAbility": ".MainAbility", + "srcPath": "", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "srcPath": "MainAbility2", + "name": ".MainAbility2", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability2", + "formsEnabled": false, + "label": "$string:entry_MainAbility2", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility2", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_applicationinfo_test/entry/src/main/js/test/ApplicationInfoJsunit.test.js b/aafwk/aafwk_standard/fa/fa_applicationinfo_test/entry/src/main/js/test/ApplicationInfoJsunit.test.js index eadc55ff4..01cf6ddd7 100644 --- a/aafwk/aafwk_standard/fa/fa_applicationinfo_test/entry/src/main/js/test/ApplicationInfoJsunit.test.js +++ b/aafwk/aafwk_standard/fa/fa_applicationinfo_test/entry/src/main/js/test/ApplicationInfoJsunit.test.js @@ -1,136 +1,198 @@ -// @ts-nocheck -/* - * 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 {describe, expect, it} from 'deccjsunit/index' -import commonEvent from '@ohos.commonevent' -import featureAbility from '@ohos.ability.featureability' -import formBindingData from '@ohos.application.formBindingData' - -var getCallingBundleUri = { - events: ["uri"] -} - -var getCallingBundleType = { - events: ["type"] -} - -describe("ApplicationInfoTest", function () { - var TAG = ""; - - /* - * @tc.number SUB_AA_OpenHarmony_FormBase_1000 - * @tc.name Validate formbindingdata creation data - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_FormBase_1000', 0, async function (done) { - console.log("------------start SUB_AA_OpenHarmony_FormBase_1000-------------"); - TAG = "SUB_AA_OpenHarmony_FormBase_1000"; - var dataObj = { - temperature:"11c", - "time":"11:00", - "test":11, - "test3":true - } - var result = formBindingData.createFormBindingData(dataObj) - console.log(TAG + " result is : " + JSON.stringify(result)) - expect(JSON.stringify(result)). - assertEqual(JSON.stringify({"data":"{\"temperature\":\"11c\",\"time\":\"11:00\",\"test\":11,\"test3\":true}"})); - done(); - console.log("------------end SUB_AA_OpenHarmony_FormBase_1000-------------"); - }); - - /* - * @tc.number SUB_AA_OpenHarmony_Want_0200 - * @tc.name Switching the mission in the launcherlist to the foreground is not supported - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_Want_0200', 0, async function (done) { - console.log("------------start SUB_AA_OpenHarmony_Want_0200-------------"); - TAG = "SUB_AA_OpenHarmony_Want_0200"; - var Subscriber = ""; - - function SubscribeCallBackUri(err, data) { - console.log(TAG + " Subscribe CallBack data:" + JSON.stringify(data)); - if(data.event != ""){ - for (var key in data.parameters){ - console.log(TAG + "data.parameters[key] is :" + data.parameters[key]) - } - expect(data.parameters[key] == "key={true,true,false}").assertTrue(); - } - done(); - } - - commonEvent.createSubscriber(getCallingBundleUri).then(async (data) => { - console.debug(TAG + "====>Create Subscriber====>"); - Subscriber = data; - await commonEvent.subscribe(Subscriber, SubscribeCallBackUri); - }); - - featureAbility.startAbility({ - want: { - abilityName: "com.example.applicationinfo.MainAbility2", - bundleName: "com.example.applicationinfo", - uri: "key={true,true,false}" - } - }, (err, data) => { - console.log(TAG + ":startAbility success , err:" + JSON.stringify(err) + ",data:" + JSON.stringify(data)); - }); - console.log("------------end SUB_AA_OpenHarmony_Want_0200-------------"); - }); - - /* - * @tc.number SUB_AA_OpenHarmony_Want_0300 - * @tc.name Switching the mission in the launcherlist to the foreground is not supported - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_Want_0300', 0, async function (done) { - console.log("------------start SUB_AA_OpenHarmony_Want_0300-------------"); - TAG = "SUB_AA_OpenHarmony_Want_0300"; - var Subscriber = ""; - - function SubscribeCallBackType(err, data) { - console.log(TAG + " Subscribe CallBack data:" + JSON.stringify(data)); - if(data.event != ""){ - for (var key in data.parameters){ - console.log(TAG + "data.parameters[key] is :" + data.parameters[key]) - } - expect(data.parameters[key] == "MIMETYPE").assertTrue(); - } - done(); - } - - commonEvent.createSubscriber(getCallingBundleType).then(async (data) => { - console.debug(TAG + "====>Create Subscriber====>"); - Subscriber = data; - await commonEvent.subscribe(Subscriber, SubscribeCallBackType); - }); - - featureAbility.startAbility({ - want: { - abilityName: "com.example.applicationinfo.MainAbility2", - bundleName: "com.example.applicationinfo", - type: "MIMETYPE", - } - }, (err, data) => { - console.log(TAG + ":startAbility success , err:" + JSON.stringify(err) + ",data:" + JSON.stringify(data)); - }); - console.log("------------end SUB_AA_OpenHarmony_Want_0300-------------"); - }) - +// @ts-nocheck +/* + * 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 {describe, expect, it} from 'deccjsunit/index' +import commonEvent from '@ohos.commonevent' +import featureAbility from '@ohos.ability.featureability' +import formBindingData from '@ohos.application.formBindingData' +import bundle from '@ohos.bundle'; + +var getCallingBundleUri = { + events: ["uri"] +} + +var getCallingBundleType = { + events: ["type"] +} + +describe("ApplicationInfoTest", function () { + var TAG = ""; + + /* + * @tc.number SUB_AA_OpenHarmony_FormBase_1000 + * @tc.name Validate formbindingdata creation data + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_FormBase_1000', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_FormBase_1000-------------"); + TAG = "SUB_AA_OpenHarmony_FormBase_1000"; + var dataObj = { + temperature:"11c", + "time":"11:00", + "test":11, + "test3":true + } + var result = formBindingData.createFormBindingData(dataObj) + console.log(TAG + " result is : " + JSON.stringify(result)) + expect(JSON.stringify(result)). + assertEqual(JSON.stringify({"data":"{\"temperature\":\"11c\",\"time\":\"11:00\",\"test\":11,\"test3\":true}"})); + done(); + console.log("------------end SUB_AA_OpenHarmony_FormBase_1000-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_Want_0200 + * @tc.name Switching the mission in the launcherlist to the foreground is not supported + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_Want_0200', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_Want_0200-------------"); + TAG = "SUB_AA_OpenHarmony_Want_0200"; + var Subscriber = ""; + + function SubscribeCallBackUri(err, data) { + console.log(TAG + " Subscribe CallBack data:" + JSON.stringify(data)); + if(data.event != ""){ + for (var key in data.parameters){ + console.log(TAG + "data.parameters[key] is :" + data.parameters[key]) + } + expect(data.parameters[key] == "key={true,true,false}").assertTrue(); + } + done(); + } + + commonEvent.createSubscriber(getCallingBundleUri).then(async (data) => { + console.debug(TAG + "====>Create Subscriber====>"); + Subscriber = data; + await commonEvent.subscribe(Subscriber, SubscribeCallBackUri); + }); + + featureAbility.startAbility({ + want: { + abilityName: "com.example.applicationinfo.MainAbility2", + bundleName: "com.example.applicationinfo", + uri: "key={true,true,false}" + } + }, (err, data) => { + console.log(TAG + ":startAbility success , err:" + JSON.stringify(err) + ",data:" + JSON.stringify(data)); + }); + console.log("------------end SUB_AA_OpenHarmony_Want_0200-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_Want_0300 + * @tc.name Switching the mission in the launcherlist to the foreground is not supported + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_Want_0300', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_Want_0300-------------"); + TAG = "SUB_AA_OpenHarmony_Want_0300"; + var Subscriber = ""; + + function SubscribeCallBackType(err, data) { + console.log(TAG + " Subscribe CallBack data:" + JSON.stringify(data)); + if(data.event != ""){ + for (var key in data.parameters){ + console.log(TAG + "data.parameters[key] is :" + data.parameters[key]) + } + expect(data.parameters[key] == "MIMETYPE").assertTrue(); + } + done(); + } + + commonEvent.createSubscriber(getCallingBundleType).then(async (data) => { + console.debug(TAG + "====>Create Subscriber====>"); + Subscriber = data; + await commonEvent.subscribe(Subscriber, SubscribeCallBackType); + }); + + featureAbility.startAbility({ + want: { + abilityName: "com.example.applicationinfo.MainAbility2", + bundleName: "com.example.applicationinfo", + type: "MIMETYPE", + } + }, (err, data) => { + console.log(TAG + ":startAbility success , err:" + JSON.stringify(err) + ",data:" + JSON.stringify(data)); + }); + console.log("------------end SUB_AA_OpenHarmony_Want_0300-------------"); + }) + + /* + * @tc.number SUB_AA_OpenHarmony_ApplicationInfo_0100 + * @tc.name Verify the CodePath of applicationinfo + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ApplicationInfo_0100', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ApplicationInfo_0100-------------"); + TAG = "SUB_AA_OpenHarmony_ApplicationInfo_0100"; + + bundle.getApplicationInfo("com.example.applicationinfo", 1, (error, data)=> { + console.log(TAG + "getApplicationInfo success, error: " + + JSON.stringify(error) + ", data: " + JSON.stringify(data)) + console.log(TAG + "data.condePath: " + JSON.stringify(data.codePath)) + expect(JSON.stringify(data.codePath)). + assertEqual(JSON.stringify("/data/app/el1/bundle/public/com.example.applicationinfo")) + done() + }) + console.log("------------end SUB_AA_OpenHarmony_ApplicationInfo_0100-------------"); + }) + + /* + * @tc.number SUB_AA_OpenHarmony_ApplicationInfo_0200 + * @tc.name Verify the removable of applicationinfo + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ApplicationInfo_0200', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ApplicationInfo_0200-------------"); + TAG = "SUB_AA_OpenHarmony_ApplicationInfo_0200"; + + bundle.getApplicationInfo("com.example.applicationinfo", 1, (error, data)=> { + console.log(TAG + "getApplicationInfo success, error: " + + JSON.stringify(error) + ", data: " + JSON.stringify(data)) + console.log(TAG + "data.removable: " + JSON.stringify(data.removable)) + expect(JSON.stringify(data.removable)).assertEqual("true") + done() + }) + console.log("------------end SUB_AA_OpenHarmony_ApplicationInfo_0200-------------"); + }) + + /* + * @tc.number SUB_AA_OpenHarmony_ApplicationInfo_0300 + * @tc.name Verify the accesstokenid of applicationinfo + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ApplicationInfo_0300', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ApplicationInfo_0300-------------"); + TAG = "SUB_AA_OpenHarmony_ApplicationInfo_0300"; + + bundle.getApplicationInfo("com.example.applicationinfo", 1, (error, data)=> { + console.log(TAG + "getApplicationInfo success, error: " + + JSON.stringify(error) + ", data: " + JSON.stringify(data)) + console.log(TAG + "data.accessTokenId: " + JSON.stringify(data.accessTokenId)) + expect(data.accessTokenId == 537317578).assertTrue(); + done() + }) + console.log("------------end SUB_AA_OpenHarmony_ApplicationInfo_0300-------------"); + }) + }) \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_applicationinfo_test/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/fa/fa_applicationinfo_test/entry/src/main/js/test/List.test.js index 88675b3f3..7750127a7 100644 --- a/aafwk/aafwk_standard/fa/fa_applicationinfo_test/entry/src/main/js/test/List.test.js +++ b/aafwk/aafwk_standard/fa/fa_applicationinfo_test/entry/src/main/js/test/List.test.js @@ -1,16 +1,16 @@ -/* - * 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. - */ - +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + require('./ApplicationInfoJsunit.test.js') \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_applicationinfo_test/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/fa/fa_applicationinfo_test/entry/src/main/resources/base/element/string.json index 425cf6173..92f5ff8a4 100644 --- a/aafwk/aafwk_standard/fa/fa_applicationinfo_test/entry/src/main/resources/base/element/string.json +++ b/aafwk/aafwk_standard/fa/fa_applicationinfo_test/entry/src/main/resources/base/element/string.json @@ -1,20 +1,20 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "description_mainability", - "value": "JS_Empty Ability" - }, - { - "name": "description_mainability2", - "value": "JS_Empty Ability" - }, - { - "name": "entry_MainAbility2", - "value": "entry_MainAbility2" - } - ] +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "JS_Empty Ability" + }, + { + "name": "description_mainability2", + "value": "JS_Empty Ability" + }, + { + "name": "entry_MainAbility2", + "value": "entry_MainAbility2" + } + ] } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_applicationinfo_test/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/fa/fa_applicationinfo_test/signature/openharmony_sx.p7b old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_auxstate_test/BUILD.gn b/aafwk/aafwk_standard/fa/fa_auxstate_test/BUILD.gn old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_auxstate_test/Test.json b/aafwk/aafwk_standard/fa/fa_auxstate_test/Test.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_auxstate_test/entry/src/main/config.json b/aafwk/aafwk_standard/fa/fa_auxstate_test/entry/src/main/config.json index e3db34077..9f2d104a5 100644 --- a/aafwk/aafwk_standard/fa/fa_auxstate_test/entry/src/main/config.json +++ b/aafwk/aafwk_standard/fa/fa_auxstate_test/entry/src/main/config.json @@ -1,64 +1,64 @@ -{ - "app": { - "bundleName": "com.example.fzgc", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.fzgc", - "name": ".MyApplication", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_mainability", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } +{ + "app": { + "bundleName": "com.example.fzgc", + "vendor": "example", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.fzgc", + "name": ".MyApplication", + "mainAbility": ".MainAbility", + "srcPath": "", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_auxstate_test/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/fa/fa_auxstate_test/entry/src/main/resources/base/element/string.json index 610d89afc..d1321867f 100644 --- a/aafwk/aafwk_standard/fa/fa_auxstate_test/entry/src/main/resources/base/element/string.json +++ b/aafwk/aafwk_standard/fa/fa_auxstate_test/entry/src/main/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "description_mainability", - "value": "JS_Empty Ability" - } - ] +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "JS_Empty Ability" + } + ] } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_auxstate_test/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/fa/fa_auxstate_test/signature/openharmony_sx.p7b old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_auxsumstate_test/BUILD.gn b/aafwk/aafwk_standard/fa/fa_auxsumstate_test/BUILD.gn old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_auxsumstate_test/Test.json b/aafwk/aafwk_standard/fa/fa_auxsumstate_test/Test.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_auxsumstate_test/entry/src/main/config.json b/aafwk/aafwk_standard/fa/fa_auxsumstate_test/entry/src/main/config.json index 622611075..2caea87e8 100644 --- a/aafwk/aafwk_standard/fa/fa_auxsumstate_test/entry/src/main/config.json +++ b/aafwk/aafwk_standard/fa/fa_auxsumstate_test/entry/src/main/config.json @@ -1,64 +1,64 @@ -{ - "app": { - "bundleName": "com.example.fzstatelistener", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.fzstatelistener", - "name": ".MyApplication", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_mainability", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } +{ + "app": { + "bundleName": "com.example.fzstatelistener", + "vendor": "example", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.fzstatelistener", + "name": ".MyApplication", + "mainAbility": ".MainAbility", + "srcPath": "", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_auxsumstate_test/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/fa/fa_auxsumstate_test/entry/src/main/resources/base/element/string.json index 610d89afc..d1321867f 100644 --- a/aafwk/aafwk_standard/fa/fa_auxsumstate_test/entry/src/main/resources/base/element/string.json +++ b/aafwk/aafwk_standard/fa/fa_auxsumstate_test/entry/src/main/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "description_mainability", - "value": "JS_Empty Ability" - } - ] +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "JS_Empty Ability" + } + ] } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_auxsumstate_test/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/fa/fa_auxsumstate_test/signature/openharmony_sx.p7b old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/BUILD.gn b/aafwk/aafwk_standard/fa/fa_clear_test/BUILD.gn old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/Test.json b/aafwk/aafwk_standard/fa/fa_clear_test/Test.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/config.json b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/config.json old mode 100644 new mode 100755 index 27dbde076..c87ecdcee --- a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/config.json +++ b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/config.json @@ -1,141 +1,141 @@ -{ - "app": { - "bundleName": "com.example.abilitydisable", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.abilitydisable", - "name": ".MyApplication", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_mainability", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "orientation": "unspecified", - "srcPath": "MainAbility2", - "name": ".MainAbility2", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_mainability2", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "orientation": "unspecified", - "srcPath": "MainAbility3", - "name": ".MainAbility3", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_mainability3", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "orientation": "unspecified", - "srcPath": "MainAbility4", - "name": ".MainAbility4", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_mainability4", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "srcPath": "ServiceAbility", - "name": ".ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "js", - "description": "$string:description_serviceability", - "type": "service" - } - ], - "js": [ - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility2", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility3", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility4", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } +{ + "app": { + "bundleName": "com.example.abilitydisable", + "vendor": "example", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.abilitydisable", + "name": ".MyApplication", + "mainAbility": ".MainAbility", + "srcPath": "", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "srcPath": "MainAbility2", + "name": ".MainAbility2", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability2", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "srcPath": "MainAbility3", + "name": ".MainAbility3", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability3", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "srcPath": "MainAbility4", + "name": ".MainAbility4", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability4", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "srcPath": "ServiceAbility", + "name": ".ServiceAbility", + "icon": "$media:icon", + "srcLanguage": "js", + "description": "$string:description_serviceability", + "type": "service" + } + ], + "js": [ + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility2", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility3", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility4", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/app.js b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/app.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/i18n/en-US.json b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/i18n/en-US.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/i18n/zh-CN.json b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/i18n/zh-CN.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/pages/index/index.css b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/pages/index/index.css old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/pages/index/index.hml b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/pages/index/index.hml old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/pages/index/index.js b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/pages/index/index.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/pages/second/second.css b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/pages/second/second.css old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/pages/second/second.hml b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/pages/second/second.hml old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/pages/second/second.js b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility/pages/second/second.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/app.js b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/app.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/i18n/en-US.json b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/i18n/en-US.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/i18n/zh-CN.json b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/i18n/zh-CN.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/pages/index/index.css b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/pages/index/index.css old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/pages/index/index.hml b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/pages/index/index.hml old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/pages/index/index.js b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/pages/index/index.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/pages/second/second.css b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/pages/second/second.css old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/pages/second/second.hml b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/pages/second/second.hml old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/pages/second/second.js b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility2/pages/second/second.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/app.js b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/app.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/i18n/en-US.json b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/i18n/en-US.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/i18n/zh-CN.json b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/i18n/zh-CN.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/pages/index/index.css b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/pages/index/index.css old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/pages/index/index.hml b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/pages/index/index.hml old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/pages/index/index.js b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/pages/index/index.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/pages/second/second.css b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/pages/second/second.css old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/pages/second/second.hml b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/pages/second/second.hml old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/pages/second/second.js b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility3/pages/second/second.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/app.js b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/app.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/i18n/en-US.json b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/i18n/en-US.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/i18n/zh-CN.json b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/i18n/zh-CN.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/pages/index/index.css b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/pages/index/index.css old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/pages/index/index.hml b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/pages/index/index.hml old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/pages/index/index.js b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/pages/index/index.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/pages/second/second.css b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/pages/second/second.css old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/pages/second/second.hml b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/pages/second/second.hml old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/pages/second/second.js b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/MainAbility4/pages/second/second.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/ServiceAbility/service.js b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/ServiceAbility/service.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/test/AbilityDisableTest.js b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/test/AbilityDisableTest.js old mode 100644 new mode 100755 index e4a8acbd2..95c7f3788 --- a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/test/AbilityDisableTest.js +++ b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/test/AbilityDisableTest.js @@ -1,256 +1,256 @@ - -/* - * 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. - */ -// @ts-nocheck -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" -import missionManager from '@ohos.application.missionManager'; -import abilityFeatureAbility from '@ohos.ability.featureAbility'; -import bundleManager from '@ohos.bundle'; - -describe('AbilityDisableTests', function () { - console.log("AbilityDisableTests --- start"); - - function fns(){ - setTimeout(()=>{ - abilityFeatureAbility.startAbility({ want: { - bundleName: "com.example.abilitydisable", - abilityName: "com.example.abilitydisable.MainAbility2" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_Clear_0100 - startMainAbility2: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - expect(err.code == 0).assertTrue(); - }); - },500) - setTimeout(()=>{ - abilityFeatureAbility.startAbility({ want: { - bundleName: "com.example.abilitydisable", - abilityName: "com.example.abilitydisable.MainAbility4" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_Clear_0100 - startMainAbility4: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - expect(err.code == 0).assertTrue(); - }); - },1000) - setTimeout(()=>{ - abilityFeatureAbility.startAbility({ want: { - bundleName: "com.example.abilitydisable", - abilityName: "com.example.abilitydisable.MainAbility3" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_Clear_0100 - startMainAbility3: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - expect(err.code == 0).assertTrue(); - }); - },1500) - setTimeout(()=>{ - missionManager.getMissionInfos("", 20, (err, data) => { - console.log('SUB_AA_OpenHarmony_Clear_0100 getMissionInfos errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - for (var i = 0;i < data.length; i++) { - console.log("bundleName:"+data[i].want["abilityName"]) - if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility3" - || data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility4" - ||data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility" - ||data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility2"){ - console.log("data[i]['lockedState']::::"+data[i]['lockedState']); - console.log("data[i].missionId" + data[i].missionId); - console.log("SUB_AA_OpenHarmony_Clear_0100, missionId:" + data[i].missionId); - missionIds.push(data[i].missionId); - } - } - console.log('SUB_AA_OpenHarmony_Clear_0100 missionId:'+ missionIds + - typeof missionIds + ":::::"+missionIds[1] + typeof missionIds[1]); - }) - console.log("SUB_AA_OpenHarmony_Clear_0100" + JSON.stringify(missionIds)); - },2000) - setTimeout(()=>{ - missionManager.lockMission(parseInt(missionIds[1]),(err,data)=>{ - - console.log('SUB_AA_OpenHarmony_Clear_0100 lockMission1 missionIds[1] : ' + - JSON.stringify(missionIds[1]), + parseInt(missionIds[1])); - - console.log('SUB_AA_OpenHarmony_Clear_0100 lockMission1 errCode : ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - }) - },2500) - setTimeout(()=>{ - missionManager.lockMission(parseInt(missionIds[2]),(err,data)=>{ - console.log('SUB_AA_OpenHarmony_Clear_0100 lockMission2 errCode : ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - }) - },2500) - setTimeout(()=>{ - missionManager.getMissionInfos("", 20, (err, data) => { - console.log("SUB_AA_OpenHarmony_Clear_0100, twosgetMissionInfos:" + - JSON.stringify(data)); - for (var i = 0;i < data.length; i++) { - console.log("data[i].missionId:missionIds[2] news missionIds[1]" + - data[i].missionId + missionIds[2] + missionIds[1]) - if(data[i].missionId == missionIds[1] || data[i].missionId == missionIds[2]){ - console.log("data[i]['lockedState']222:::::::"+data[i]['lockedState']); - expect(data[i]['lockedState'] == true).assertTrue(); - } - } - }) - console.log("SUB_AA_OpenHarmony_Clear_0100" + JSON.stringify(missionIds)); - },3100) - setTimeout(()=>{ - missionManager.getMissionInfos("", 20, (err, data) => { - console.log('SUB_AA_OpenHarmony_Clear_0100 getMissionInfos errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - for (var i = 0;i < data.length; i++) { - console.log("bundleName:"+data[i].want["abilityName"]) - if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility3" - || data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility4" - ||data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility" - ||data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility2"){ - console.log("data[i]['lockedState']::::"+data[i]['lockedState']); - expect(data[i].lockedState == false).assertTrue(); - } - } - console.log('SUB_AA_OpenHarmony_Clear_0100 missionId:'+ missionIds + - typeof missionIds + ":::::"+missionIds[1] + typeof missionIds[1]); - }) - console.log("SUB_AA_OpenHarmony_Clear_0100" + JSON.stringify(missionIds)); - },5000) - setTimeout(()=>{ - missionManager.moveMissionToFront(parseInt(missionIds[2]),(err,data)=>{ - console.log('SUB_AA_OpenHarmony_Clear_0100 moveMissionToFront errCode : ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - }) - },6000) - setTimeout(()=>{ - missionManager.clearAllMissions((err,data)=>{ - console.log('SUB_AA_OpenHarmony_Clear_0100 clearAllMissions errCode: ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - - }) - },7000) - setTimeout(()=>{ - missionManager.getMissionInfos("", 20, (err, data) => { - console.log('SUB_AA_OpenHarmony_Clear_0100 getMissionInfos errCode : ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - for (var i = 0;i < data.length; i++) { - console.log("bundleName:"+data[i].want["abilityName"]) - if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility3" || - data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility4" || - data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility"|| - data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility2"){ - console.log("data[i]['lockedState']end::::"+data[i]['lockedState']); - expect(data[i]['lockedState'] == true).assertTrue(); - } - } - console.log('SUB_AA_OpenHarmony_Clear_0100 missionId:'+ - missionIds + typeof missionIds + ":::::"+missionIds[1] + typeof missionIds[1]); - }) - console.log("SUB_AA_OpenHarmony_Clear_0100" + - JSON.stringify(missionIds)); - },8000) - } - - /* - * @tc.number SUB_AA_OpenHarmony_Clear_1200 - * @tc.name missionId for undefined - * @tc.desc Function test - * @tc.level 0 - */ - it("SUB_AA_OpenHarmony_Clear_1200", 0, async function (done) { - console.info("------------------logMessage SUB_AA_OpenHarmony_Clear_1200-------------------"); - missionManager.clearMission(undefined, (data, err) => { - console.log('SUB_AA_OpenHarmony_Clear_1200 asyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(data["code"]==-1).assertTrue(); - }) - done(); - }); - - /* - * @tc.number SUB_AA_OpenHarmony_Clear_1300 - * @tc.name MissionId: does not exist - * @tc.desc Function test - * @tc.level 0 - */ - it("SUB_AA_OpenHarmony_Clear_1300", 0, async function (done) { - console.info("------------------logMessage SUB_AA_OpenHarmony_Clear_1300-------------------"); - missionManager.clearMission("xxxx", (data, err) => { - console.log('SUB_AA_OpenHarmony_Clear_1300 asyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(data["code"]==-1).assertTrue(); - }) - done(); - }); - - /* - * @tc.number SUB_AA_OpenHarmony_Clear_1400 - * @tc.name MissionId is a string number - * @tc.desc Function test - * @tc.level 0 - */ - it("SUB_AA_OpenHarmony_Clear_1400", 0, async function (done) { - console.info("------------------logMessage SUB_AA_OpenHarmony_Clear_1400-------------------"); - missionManager.clearMission("123456", (data, err) => { - console.log('SUB_AA_OpenHarmony_Clear_1400 asyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(data["code"]==-1).assertTrue(); - }) - done(); - }); - - /* - * @tc.number SUB_AA_OpenHarmony_Clear_1500 - * @tc.name The missionId is a non-number string - * @tc.desc Function test - * @tc.level 0 - */ - it("SUB_AA_OpenHarmony_Clear_1500", 0, async function (done) { - console.info("------------------logMessage SUB_AA_OpenHarmony_Clear_1500-------------------"); - missionManager.clearMission("abc@@#$", (data, err) => { - console.log('SUB_AA_OpenHarmony_Clear_1500 asyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(data["code"]==-1).assertTrue(); - }) - done(); - }); - - /* - * @tc.number SUB_AA_OpenHarmony_Clear_1600 - * @tc.name MissionId is an existing floating point type - * @tc.desc Function test - * @tc.level 0 - */ - it("SUB_AA_OpenHarmony_Clear_1600", 0, async function (done) { - console.info("------------------logMessage SUB_AA_OpenHarmony_Clear_1600-------------------"); - missionManager.clearMission(1.1234, (data, err) => { - console.log('SUB_AA_OpenHarmony_Clear_1600 asyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(data["code"]==-1).assertTrue(); - }) - done(); - }); - - /* - * @tc.number SUB_AA_OpenHarmony_Clear_0100 - * @tc.name Locking is terminated after mission, switching to the front desk for cleanup - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_Clear_0100', 0, async function (done) { - var missionIds = []; - console.log("SUB_AA_OpenHarmony_Clear_0100 --- start") - fns() - done() - }); - - + +/* + * 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. + */ +// @ts-nocheck +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" +import missionManager from '@ohos.application.missionManager'; +import abilityFeatureAbility from '@ohos.ability.featureAbility'; +import bundleManager from '@ohos.bundle'; + +describe('AbilityDisableTests', function () { + console.log("AbilityDisableTests --- start"); + + function fns(){ + setTimeout(()=>{ + abilityFeatureAbility.startAbility({ want: { + bundleName: "com.example.abilitydisable", + abilityName: "com.example.abilitydisable.MainAbility2" + } }, (error, data) => { + console.log('SUB_AA_OpenHarmony_Clear_0100 - startMainAbility2: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + expect(err.code == 0).assertTrue(); + }); + },500) + setTimeout(()=>{ + abilityFeatureAbility.startAbility({ want: { + bundleName: "com.example.abilitydisable", + abilityName: "com.example.abilitydisable.MainAbility4" + } }, (error, data) => { + console.log('SUB_AA_OpenHarmony_Clear_0100 - startMainAbility4: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + expect(err.code == 0).assertTrue(); + }); + },1000) + setTimeout(()=>{ + abilityFeatureAbility.startAbility({ want: { + bundleName: "com.example.abilitydisable", + abilityName: "com.example.abilitydisable.MainAbility3" + } }, (error, data) => { + console.log('SUB_AA_OpenHarmony_Clear_0100 - startMainAbility3: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + expect(err.code == 0).assertTrue(); + }); + },1500) + setTimeout(()=>{ + missionManager.getMissionInfos("", 20, (err, data) => { + console.log('SUB_AA_OpenHarmony_Clear_0100 getMissionInfos errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + for (var i = 0;i < data.length; i++) { + console.log("bundleName:"+data[i].want["abilityName"]) + if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility3" + || data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility4" + ||data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility" + ||data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility2"){ + console.log("data[i]['lockedState']::::"+data[i]['lockedState']); + console.log("data[i].missionId" + data[i].missionId); + console.log("SUB_AA_OpenHarmony_Clear_0100, missionId:" + data[i].missionId); + missionIds.push(data[i].missionId); + } + } + console.log('SUB_AA_OpenHarmony_Clear_0100 missionId:'+ missionIds + + typeof missionIds + ":::::"+missionIds[1] + typeof missionIds[1]); + }) + console.log("SUB_AA_OpenHarmony_Clear_0100" + JSON.stringify(missionIds)); + },2000) + setTimeout(()=>{ + missionManager.lockMission(parseInt(missionIds[1]),(err,data)=>{ + + console.log('SUB_AA_OpenHarmony_Clear_0100 lockMission1 missionIds[1] : ' + + JSON.stringify(missionIds[1]), + parseInt(missionIds[1])); + + console.log('SUB_AA_OpenHarmony_Clear_0100 lockMission1 errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + }) + },2500) + setTimeout(()=>{ + missionManager.lockMission(parseInt(missionIds[2]),(err,data)=>{ + console.log('SUB_AA_OpenHarmony_Clear_0100 lockMission2 errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + }) + },2500) + setTimeout(()=>{ + missionManager.getMissionInfos("", 20, (err, data) => { + console.log("SUB_AA_OpenHarmony_Clear_0100, twosgetMissionInfos:" + + JSON.stringify(data)); + for (var i = 0;i < data.length; i++) { + console.log("data[i].missionId:missionIds[2] news missionIds[1]" + + data[i].missionId + missionIds[2] + missionIds[1]) + if(data[i].missionId == missionIds[1] || data[i].missionId == missionIds[2]){ + console.log("data[i]['lockedState']222:::::::"+data[i]['lockedState']); + expect(data[i]['lockedState'] == true).assertTrue(); + } + } + }) + console.log("SUB_AA_OpenHarmony_Clear_0100" + JSON.stringify(missionIds)); + },3100) + setTimeout(()=>{ + missionManager.getMissionInfos("", 20, (err, data) => { + console.log('SUB_AA_OpenHarmony_Clear_0100 getMissionInfos errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + for (var i = 0;i < data.length; i++) { + console.log("bundleName:"+data[i].want["abilityName"]) + if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility3" + || data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility4" + ||data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility" + ||data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility2"){ + console.log("data[i]['lockedState']::::"+data[i]['lockedState']); + expect(data[i].lockedState == false).assertTrue(); + } + } + console.log('SUB_AA_OpenHarmony_Clear_0100 missionId:'+ missionIds + + typeof missionIds + ":::::"+missionIds[1] + typeof missionIds[1]); + }) + console.log("SUB_AA_OpenHarmony_Clear_0100" + JSON.stringify(missionIds)); + },5000) + setTimeout(()=>{ + missionManager.moveMissionToFront(parseInt(missionIds[2]),(err,data)=>{ + console.log('SUB_AA_OpenHarmony_Clear_0100 moveMissionToFront errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + }) + },6000) + setTimeout(()=>{ + missionManager.clearAllMissions((err,data)=>{ + console.log('SUB_AA_OpenHarmony_Clear_0100 clearAllMissions errCode: ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + + }) + },7000) + setTimeout(()=>{ + missionManager.getMissionInfos("", 20, (err, data) => { + console.log('SUB_AA_OpenHarmony_Clear_0100 getMissionInfos errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + for (var i = 0;i < data.length; i++) { + console.log("bundleName:"+data[i].want["abilityName"]) + if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility3" || + data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility4" || + data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility"|| + data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility2"){ + console.log("data[i]['lockedState']end::::"+data[i]['lockedState']); + expect(data[i]['lockedState'] == true).assertTrue(); + } + } + console.log('SUB_AA_OpenHarmony_Clear_0100 missionId:'+ + missionIds + typeof missionIds + ":::::"+missionIds[1] + typeof missionIds[1]); + }) + console.log("SUB_AA_OpenHarmony_Clear_0100" + + JSON.stringify(missionIds)); + },8000) + } + + /* + * @tc.number SUB_AA_OpenHarmony_Clear_1200 + * @tc.name missionId for undefined + * @tc.desc Function test + * @tc.level 0 + */ + it("SUB_AA_OpenHarmony_Clear_1200", 0, async function (done) { + console.info("------------------logMessage SUB_AA_OpenHarmony_Clear_1200-------------------"); + missionManager.clearMission(undefined, (data, err) => { + console.log('SUB_AA_OpenHarmony_Clear_1200 asyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data["code"]==-1).assertTrue(); + }) + done(); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_Clear_1300 + * @tc.name MissionId: does not exist + * @tc.desc Function test + * @tc.level 0 + */ + it("SUB_AA_OpenHarmony_Clear_1300", 0, async function (done) { + console.info("------------------logMessage SUB_AA_OpenHarmony_Clear_1300-------------------"); + missionManager.clearMission("xxxx", (data, err) => { + console.log('SUB_AA_OpenHarmony_Clear_1300 asyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data["code"]==-1).assertTrue(); + }) + done(); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_Clear_1400 + * @tc.name MissionId is a string number + * @tc.desc Function test + * @tc.level 0 + */ + it("SUB_AA_OpenHarmony_Clear_1400", 0, async function (done) { + console.info("------------------logMessage SUB_AA_OpenHarmony_Clear_1400-------------------"); + missionManager.clearMission("123456", (data, err) => { + console.log('SUB_AA_OpenHarmony_Clear_1400 asyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data["code"]==-1).assertTrue(); + }) + done(); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_Clear_1500 + * @tc.name The missionId is a non-number string + * @tc.desc Function test + * @tc.level 0 + */ + it("SUB_AA_OpenHarmony_Clear_1500", 0, async function (done) { + console.info("------------------logMessage SUB_AA_OpenHarmony_Clear_1500-------------------"); + missionManager.clearMission("abc@@#$", (data, err) => { + console.log('SUB_AA_OpenHarmony_Clear_1500 asyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data["code"]==-1).assertTrue(); + }) + done(); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_Clear_1600 + * @tc.name MissionId is an existing floating point type + * @tc.desc Function test + * @tc.level 0 + */ + it("SUB_AA_OpenHarmony_Clear_1600", 0, async function (done) { + console.info("------------------logMessage SUB_AA_OpenHarmony_Clear_1600-------------------"); + missionManager.clearMission(1.1234, (data, err) => { + console.log('SUB_AA_OpenHarmony_Clear_1600 asyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data["code"]==-1).assertTrue(); + }) + done(); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_Clear_0100 + * @tc.name Locking is terminated after mission, switching to the front desk for cleanup + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_Clear_0100', 0, async function (done) { + var missionIds = []; + console.log("SUB_AA_OpenHarmony_Clear_0100 --- start") + fns() + done() + }); + + }) \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/test/List.test.js old mode 100644 new mode 100755 index d12ff02b8..2a2007331 --- a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/test/List.test.js +++ b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -require('./AbilityDisableTest.js'); +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +require('./AbilityDisableTest.js'); diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/resources/base/element/string.json old mode 100644 new mode 100755 index 1d2808e5c..2e8b3cf8a --- a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/resources/base/element/string.json +++ b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/resources/base/element/string.json @@ -1,40 +1,40 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "description_mainability", - "value": "JS_Empty Ability" - }, - { - "name": "description_mainability2", - "value": "JS_Empty Ability" - }, - { - "name": "entry_MainAbility2", - "value": "entry_MainAbility2" - }, - { - "name": "description_mainability3", - "value": "JS_Empty Ability" - }, - { - "name": "entry_MainAbility3", - "value": "entry_MainAbility3" - }, - { - "name": "description_mainability4", - "value": "JS_Empty Ability" - }, - { - "name": "entry_MainAbility4", - "value": "entry_MainAbility4" - }, - { - "name": "description_serviceability", - "value": "hap sample empty service" - } - ] +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "JS_Empty Ability" + }, + { + "name": "description_mainability2", + "value": "JS_Empty Ability" + }, + { + "name": "entry_MainAbility2", + "value": "entry_MainAbility2" + }, + { + "name": "description_mainability3", + "value": "JS_Empty Ability" + }, + { + "name": "entry_MainAbility3", + "value": "entry_MainAbility3" + }, + { + "name": "description_mainability4", + "value": "JS_Empty Ability" + }, + { + "name": "entry_MainAbility4", + "value": "entry_MainAbility4" + }, + { + "name": "description_serviceability", + "value": "hap sample empty service" + } + ] } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/resources/base/media/icon.png b/aafwk/aafwk_standard/fa/fa_clear_test/entry/src/main/resources/base/media/icon.png old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_clear_test/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/fa/fa_clear_test/signature/openharmony_sx.p7b old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/BUILD.gn b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/BUILD.gn old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/Test.json b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/Test.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/.gitignore b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/.gitignore index 7d5b7a94f..f77260b15 100644 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/.gitignore +++ b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/.gitignore @@ -1,2 +1,2 @@ -/build -/node_modules +/build +/node_modules diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/build.gradle b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/build.gradle index cef7b37de..c40c1f08c 100644 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/build.gradle +++ b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/build.gradle @@ -1,21 +1,21 @@ -apply plugin: 'com.huawei.ohos.hap' -//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 -ohos { - compileSdkVersion 8 - defaultConfig { - compatibleSdkVersion 7 - } - buildTypes { - release { - proguardOpt { - proguardEnabled false - rulesFiles 'proguard-rules.pro' - } - } - } -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) - testImplementation 'junit:junit:4.13.1' -} +apply plugin: 'com.huawei.ohos.hap' +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 +ohos { + compileSdkVersion 8 + defaultConfig { + compatibleSdkVersion 7 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) + testImplementation 'junit:junit:4.13.1' +} diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/package.json b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/package.json index 0967ef424..69a88e3b6 100644 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/package.json +++ b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/package.json @@ -1 +1 @@ -{} +{} diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/config.json b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/config.json index 28902fb2a..d2f4b1957 100644 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/config.json +++ b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/config.json @@ -1,6 +1,6 @@ { "app": { - "bundleName": "com.example.abilitydisable", + "bundleName": "com.example.jsmyapplication", "vendor": "example", "version": { "code": 1000000, @@ -9,7 +9,7 @@ }, "deviceConfig": {}, "module": { - "package": "com.example.abilitydisable", + "package": "com.example.jsmyapplication", "name": ".MyApplication", "mainAbility": ".MainAbility", "srcPath": "", @@ -45,42 +45,6 @@ "label": "$string:entry_MainAbility", "type": "page", "launchType": "standard" - }, - { - "orientation": "unspecified", - "srcPath": "MainAbility2", - "name": ".MainAbility2", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_mainability2", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "orientation": "unspecified", - "srcPath": "MainAbility3", - "name": ".MainAbility3", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_mainability3", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "orientation": "unspecified", - "srcPath": "MainAbility4", - "name": ".MainAbility4", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_mainability4", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" } ], "js": [ @@ -94,56 +58,15 @@ "designWidth": 720, "autoDesignWidth": false } - }, - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility2", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility3", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility4", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } } ], "reqPermissions": [ { - "name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS" - }, - { - "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.MANAGE_MISSIONS" + "name": "ohos.permission.GET_BUNDLE_INFO", + "reason": "need use ohos.permission.INSTALL_BUNDLE" }, { - "name": "ohos.permission.GET_BUNDLE_INFO", + "name": "ohos.permission.UPDATE_CONFIGURATION", "reason": "need use ohos.permission.INSTALL_BUNDLE" } ] diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility/app.js b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility/app.js index 89314a93d..a8f63230f 100644 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility/app.js +++ b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility/app.js @@ -1,3 +1,4 @@ +// @ts-nocheck /* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,27 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import commonEvent from '@ohos.commonEvent'; -import abilityFeatureAbility from '@ohos.ability.featureAbility'; export default { onCreate() { - commonEvent.publish("ApplicationMainAbility1_onCreate",()=>{ - console.log("ApplicationMainAbility1_onCreate publish callBack ApplicationMainAbility1_onCreate"); - }); - setTimeout(()=>{ - abilityFeatureAbility.terminateSelf().then((data)=>{ - console.log("ApplicationMainAbility2 terminateSelf data:" + JSON.stringify(data) ) - }).catch((error)=>{ - console.log("ApplicationMainAbility2 terminateSelf error:" + JSON.stringify(error) ) - }) - },3000) - - console.info("Application onCreate"); + console.info("Application onCreate 1"); }, onDestroy() { - console.info("Application onDestroy"); - }, - onForgeGround(){ - console.info("Application onForgeGround"); + console.info("Application onDestroy 1"); + } }; diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility/i18n/zh-CN.json b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility/i18n/zh-CN.json index 3dd53b3a8..195f303be 100644 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility/i18n/zh-CN.json +++ b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility/i18n/zh-CN.json @@ -1,10 +1,10 @@ { "strings": { - "hello": "您好", - "world": "世界", - "page": "第二页", - "next": "下一页", - "back": "返回" + "hello": "您好 1 js", + "world": "世界 1 js", + "page": "第二页 1", + "next": "下一页 1", + "back": "返回 1" }, "Files": { } diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility/pages/index/index.hml b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility/pages/index/index.hml index 9c27d02f6..534abd5a9 100644 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility/pages/index/index.hml +++ b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility/pages/index/index.hml @@ -1,17 +1,17 @@ + * 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. + -->
{{ $t('strings.hello') }} {{ title }} diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility/pages/index/index.js b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility/pages/index/index.js index 56e613e12..7d7c4a74c 100644 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility/pages/index/index.js +++ b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility/pages/index/index.js @@ -1,3 +1,4 @@ +// @ts-nocheck /* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -12,54 +13,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -import commonEvent from '@ohos.commonEvent'; import router from '@system.router' import {Core} from 'deccjsunit/index' - export default { data: { title: "" }, onInit() { - this.title = 'yingyong1'; - }, - onclick: function () { - router.replace({ - uri: "pages/second/second" - }) + this.title = this.$t('strings.world'); }, - onShow() { - console.log("singletonEntryAbulity1_onShow") - commonEvent.publish("singletonEntryAbulity1_onShow",()=>{ - console.log("singletonEntryAbulity1_onHide publish callBack singletonEntryAbulity1_onHide"); - }); + onShow(){ const core = Core.getInstance() - core.init() + core.init(); const configService = core.getDefaultService('config') configService.setConfig(this) - console.info('onShow ') - require('../../../test/List.test') - console.info('onShow start5') - core.execute() + require('../../../test/List.test'); + core.execute(); }, - onHide(){ - console.log("singletonEntryAbulity_onHide") - commonEvent.publish("singletonEntryAbulity1_onHide",()=>{ - console.log("singletonEntryAbulity1_onHide publish callBack singletonEntryAbulity1_onHide"); - }); - }, - onActive(){ - console.log("singletonEntryAbulity_onActive") - commonEvent.publish("singletonEntryAbulity1_onActive",()=>{ - console.log("singletonEntryAbulity1_onActive publish callBack singletonEntryAbulity1_onActive"); - }); - }, - onInactive(){ - console.log("singletonEntryAbulity_onInactive") - commonEvent.publish("singletonEntryAbulity1_onInactive",()=>{ - console.log("singletonEntryAbulity1_onInactive publish callBack singletonEntryAbulity1_onInactive"); - }); + onclick: function () { + router.replace({ + uri: "pages/second/second" + }) } } diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility/pages/second/second.hml b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility/pages/second/second.hml index 232a295e9..7ef73cefb 100644 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility/pages/second/second.hml +++ b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility/pages/second/second.hml @@ -1,17 +1,17 @@ + * 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. + -->
{{ $t('strings.page') }} diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility/pages/second/second.js b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility/pages/second/second.js index 55c229adf..1d7012a63 100644 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility/pages/second/second.js +++ b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility/pages/second/second.js @@ -1,3 +1,4 @@ +// @ts-nocheck /* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/app.js b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/app.js deleted file mode 100644 index e0c38971a..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/app.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 commonEvent from '@ohos.commonEvent'; - -export default { - onCreate() { - commonEvent.publish("ApplicationMainAbility2_onCreate",()=>{ - console.log("ApplicationMainAbility2_onCreate publish callBack ApplicationMainAbility2_onCreate"); - }); - console.info("ApplicationMainAbility2 onCreate"); - }, - onDestroy() { - console.log("singletonEntryAbulity_onDestroy222"); - commonEvent.publish("ApplicationMainAbility2_onDestroy",()=>{ - console.log("singletonEntryAbulity2_onDestroy publish callBack singletonEntryAbulity2onDestroy"); - }); - }, -}; - diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/i18n/en-US.json b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/i18n/en-US.json deleted file mode 100644 index 08e34eac9..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/i18n/en-US.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World", - "page": "Second Page", - "next": "Next Page", - "back": "Back" - }, - "Files": { - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/i18n/zh-CN.json b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/i18n/zh-CN.json deleted file mode 100644 index 3dd53b3a8..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/i18n/zh-CN.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界", - "page": "第二页", - "next": "下一页", - "back": "返回" - }, - "Files": { - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/pages/index/index.css b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/pages/index/index.css deleted file mode 100644 index 737096ca1..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/pages/index/index.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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. - */ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -.btn { - width: 50%; - height: 100px; - font-size: 40px; -} diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/pages/index/index.hml b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/pages/index/index.hml deleted file mode 100644 index 83ae6b784..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ - -
- - {{ $t('strings.hello') }} {{ title }} - - -
diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/pages/index/index.js b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/pages/index/index.js deleted file mode 100644 index caadb951d..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/pages/index/index.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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 router from '@system.router' -import {Core} from 'deccjsunit/index' -import commonEvent from '@ohos.commonEvent'; - -export default { - data: { - title: "" - }, - onInit() { - this.title = 'yingyong2'; - }, - onclick: function () { - router.replace({ - uri: "pages/second/second" - }) - }, - onShow() { - console.log("singletonEntryAbulity_onShow") - commonEvent.publish("singletonEntryAbulity2_onShow",()=>{ - console.log("singletonEntryAbulity2_onShow publish callBack singletonEntryAbulity2_onShow"); - }); - }, - onHide(){ - console.log("singletonEntryAbulity_onHide") - commonEvent.publish("singletonEntryAbulity2_onHide",()=>{ - console.log("singletonEntryAbulity2_onHide publish callBack singletonEntryAbulity2onHide"); - }); - }, - onActive(){ - console.log("singletonEntryAbulity_onActive") - commonEvent.publish("singletonEntryAbulity2_onActive",()=>{ - console.log("singletonEntryAbulity2_onActive publish callBack singletonEntryAbulity2_onActive"); - }); - }, - onInactive(){ - console.log("singletonEntryAbulity_onInactive"); - commonEvent.publish("singletonEntryAbulity2_onInactive",()=>{ - console.log("singletonEntryAbulity2_onInactive publish callBack singletonEntryAbulity2_onInactive"); - }); - } - -} - - - diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/pages/second/second.css b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/pages/second/second.css deleted file mode 100644 index 737096ca1..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/pages/second/second.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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. - */ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -.btn { - width: 50%; - height: 100px; - font-size: 40px; -} diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/pages/second/second.hml b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/pages/second/second.hml deleted file mode 100644 index 4503365d5..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/pages/second/second.hml +++ /dev/null @@ -1,20 +0,0 @@ - -
- - {{ $t('strings.page') }} - - -
diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/app.js b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/app.js deleted file mode 100644 index aa30315f0..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/app.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 abilityFeatureAbility from '@ohos.ability.featureAbility'; -import commonEvent from '@ohos.commonEvent'; -export default { - onCreate() { - console.info("Application onCreate MainAbility3"); - setTimeout(()=>{ - abilityFeatureAbility.terminateSelf().then((data)=>{ - console.log("Application terminateSelf data:" + JSON.stringify(data) ) - }).catch((error)=>{ - console.log("Application terminateSelf data:" + JSON.stringify(error) ) - }) - },2500) - }, - onDestroy() { - console.log("singletonEntryAbulity_onDestroy222"); - commonEvent.publish("ApplicationMainAbility3_onDestroy",()=>{ - console.log("ApplicationMainAbility3_onDestroy publish callBack ApplicationMainAbility2_onDestroy"); - }); - }, - onForgeGround(){ - console.log("singletonEntryAbulity_onForgeGround"); - commonEvent.publish("ApplicationMainAbility3_onForgeGround",()=>{ - console.log("ApplicationMainAbility3_onHide publish callBack ApplicationMainAbility2_onForgeGround"); - }); - } -}; diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/i18n/en-US.json b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/i18n/en-US.json deleted file mode 100644 index 08e34eac9..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/i18n/en-US.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World", - "page": "Second Page", - "next": "Next Page", - "back": "Back" - }, - "Files": { - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/i18n/zh-CN.json b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/i18n/zh-CN.json deleted file mode 100644 index 3dd53b3a8..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/i18n/zh-CN.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界", - "page": "第二页", - "next": "下一页", - "back": "返回" - }, - "Files": { - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/pages/index/index.css b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/pages/index/index.css deleted file mode 100644 index 737096ca1..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/pages/index/index.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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. - */ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -.btn { - width: 50%; - height: 100px; - font-size: 40px; -} diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/pages/index/index.hml b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/pages/index/index.hml deleted file mode 100644 index 9c27d02f6..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ - -
- - {{ $t('strings.hello') }} {{ title }} - - -
diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/pages/index/index.js b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/pages/index/index.js deleted file mode 100644 index 4749e8252..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/pages/index/index.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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 router from '@system.router' -import {Core} from 'deccjsunit/index' -import commonEvent from '@ohos.commonEvent'; - -export default { - data: { - title: "" - }, - onInit() { - this.title = 'yingyong3'; - }, - onclick: function () { - router.replace({ - uri: "pages/second/second" - }) - }, - onShow() { - console.info('onShow start') - }, - onHide(){ - console.log("singletonEntryAbulity_onHide") - commonEvent.publish("singletonEntryAbulity3_onHide",()=>{ - console.log("singletonEntryAbulity3_onHide publish callBack singletonEntryAbulity3_onHide"); - }); - }, - onActive(){ - console.log("singletonEntryAbulity_onActive") - commonEvent.publish("singletonEntryAbulity3_onActive",()=>{ - console.log("singletonEntryAbulity3_onActive publish callBack singletonEntryAbulity3_onActive"); - }); - }, - onInactive(){ - console.log("singletonEntryAbulity_onInactive") - commonEvent.publish("singletonEntryAbulity3_onHide",()=>{ - console.log("singletonEntryAbulity3_onInactive publish callBack singletonEntryAbulity3_onInactive"); - }); - } -} - - - diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/pages/second/second.css b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/pages/second/second.css deleted file mode 100644 index 737096ca1..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/pages/second/second.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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. - */ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -.btn { - width: 50%; - height: 100px; - font-size: 40px; -} diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/pages/second/second.hml b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/pages/second/second.hml deleted file mode 100644 index 232a295e9..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/pages/second/second.hml +++ /dev/null @@ -1,20 +0,0 @@ - -
- - {{ $t('strings.page') }} - - -
diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/app.js b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/app.js deleted file mode 100644 index 7cb7248bd..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/app.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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("Application onCreate"); -// setTimeout(()=>{ -// this.content.terminateSelf().then((data)=>{ -// console.log("Application terminateSelf data:" + JSON.stringify(data) ) -// }).catch((error)=>{ -// console.log("Application terminateSelf data:" + JSON.stringify(error) ) -// }) -// },8000) - }, - onDestroy() { - console.info("Application onDestroy"); - } -}; diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/i18n/en-US.json b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/i18n/en-US.json deleted file mode 100644 index 08e34eac9..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/i18n/en-US.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World", - "page": "Second Page", - "next": "Next Page", - "back": "Back" - }, - "Files": { - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/i18n/zh-CN.json b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/i18n/zh-CN.json deleted file mode 100644 index 3dd53b3a8..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/i18n/zh-CN.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界", - "page": "第二页", - "next": "下一页", - "back": "返回" - }, - "Files": { - } -} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/pages/index/index.css b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/pages/index/index.css deleted file mode 100644 index 737096ca1..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/pages/index/index.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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. - */ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -.btn { - width: 50%; - height: 100px; - font-size: 40px; -} diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/pages/index/index.hml b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/pages/index/index.hml deleted file mode 100644 index 9c27d02f6..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ - -
- - {{ $t('strings.hello') }} {{ title }} - - -
diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/pages/index/index.js b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/pages/index/index.js deleted file mode 100644 index e73299287..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/pages/index/index.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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 router from '@system.router' -import {Core} from 'deccjsunit/index' -import commonEvent from '@ohos.commonEvent'; - -export default { - data: { - title: "" - }, - onInit() { - this.title = 'yingyong4'; - }, - onclick: function () { - router.replace({ - uri: "pages/second/second" - }) - }, - onShow() { - console.info('onShow start') - - }, - onHide(){ - console.log("singletonEntryAbulity_onHide") - commonEvent.publish("singletonEntryAbulity1_onHide",()=>{ - console.log("singletonEntryAbulity1_onHide publish callBack singletonEntryAbulity1_onHide"); - }); - }, - onActive(){ - console.log("singletonEntryAbulity_onActive") - commonEvent.publish("singletonEntryAbulity1_onActive",()=>{ - console.log("singletonEntryAbulity1_onActive publish callBack singletonEntryAbulity1_onActive"); - }); - }, - onInactive(){ - console.log("singletonEntryAbulity_onInactive") - commonEvent.publish("singletonEntryAbulity1_onHide",()=>{ - console.log("singletonEntryAbulity1_onInactive publish callBack singletonEntryAbulity1_onInactive"); - }); - } -} - - - diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/pages/second/second.css b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/pages/second/second.css deleted file mode 100644 index 737096ca1..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/pages/second/second.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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. - */ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -.btn { - width: 50%; - height: 100px; - font-size: 40px; -} diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/pages/second/second.hml b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/pages/second/second.hml deleted file mode 100644 index 232a295e9..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/pages/second/second.hml +++ /dev/null @@ -1,20 +0,0 @@ - -
- - {{ $t('strings.page') }} - - -
diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/test/AbilityDisableTest.js b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/test/AbilityDisableTest.js deleted file mode 100644 index 3012918ef..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/test/AbilityDisableTest.js +++ /dev/null @@ -1,390 +0,0 @@ - -/* - * 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. - */ -// @ts-nocheck -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" -import missionManager from '@ohos.application.missionManager'; -import featureAbility from '@ohos.ability.featureAbility'; -import bundleManager from '@ohos.bundle'; -import appManager from "@ohos.application.appManager" -import commonEvent from '@ohos.commonEvent'; -import {onDestroys} from "../MainAbility2/app.js" -import abilityManager from '@ohos.application.abilityManager' -import ConfigurationConstant from "@ohos.application.ConfigurationConstant"; - -function startAility(){ - setTimeout(()=>{ - featureAbility.startAbility({ want: { - bundleName: "com.example.abilitydisable", - abilityName: "com.example.abilitydisable.MainAbility2" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_Clear_0400 - startMainAbility2: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - }); - },100) - setTimeout(()=>{ - featureAbility.startAbility({ want: { - bundleName: "com.example.abilitydisable", - abilityName: "com.example.abilitydisable.MainAbility3" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_Clear_0400 - startMainAbility3: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)); - }); - },400) -} -function lockMissions(titles,missionId,times){ - setTimeout(()=>{ - for(var i=0;i{ - console.log(titles+'lockMission1 errCode:' + JSON.stringify(err) + " data: " + JSON.stringify(data)); - }); - }; - },times); -} -function clearAllMissions(){ - missionManager.clearAllMissions((err,data)=>{ - console.log('clearAllMissions errCode: ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - }) -} - -function fns(){ - setTimeout(()=>{ - featureAbility.startAbility({ want: { - bundleName: "com.example.abilitydisable", - abilityName: "com.example.abilitydisable.MainAbility2" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_Clear_0100 - startMainAbility2: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - expect(err.code == 0).assertTrue(); - }); - },100) - setTimeout(()=>{ - featureAbility.startAbility({ want: { - bundleName: "com.example.abilitydisable", - abilityName: "com.example.abilitydisable.MainAbility4" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_Clear_0100 - startMainAbility4: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - expect(err.code == 0).assertTrue(); - }); - },300) - setTimeout(()=>{ - featureAbility.startAbility({ want: { - bundleName: "com.example.abilitydisable", - abilityName: "com.example.abilitydisable.MainAbility3" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_Clear_0100 - startMainAbility3: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - expect(err.code == 0).assertTrue(); - }); - },500) - setTimeout(()=>{ - missionManager.getMissionInfos("", 20, (err, data) => { - console.log('SUB_AA_OpenHarmony_Clear_0100 getMissionInfos errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - for (var i = 0;i < data.length; i++) { - console.log("bundleName:"+data[i].want["abilityName"]) - if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility3" - || data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility4" - ||data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility" - ||data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility2"){ - console.log("data[i]['lockedState']::::"+data[i]['lockedState']); - console.log("data[i].missionId" + data[i].missionId); - console.log("SUB_AA_OpenHarmony_Clear_0100, missionId:" + data[i].missionId); - missionIds.push(data[i].missionId); - } - } - console.log('SUB_AA_OpenHarmony_Clear_0100 missionId:'+ missionIds + - typeof missionIds +missionIds[1] + typeof missionIds[1]); - }) - console.log("SUB_AA_OpenHarmony_Clear_0100" + JSON.stringify(missionIds)); - },800) - setTimeout(()=>{ - missionManager.lockMission(parseInt(missionIds[1]),(err,data)=>{ - console.log('SUB_AA_OpenHarmony_Clear_0100 lockMission1 missionIds[1] : ' + - JSON.stringify(missionIds[1]), + parseInt(missionIds[1])); - console.log('SUB_AA_OpenHarmony_Clear_0100 lockMission1 errCode : ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - }) - },1200) - setTimeout(()=>{ - missionManager.lockMission(parseInt(missionIds[2]),(err,data)=>{ - console.log('SUB_AA_OpenHarmony_Clear_0100 lockMission2 errCode : ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - }) - },1500) - setTimeout(()=>{ - missionManager.getMissionInfos("", 20, (err, data) => { - console.log("SUB_AA_OpenHarmony_Clear_0100, twosgetMissionInfos:" + - JSON.stringify(data)); - for (var i = 0;i < data.length; i++) { - console.log("data[i].missionId:missionIds[2] news missionIds[1]" + - data[i].missionId + missionIds[2] + missionIds[1]) - if(data[i].missionId == missionIds[1] || data[i].missionId == missionIds[2]){ - console.log("data[i]['lockedState']222:::::::"+data[i]['lockedState']); - expect(data[i]['lockedState'] == true).assertTrue(); - } - } - }) - console.log("SUB_AA_OpenHarmony_Clear_0100" + JSON.stringify(missionIds)); - },3500) - setTimeout(()=>{ - missionManager.getMissionInfos("", 20, (err, data) => { - console.log('SUB_AA_OpenHarmony_Clear_0100 getMissionInfos errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - for (var i = 0;i < data.length; i++) { - console.log("bundleName:"+data[i].want["abilityName"]) - if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility3" - || data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility4" - ||data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility" - ||data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility2"){ - console.log("data[i]['lockedState']::::"+data[i]['lockedState']); - expect(data[i].lockedState == false).assertTrue(); - } - } - }) - console.log("SUB_AA_OpenHarmony_Clear_0100" + JSON.stringify(missionIds)); - },4000) - setTimeout(()=>{ - missionManager.moveMissionToFront(parseInt(missionIds[2]),(err,data)=>{ - console.log('SUB_AA_OpenHarmony_Clear_0100 moveMissionToFront errCode : ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - }) - },4500) - setTimeout(()=>{ - missionManager.clearAllMissions((err,data)=>{ - console.log('SUB_AA_OpenHarmony_Clear_0100 clearAllMissions errCode: ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - - }) - },5000) - setTimeout(()=>{ - missionManager.getMissionInfos("", 20, (err, data) => { - console.log('SUB_AA_OpenHarmony_Clear_0100 getMissionInfos errCode : ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - for (var i = 0;i < data.length; i++) { - console.log("bundleName:"+data[i].want["abilityName"]) - if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility3" || - data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility4" || - data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility"|| - data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility2"){ - console.log("data[i]['lockedState']end::::"+data[i]['lockedState']); - expect(data[i]['lockedState'] == true).assertTrue(); - } - } - }) - console.log("SUB_AA_OpenHarmony_Clear_0100" + - JSON.stringify(missionIds)); - },8000) - expect(lists.indexOf(JSON.stringify("singletonEntryAbulity2_onShow"))!=-1).assertTrue(); - -} -describe('AbilityDisableTests', function () { - let mainAbility1ListS = new Array() - let lists = new Array() - function subscriberCallBackMainAbility2Destory(err,data){ - console.log("Subscribe2 CallBack data:" + JSON.stringify(data)); - lists.push(data["event"]); - console.log("subscriberCallBackMainAbility2Destory lists:"+lists); - }; - function subscriberCallBackMainAbility1Destory(err,data){ - console.log("Subscribe3 CallBack data:" + JSON.stringify(data)); - mainAbility1ListS.push(data["event"]) - console.log("subscriberCallBack_mainAbility3_Destory mainAbility1ListS:"+mainAbility1ListS); - } - console.log("AbilityDisableTests --- start"); - var ability2LifeEvents = { - events:["ApplicationMainAbility2_onDestroy", - "singletonEntryAbulity2_onHide", - "singletonEntryAbulity2_onActive", - "singletonEntryAbulity2_onInactive", - "singletonEntryAbility2_onDestroy", - "singletonEntryAbulity2_onShow", - "ApplicationMainAbility2_onCreate",] - }; - var ability1LifeEvents = { - events:["singletonEntryAbulity3_onHide", - "singletonEntryAbulity3_onActive", - "singletonEntryAbulity3_onInactive", - "singletonEntryAbility3_onDestroy", - "singletonEntryAbulity3_onShow", - "ApplicationMainAbility3_onCreate", - "ApplicationMainAbility3_onDestroy", - ] - }; - - /* - * @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_2900 - * @tc.name Verify the full-screen switching application - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MoveMissionToFront_2900', 0, async function (done) { - - var Subscriber2 = []; - var Subscriber1 = []; - var mainAbility1missinds = [] - console.log("SUB_AA_OpenHarmony_MoveMissionToFront_2900 --- start") - commonEvent.createSubscriber(ability2LifeEvents).then(async (data)=>{ - console.log("Create Subscriber2=======>:"+JSON.stringify(data)); - Subscriber2 = data; - console.log("data2 is:" + JSON.stringify(Subscriber2)); - await commonEvent.subscribe(Subscriber2,subscriberCallBackMainAbility2Destory) - }); - commonEvent.createSubscriber(ability1LifeEvents).then(async (data)=>{ - console.log("Create Subscriber1=======>:"+JSON.stringify(data)); - Subscriber1 = data; - console.log("data2 is:" + JSON.stringify(Subscriber1)); - await commonEvent.subscribe(Subscriber1,subscriberCallBackMainAbility1Destory) - }); - setTimeout(()=>{ - featureAbility.startAbility({ want: { - bundleName: "com.example.abilitydisable", - abilityName: "com.example.abilitydisable.MainAbility2" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_MoveMissionToFront_2900 - startMainAbility2: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)); - }); - },500) - setTimeout(()=>{ - featureAbility.startAbility({ want: { - bundleName: "com.example.abilitydisable", - abilityName: "com.example.abilitydisable.MainAbility3" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_MoveMissionToFront_2900 - startMainAbility3: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)); - }); - },1000); - setTimeout(()=>{ - console.log("1111subscriberCallBackMainAbility2Destory lists:"+lists); - expect(lists.indexOf(JSON.stringify("singletonEntryAbulity2_onShow"))!=-1).assertTrue(); - expect(lists.indexOf(JSON.stringify("ApplicationMainAbility2_onCreate"))!=-1).assertTrue(); - },2500) - setTimeout(()=>{ - missionManager.getMissionInfos("", 100, (err, data) => { - console.log('SUB_AA_OpenHarmony_MoveMissionToFront_2900 getMissionInfos errCode: '+ -JSON.stringify(err) + " data: " + JSON.stringify(data)); - for (var i = 0;i < data.length; i++) { - if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility2"){ - mainAbility1missinds.push(data[i]["missionId"]) - } - - } - console.log("mainAbility1missinds:"+mainAbility1missinds); - }); - },3000) - setTimeout(()=>{ - console.log('SUB_AA_OpenHarmony_MoveMissionToFront_2900 moveMissionToFront dataCode:++++++'); - missionManager.moveMissionToFront(parseInt(mainAbility1missinds[0]),{ - parameters:{ "windowMode":1 }}).then((data)=>{ - console.log('SUB_AA_OpenHarmony_MoveMissionToFront_2900 moveMissionToFront dataCode:'+ " data:" - + JSON.stringify(data)); - expect().assertFail(); - }).catch((err)=>{ - console.log('SUB_AA_OpenHarmony_MoveMissionToFront_2900 moveMissionToFront errCode:'+ " err:" - + JSON.stringify(err)); - }); - },3888); - setTimeout(()=>{ - console.log("1111subscriberCallBackMainAbility1Destory lists:"+ mainAbility1ListS); - expect(mainAbility1ListS.indexOf(JSON.stringify("singletonEntrymainAb" + - "ility1ListSAbulity1_onInactive"))!=-1).assertTrue(); - expect(mainAbility1ListS.indexOf(JSON.stringify("singletonEntryA" + - "bulity1_onHide"))!=-1).assertTrue(); - },3999); - done() - }); - - /* - * @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_3000 - * @tc.name Verify the left split screen switching application - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MoveMissionToFront_3000', 0, async function (done) { - var Subscriber2 = ""; - var Subscriber1 = ""; - var mainAbility1missinds = [] - console.log("SUB_AA_OpenHarmony_MoveMissionToFront_3000 --- start") - commonEvent.createSubscriber(ability2LifeEvents).then(async (data)=>{ - console.log("Create Subscriber2=======>:"+JSON.stringify(data)); - Subscriber2 = data; - console.log("data2 is:" + JSON.stringify(Subscriber2)); - await commonEvent.subscribe(Subscriber2,subscriberCallBackMainAbility2Destory) - }); - commonEvent.createSubscriber(ability1LifeEvents).then(async (data)=>{ - console.log("Create Subscriber1=======>:"+JSON.stringify(data)); - Subscriber1 = data; - console.log("data2 is:" + JSON.stringify(Subscriber1)); - await commonEvent.subscribe(Subscriber1,subscriberCallBackMainAbility1Destory) - }); - - setTimeout(()=>{ - featureAbility.startAbility({ want: { - bundleName: "com.example.abilitydisable", - abilityName: "com.example.abilitydisable.MainAbility2" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_MoveMissionToFront_3000 - startMainAbility2: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)); - }); - },500); - setTimeout(()=>{ - featureAbility.startAbility({ want: { - bundleName: "com.example.abilitydisable", - abilityName: "com.example.abilitydisable.MainAbility3" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_MoveMissionToFront_3000 - startMainAbility3: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)); - }); - },1000); - setTimeout(()=>{ - console.log("1111subscriberCallBack_mainAbility2_lists: -singletonEntryAbulity2_onShow:"+lists); - console.log("+++++++++++++++++"+lists.indexOf("singletonEntryAbulity2_onShow")+"+++++++"+lists.indexOf("ApplicationMainAbility2_onCreate")+lists) - expect(lists.indexOf(JSON.stringify("singletonEntryAbulity2_onShow"))!=-1).assertTrue(); - expect(lists.indexOf(JSON.stringify("ApplicationMainAbility2_onCreate"))!=-1).assertTrue(); - },2500); - setTimeout(()=>{ - missionManager.getMissionInfos("", 100, (err, data) => { - console.log('SUB_AA_OpenHarmony_MoveMissionToFront_3000 getMissionInfos errCode: '+ JSON.stringify(err) + " data: " + JSON.stringify(data)); - for (var i = 0;i < data.length; i++) { - console.log("bundleName222222:"+data[i].want["abilityName"]+"data[i]['lockedState']::::"+data[i]['lockedState']); - if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility3"){ - console.log('data[i]["missionId"]'+data[i]["missionId"] + "::::"+data[i].want["abilityName"]); - mainAbility1missinds.push(data[i]["missionId"]) - } - } - console.log("mainAbility1missinds:"+mainAbility1missinds); - }); - },3000); - setTimeout(()=>{ - console.log('SUB_AA_OpenHarmony_MoveMissionToFront_3000 moveMissionToFront dataCode:++++++'); - missionManager.moveMissionToFront(parseInt(mainAbility1missinds[0]),{ - parameters:{ "windowMode":100 }}).then((data)=>{ - console.log('SUB_AA_OpenHarmony_MoveMissionToFront_3000 -moveMissionToFront dataCode:'+ " data:" + JSON.stringify(data)); - }).catch((err)=>{ - console.log('SUB_AA_OpenHarmony_MoveMissionToFront_3000 -moveMissionToFront errCode:'+ " err:" + JSON.stringify(err)); - }); - },3888); - setTimeout(()=>{ - expect(mainAbility1ListS.indexOf(JSON.stringify("singletonEntryAbulity1_onInactive"))==-1).assertTrue(); - expect(mainAbility1ListS.indexOf(JSON.stringify("singletonEntryAbulity1_onHide"))==-1).assertTrue(); - },3999); - done(); - }); -}) diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/test/ClearTest.js b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/test/ClearTest.js deleted file mode 100644 index 52da30d87..000000000 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/test/ClearTest.js +++ /dev/null @@ -1,126 +0,0 @@ - -/* - * 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. - */ -// @ts-nocheck -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" -import missionManager from '@ohos.application.missionManager'; -import abilityFeatureAbility from '@ohos.ability.featureAbility'; -import bundleManager from '@ohos.bundle'; -import appManager from "@ohos.application.appManager" -import commonEvent from '@ohos.commonEvent'; -import {onDestroys} from "../MainAbility2/app.js" -import abilityManager from '@ohos.application.abilityManager' -import ConfigurationConstant from "@ohos.application.ConfigurationConstant"; -import AbilityConstant from '@ohos.application.AbilityConstant' -describe('AbilityDisableTests', function () { - - /* - * @tc.number SUB_AA_OpenHarmony_AbilityStart_6200 - * @tc.name Verify the enumeration values LaunchReason. CONTINUATION - * @tc.desc Function test - * @tc.level 0 - */ - it("SUB_AA_OpenHarmony_AbilityStart_6200", 0, async function (done) { - console.info("--------logMessage SUB_AA_OpenHarmony_AbilityStart_6300----"); - console.info("SUB_AA_OpenHarmony_AbilityStart_6200 LaunchReason.CONTINUATION: " - + AbilityConstant.LaunchReason.CONTINUATION); - expect(AbilityConstant.LaunchReason.CONTINUATION==3).assertTrue(); - done(); - }); - - /* - * @tc.number SUB_AA_OpenHarmony_AbilityStart_6300 - * @tc.name Verify the enumeration value launchreason.start UNKNOWN - * @tc.desc Function test - * @tc.level 0 - */ - it("SUB_AA_OpenHarmony_AbilityStart_6300", 0, async function (done) { - console.info("--------logMessage SUB_AA_OpenHarmony_AbilityStart_6300----"); - console.info("SUB_AA_OpenHarmony_AbilityStart_6300 LaunchReason.UNKNOWN: " + -AbilityConstant.LaunchReason.UNKNOWN); - expect(AbilityConstant.LaunchReason.UNKNOWN==0).assertTrue(); - done(); - }); - - /* - * @tc.number SUB_AA_OpenHarmony_AbilityStart_6400 - * @tc.name Verify the enumeration value launchreason.START_ABILITY - * @tc.desc Function test - * @tc.level 0 - */ - it("SUB_AA_OpenHarmony_AbilityStart_6400", 0, async function (done) { - console.info("------logMessage SUB_AA_OpenHarmony_AbilityStart_6400-----"); - console.info("SUB_AA_OpenHarmony_AbilityStart_6400 LaunchReason.START_ABILITY: " + - AbilityConstant.LaunchReason.START_ABILITY); - expect(AbilityConstant.LaunchReason.START_ABILITY==1).assertTrue(); - done(); - }); - - /* - * @tc.number SUB_AA_OpenHarmony_AbilityStart_6500 - * @tc.name Verify the enumeration values LaunchReason. CALL - * @tc.desc Function test - * @tc.level 0 - */ - it("SUB_AA_OpenHarmony_AbilityStart_6500", 0, async function (done) { - console.info("-------logMessage SUB_AA_OpenHarmony_AbilityStart_6500-----"); - console.info("SUB_AA_OpenHarmony_AbilityStart_6500 LaunchReason.CALL: " + -AbilityConstant.LaunchReason.CALL); - expect(AbilityConstant.LaunchReason.CALL==2).assertTrue(); - done(); - }); - - /* - * @tc.number SUB_AA_OpenHarmony_AbilityStart_6600 - * @tc.name Verify the enumeration values LastExitReason.UNKNOWN - * @tc.desc Function test - * @tc.level 0 - */ - it("SUB_AA_OpenHarmony_AbilityStart_6600", 0, async function (done) { - console.info("---------logMessage SUB_AA_OpenHarmony_AbilityStart_6600---------"); - console.info("SUB_AA_OpenHarmony_AbilityStart_6600 LastExitReason.UNKNOWN: " + - AbilityConstant.LastExitReason.UNKNOWN); - expect(AbilityConstant.LastExitReason.UNKNOWN==0).assertTrue(); - done(); - }); - - /* - * @tc.number SUB_AA_OpenHarmony_AbilityStart_6700 - * @tc.name Verify the enumeration values LastExitReason.ABILITY_NOT_RESPONDING - * @tc.desc Function test - * @tc.level 0 - */ - it("SUB_AA_OpenHarmony_AbilityStart_6700", 0, async function (done) { - console.info("--------logMessage SUB_AA_OpenHarmony_AbilityStart_6700---------"); - console.info("SUB_AA_OpenHarmony_AbilityStart_6700 LastExitReason.ABILITY_NOT_RESPONDING: " + - AbilityConstant.LastExitReason.ABILITY_NOT_RESPONDING); - expect(AbilityConstant.LastExitReason.ABILITY_NOT_RESPONDING==1).assertTrue(); - done(); - }); - - /* - * @tc.number SUB_AA_OpenHarmony_AbilityStart_6700 - * @tc.name Verify the enumeration values LastExitReason.NORMAL - * @tc.desc Function test - * @tc.level 0 - */ - it("SUB_AA_OpenHarmony_AbilityStart_6800", 0, async function (done) { - console.info("-----logMessage SUB_AA_OpenHarmony_AbilityStart_6800-----------"); - console.info("SUB_AA_OpenHarmony_AbilityStart_6800 LastExitReason.NORMAL: " + - AbilityConstant.LastExitReason.NORMAL); - expect(AbilityConstant.LastExitReason.NORMAL==2).assertTrue(); - done(); - }); -}) diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/test/JSMyapplicationJsunit.test.js b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/test/JSMyapplicationJsunit.test.js new file mode 100644 index 000000000..82b045010 --- /dev/null +++ b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/test/JSMyapplicationJsunit.test.js @@ -0,0 +1,191 @@ +// @ts-nocheck +/* + * 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 {describe, expect, it} from 'deccjsunit/index' +import ConfigurationConstant from '@ohos.application.ConfigurationConstant' + +describe("ConfigurationTest", function () { + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0100 + * @tc.name colorMode is "ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0100', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0100-------------"); + expect(ConfigurationConstant.ColorMode.COLOR_MODE_LIGHT).assertEqual(1); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0100-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0200 + * @tc.name colorMode is "ConfigurationConstant.ColorMode.COLOR_MODE_DARK" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0200', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0200-------------"); + expect(ConfigurationConstant.ColorMode.COLOR_MODE_DARK).assertEqual(0); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0200-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0300 + * @tc.name colorMode is "ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0300', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0300-------------"); + expect(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET).assertEqual(-1); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_colorMode_0300-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0100 + * @tc.name Direction is "ConfigurationConstant.Direction.DIRECTION_VERTICAL" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0100', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0100-------------"); + expect(ConfigurationConstant.Direction.DIRECTION_VERTICAL).assertEqual(0); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0100-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0200 + * @tc.name Direction is "ConfigurationConstant.Direction.DIRECTION_HORIZONTAL" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0200', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0200-------------"); + expect(ConfigurationConstant.Direction.DIRECTION_HORIZONTAL).assertEqual(1); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0200-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0300 + * @tc.name Direction is "ConfigurationConstant.Direction.DIRECTION_NOT_SET" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0300', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0300-------------"); + expect(ConfigurationConstant.Direction.DIRECTION_NOT_SET).assertEqual(-1); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_Direction_0300-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0100 + * @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_SDPI" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0100', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0100-------------"); + expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_SDPI).assertEqual(120); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0100-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0200 + * @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_MDPI" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0200', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0200-------------"); + expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_MDPI).assertEqual(160); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0200-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0300 + * @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_LDPI" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0300', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0300-------------"); + expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_LDPI).assertEqual(240); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0300-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0400 + * @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_XLDPI" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0400', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0400-------------"); + expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_XLDPI).assertEqual(320); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0400-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0500 + * @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_XXLDPI" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0500', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0500-------------"); + expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_XXLDPI).assertEqual(480); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0500-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0600 + * @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_XXXLDPI" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0600', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0600-------------"); + expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_XXXLDPI).assertEqual(640); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0600-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0700 + * @tc.name ScreenDensity is "ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_NOT_SET" + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0700', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0700-------------"); + expect(ConfigurationConstant.ScreenDensity.SCREEN_DENSITY_NOT_SET).assertEqual(0); + done(); + console.log("------------end SUB_AA_OpenHarmony_ConfigurationConstant_ScreenDensity_0700-------------"); + }); + + +}) \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/test/List.test.js index e97a120f9..ebef389ae 100644 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/test/List.test.js +++ b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/test/List.test.js @@ -1,18 +1,16 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -require('./ClearTest.js'); -require('./AbilityDisableTest.js'); - - +// @ts-nocheck +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +require('./JSMyapplicationJsunit.test.js'); diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/resources/base/element/string.json index 1d2808e5c..92f5ff8a4 100644 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/resources/base/element/string.json +++ b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/resources/base/element/string.json @@ -1,40 +1,20 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "description_mainability", - "value": "JS_Empty Ability" - }, - { - "name": "description_mainability2", - "value": "JS_Empty Ability" - }, - { - "name": "entry_MainAbility2", - "value": "entry_MainAbility2" - }, - { - "name": "description_mainability3", - "value": "JS_Empty Ability" - }, - { - "name": "entry_MainAbility3", - "value": "entry_MainAbility3" - }, - { - "name": "description_mainability4", - "value": "JS_Empty Ability" - }, - { - "name": "entry_MainAbility4", - "value": "entry_MainAbility4" - }, - { - "name": "description_serviceability", - "value": "hap sample empty service" - } - ] +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "JS_Empty Ability" + }, + { + "name": "description_mainability2", + "value": "JS_Empty Ability" + }, + { + "name": "entry_MainAbility2", + "value": "entry_MainAbility2" + } + ] } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/fa/fa_configurationconstant_test/signature/openharmony_sx.p7b old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_coverapi_test/BUILD.gn b/aafwk/aafwk_standard/fa/fa_coverapi_test/BUILD.gn old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_coverapi_test/Test.json b/aafwk/aafwk_standard/fa/fa_coverapi_test/Test.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/config.json b/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/config.json old mode 100644 new mode 100755 index 8680ab400..82127c299 --- a/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/config.json +++ b/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/config.json @@ -1,64 +1,64 @@ -{ - "app":{ - "bundleName":"com.example.coverapi", - "vendor":"example", - "version":{ - "code":1000000, - "name":"1.0.0" - } - }, - "deviceConfig":{}, - "module":{ - "package":"com.example.coverapi", - "name":".MyApplication", - "mainAbility":".MainAbility", - "srcPath":"", - "deviceType":[ - "phone" - ], - "distro":{ - "deliveryWithInstall":true, - "moduleName":"entry", - "moduleType":"entry", - "installationFree":false - }, - "abilities":[ - { - "skills":[ - { - "entities":[ - "entity.system.home" - ], - "actions":[ - "action.system.home" - ] - } - ], - "orientation":"unspecified", - "visible":true, - "srcPath":"MainAbility", - "name":".MainAbility", - "srcLanguage":"js", - "icon":"$media:icon", - "description":"$string:description_mainability", - "formsEnabled":false, - "label":"$string:entry_MainAbility", - "type":"page", - "launchType":"standard" - } - ], - "js":[ - { - "pages":[ - "pages/index/index", - "pages/second/second" - ], - "name":".MainAbility", - "window":{ - "designWidth":720, - "autoDesignWidth":false - } - } - ] - } +{ + "app":{ + "bundleName":"com.example.coverapi", + "vendor":"example", + "version":{ + "code":1000000, + "name":"1.0.0" + } + }, + "deviceConfig":{}, + "module":{ + "package":"com.example.coverapi", + "name":".MyApplication", + "mainAbility":".MainAbility", + "srcPath":"", + "deviceType":[ + "phone" + ], + "distro":{ + "deliveryWithInstall":true, + "moduleName":"entry", + "moduleType":"entry", + "installationFree":false + }, + "abilities":[ + { + "skills":[ + { + "entities":[ + "entity.system.home" + ], + "actions":[ + "action.system.home" + ] + } + ], + "orientation":"unspecified", + "visible":true, + "srcPath":"MainAbility", + "name":".MainAbility", + "srcLanguage":"js", + "icon":"$media:icon", + "description":"$string:description_mainability", + "formsEnabled":false, + "label":"$string:entry_MainAbility", + "type":"page", + "launchType":"standard" + } + ], + "js":[ + { + "pages":[ + "pages/index/index", + "pages/second/second" + ], + "name":".MainAbility", + "window":{ + "designWidth":720, + "autoDesignWidth":false + } + } + ] + } } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/app.js b/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/app.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/i18n/en-US.json b/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/i18n/en-US.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/i18n/zh-CN.json b/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/i18n/zh-CN.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/pages/index/index.css b/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/pages/index/index.css old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/pages/index/index.hml b/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/pages/index/index.hml old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/pages/index/index.js b/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/pages/index/index.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/pages/second/second.css b/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/pages/second/second.css old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/pages/second/second.hml b/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/pages/second/second.hml old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/pages/second/second.js b/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/MainAbility/pages/second/second.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/test/List.test.js old mode 100644 new mode 100755 index 5aa0cf281..dc2d4ef93 --- a/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/test/List.test.js +++ b/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/test/List.test.js @@ -1,16 +1,16 @@ -/* - * 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. - */ - +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + require('./coverApiTest.js'); \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/test/coverApiTest.js b/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/test/coverApiTest.js old mode 100644 new mode 100755 index 3646bee67..651ba17f2 --- a/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/test/coverApiTest.js +++ b/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/js/test/coverApiTest.js @@ -1,124 +1,124 @@ -// @ts-nocheck -/* - * 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 commonEvent from '@ohos.commonevent' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index"; -import appManager from '@ohos.application.appManager'; -import abilityManager from '@ohos.application.abilityManager'; - -const START_ABILITY_TIMEOUT = 5000; -describe('CoverApiTest', function () { - console.log("CoverApiTest --- start"); - var subscriberInfoMainAbility = { - events: ["mainAbilityOnConfigurationUpdated"] - } - - /* - * @tc.number SUB_AA_OpenHarmony_CoverApi_0500 - * @tc.name whether the system is under stability test - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_CoverApi_0500', 0, async function (done) { - console.log("------------start SUB_AA_OpenHarmony_CoverApi_0500-------------"); - appManager.isRunningInStabilityTest() - .then((data) => { - console.info('SUB_AA_OpenHarmony_CoverApi_0500 successful. data: ' + JSON.stringify(data)); - expect(data == false).assertTrue(); - done(); - }).catch((error) => { - console.error('SUB_AA_OpenHarmony_CoverApi_0500 failed. error: ' + JSON.stringify(error)); - expect().assertFalse(); - done(); - }) - }); - - /* - * @tc.number SUB_AA_OpenHarmony_CoverApi_0700 - * @tc.name Verify that the data of nonexistent apps is cleared - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_CoverApi_0700', 0, async function (done) { - console.log("SUB_AA_OpenHarmony_CoverApi_0700 --- start"); - appManager.clearUpApplicationData('com.example.coverapi') - .then((data) => { - console.info('SUB_AA_OpenHarmony_CoverApi_0700 successful. data: ' + JSON.stringify(data)); - expect(data == 0).assertTrue(); - done(); - }).catch((error) => { - console.error('SUB_AA_OpenHarmony_CoverApi_0700 failed. error: ' + JSON.stringify(error)); - expect().assertFalse(); - done(); - }) - }) - - /** - * @tc.number: SUB_AA_OpenHarmony_CoverApi_0500 - * @tc.name: wantConstant : Check specific enum - * @tc.desc: Check the return type of the interface (by Promise) - */ - it('SUB_AA_OpenHarmony_CoverApi_0800', 0, async function (done) { - console.log("SUB_AA_OpenHarmony_CoverApi_0800 --- start"); - - var Subscriber; - let id; - - function SubscribeCallBack(err, data) { - console.debug("SUB_AA_OpenHarmony_CoverApi_0800====>Subscribe CallBack data:====>" + JSON.stringify(data)); - expect(data.event == 'mainAbilityOnConfigurationUpdated').assertTrue(); - if (data.event == 'mainAbility_onConfigurationUpdated') { - clearTimeout(id); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - done(); - } - } - - commonEvent.createSubscriber(subscriberInfoMainAbility).then(async (data) => { - console.debug("SUB_AA_OpenHarmony_CoverApi_0800====>Create Subscriber====>"); - Subscriber = data; - await commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - - function UnSubscribeCallback() { - console.debug("SUB_AA_OpenHarmony_CoverApi_0800====>UnSubscribe CallBack====>"); - done(); - } - - function timeout() { - expect().assertFail(); - console.debug('SUB_AA_OpenHarmony_CoverApi_0800 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - done(); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - - var Configuration = { language: "en" }; - abilityManager.updateConfiguration(Configuration) - .then((data) => { - console.log("SUB_AA_OpenHarmony_CoverApi_0800 --- updateConfiguration " + JSON.stringify(data)); - done(); - }).catch((error) => { - console.error('SUB_AA_OpenHarmony_CoverApi_0800 failed. error: ' + JSON.stringify(error)); - done(); - }) - - console.log("SUB_AA_OpenHarmony_CoverApi_0800 --- end"); - }) - -}) +// @ts-nocheck +/* + * 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 commonEvent from '@ohos.commonevent' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index"; +import appManager from '@ohos.application.appManager'; +import abilityManager from '@ohos.application.abilityManager'; + +const START_ABILITY_TIMEOUT = 5000; +describe('CoverApiTest', function () { + console.log("CoverApiTest --- start"); + var subscriberInfoMainAbility = { + events: ["mainAbilityOnConfigurationUpdated"] + } + + /* + * @tc.number SUB_AA_OpenHarmony_CoverApi_0500 + * @tc.name whether the system is under stability test + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_CoverApi_0500', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_CoverApi_0500-------------"); + appManager.isRunningInStabilityTest() + .then((data) => { + console.info('SUB_AA_OpenHarmony_CoverApi_0500 successful. data: ' + JSON.stringify(data)); + expect(data == false).assertTrue(); + done(); + }).catch((error) => { + console.error('SUB_AA_OpenHarmony_CoverApi_0500 failed. error: ' + JSON.stringify(error)); + expect().assertFalse(); + done(); + }) + }); + + /* + * @tc.number SUB_AA_OpenHarmony_CoverApi_0700 + * @tc.name Verify that the data of nonexistent apps is cleared + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_CoverApi_0700', 0, async function (done) { + console.log("SUB_AA_OpenHarmony_CoverApi_0700 --- start"); + appManager.clearUpApplicationData('com.example.coverapi') + .then((data) => { + console.info('SUB_AA_OpenHarmony_CoverApi_0700 successful. data: ' + JSON.stringify(data)); + expect(data == 0).assertTrue(); + done(); + }).catch((error) => { + console.error('SUB_AA_OpenHarmony_CoverApi_0700 failed. error: ' + JSON.stringify(error)); + expect().assertFalse(); + done(); + }) + }) + + /** + * @tc.number: SUB_AA_OpenHarmony_CoverApi_0500 + * @tc.name: wantConstant : Check specific enum + * @tc.desc: Check the return type of the interface (by Promise) + */ + it('SUB_AA_OpenHarmony_CoverApi_0800', 0, async function (done) { + console.log("SUB_AA_OpenHarmony_CoverApi_0800 --- start"); + + var Subscriber; + let id; + + function SubscribeCallBack(err, data) { + console.debug("SUB_AA_OpenHarmony_CoverApi_0800====>Subscribe CallBack data:====>" + JSON.stringify(data)); + expect(data.event == 'mainAbilityOnConfigurationUpdated').assertTrue(); + if (data.event == 'mainAbility_onConfigurationUpdated') { + clearTimeout(id); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + done(); + } + } + + commonEvent.createSubscriber(subscriberInfoMainAbility).then(async (data) => { + console.debug("SUB_AA_OpenHarmony_CoverApi_0800====>Create Subscriber====>"); + Subscriber = data; + await commonEvent.subscribe(Subscriber, SubscribeCallBack); + }) + + + function UnSubscribeCallback() { + console.debug("SUB_AA_OpenHarmony_CoverApi_0800====>UnSubscribe CallBack====>"); + done(); + } + + function timeout() { + expect().assertFail(); + console.debug('SUB_AA_OpenHarmony_CoverApi_0800 - timeout'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) + done(); + } + + id = setTimeout(timeout, START_ABILITY_TIMEOUT); + + var Configuration = { language: "en" }; + abilityManager.updateConfiguration(Configuration) + .then((data) => { + console.log("SUB_AA_OpenHarmony_CoverApi_0800 --- updateConfiguration " + JSON.stringify(data)); + done(); + }).catch((error) => { + console.error('SUB_AA_OpenHarmony_CoverApi_0800 failed. error: ' + JSON.stringify(error)); + done(); + }) + + console.log("SUB_AA_OpenHarmony_CoverApi_0800 --- end"); + }) + +}) diff --git a/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/resources/base/element/string.json old mode 100644 new mode 100755 index 7d7863923..1c3bf7e77 --- a/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/resources/base/element/string.json +++ b/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string":[ - { - "name":"entry_MainAbility", - "value":"entry_MainAbility" - }, - { - "name":"description_mainability", - "value":"JS_Empty Ability" - } - ] +{ + "string":[ + { + "name":"entry_MainAbility", + "value":"entry_MainAbility" + }, + { + "name":"description_mainability", + "value":"JS_Empty Ability" + } + ] } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/resources/base/media/icon.png b/aafwk/aafwk_standard/fa/fa_coverapi_test/entry/src/main/resources/base/media/icon.png old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_coverapi_test/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/fa/fa_coverapi_test/signature/openharmony_sx.p7b old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/BUILD.gn b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/BUILD.gn old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/Test.json b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/Test.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/config.json b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/config.json old mode 100644 new mode 100755 index 27dbde076..c87ecdcee --- a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/config.json +++ b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/config.json @@ -1,141 +1,141 @@ -{ - "app": { - "bundleName": "com.example.abilitydisable", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.abilitydisable", - "name": ".MyApplication", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_mainability", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "orientation": "unspecified", - "srcPath": "MainAbility2", - "name": ".MainAbility2", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_mainability2", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "orientation": "unspecified", - "srcPath": "MainAbility3", - "name": ".MainAbility3", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_mainability3", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "orientation": "unspecified", - "srcPath": "MainAbility4", - "name": ".MainAbility4", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_mainability4", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "srcPath": "ServiceAbility", - "name": ".ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "js", - "description": "$string:description_serviceability", - "type": "service" - } - ], - "js": [ - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility2", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility3", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility4", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } +{ + "app": { + "bundleName": "com.example.abilitydisable", + "vendor": "example", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.abilitydisable", + "name": ".MyApplication", + "mainAbility": ".MainAbility", + "srcPath": "", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "srcPath": "MainAbility2", + "name": ".MainAbility2", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability2", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "srcPath": "MainAbility3", + "name": ".MainAbility3", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability3", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "srcPath": "MainAbility4", + "name": ".MainAbility4", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability4", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "srcPath": "ServiceAbility", + "name": ".ServiceAbility", + "icon": "$media:icon", + "srcLanguage": "js", + "description": "$string:description_serviceability", + "type": "service" + } + ], + "js": [ + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility2", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility3", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility4", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/app.js b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/app.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/i18n/en-US.json b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/i18n/en-US.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/i18n/zh-CN.json b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/i18n/zh-CN.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/pages/index/index.css b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/pages/index/index.css old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/pages/index/index.hml b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/pages/index/index.hml old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/pages/index/index.js b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/pages/index/index.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/pages/second/second.css b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/pages/second/second.css old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/pages/second/second.hml b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/pages/second/second.hml old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/pages/second/second.js b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility/pages/second/second.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/app.js b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/app.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/i18n/en-US.json b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/i18n/en-US.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/i18n/zh-CN.json b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/i18n/zh-CN.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/pages/index/index.css b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/pages/index/index.css old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/pages/index/index.hml b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/pages/index/index.hml old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/pages/index/index.js b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/pages/index/index.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/pages/second/second.css b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/pages/second/second.css old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/pages/second/second.hml b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/pages/second/second.hml old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/pages/second/second.js b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility2/pages/second/second.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/app.js b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/app.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/i18n/en-US.json b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/i18n/en-US.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/i18n/zh-CN.json b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/i18n/zh-CN.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/pages/index/index.css b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/pages/index/index.css old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/pages/index/index.hml b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/pages/index/index.hml old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/pages/index/index.js b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/pages/index/index.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/pages/second/second.css b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/pages/second/second.css old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/pages/second/second.hml b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/pages/second/second.hml old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/pages/second/second.js b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility3/pages/second/second.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/app.js b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/app.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/i18n/en-US.json b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/i18n/en-US.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/i18n/zh-CN.json b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/i18n/zh-CN.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/pages/index/index.css b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/pages/index/index.css old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/pages/index/index.hml b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/pages/index/index.hml old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/pages/index/index.js b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/pages/index/index.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/pages/second/second.css b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/pages/second/second.css old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/pages/second/second.hml b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/pages/second/second.hml old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/pages/second/second.js b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/MainAbility4/pages/second/second.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/ServiceAbility/service.js b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/ServiceAbility/service.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/test/AbilityDisableTest.js b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/test/AbilityDisableTest.js old mode 100644 new mode 100755 index ce05bafcc..a3b8feb23 --- a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/test/AbilityDisableTest.js +++ b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/test/AbilityDisableTest.js @@ -1,132 +1,132 @@ - -/* - * 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. - */ -// @ts-nocheck -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" -import abilityFeatureAbility from '@ohos.ability.featureAbility'; -import bundleManager from '@ohos.bundle'; -import appManager from "@ohos.application.appManager" - -describe('AbilityDisableTests', function () { - console.log("AbilityDisableTests --- start"); - - /* - * @tc.number SUB_AA_OpenHarmony_EqueryAbilityByWant_0100 - * @tc.name Call queryAbilityByWant to get moduleName - * @tc.desc Function test - * @tc.level 0 - */ - it("SUB_AA_OpenHarmony_EqueryAbilityByWant_0100", 0, async function (done) { - console.info("------------------logMessage SUB_AA_OpenHarmony_EqueryAbilityByWant_0100-------------------"); - var context = abilityFeatureAbility.getContext(); - console.log("+++++++++++++",context); - let bundleFlags=bundleManager.BundleFlag.GET_ABILITY_INFO_WITH_PERMISSION; - let userId=100; - let want={ - bundleName:"com.example.abilitydisable", - abilityName:"com.example.abilitydisable.MainAbility" - }; - bundleManager.queryAbilityByWant(want,bundleFlags,userId,(err, data) => { - console.log('SUB_AA_OpenHarmony_Clear_0100 queryAbilityByWant errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - for(var i=0;i { - console.log('SUB_AA_OpenHarmony_EqueryAbilityByWant_0200 queryAbilityByWant errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - for(var i=0;i { - console.log('SUB_AA_OpenHarmony_EqueryAbilityByWant_0300 getapplicationInfo errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(data['name']).assertEqual("com.example.abilitydisable"); - }) - done(); - }); - - /* - * @tc.number SUB_AA_OpenHarmony_EqueryAbilityByWant_0300 - * @tc.name Call AbilityStateData to get abilityType - * @tc.desc Function test - * @tc.level 0 - */ - it("SUB_AA_OpenHarmony_EqueryAbilityByWant_0400", 0, async function (done) { - console.log("------------start SUB_AA_OpenHarmony_EqueryAbilityByWant_0400-------------"); - var registerId = appManager.registerApplicationStateObserver({ - onForegroundApplicationChanged: (data) => { - console.log("SUB_onForegroundApplicationChanged") - }, - onAbilityStateChanged: (data) => { - console.log("SUB_onAbilityStateChanged") - }, - onProcessCreated: (data) => { - console.log("SUB_onProcessCreated") - }, - onProcessDied: (data) => { - console.log("SUB_onProcessDied") - } - }) - console.log('SUB_AA_OpenHarmony_EqueryAbilityByWant_0400 registerId : ' + JSON.stringify(registerId)); - console.log('SUB_AA_OpenHarmony_EqueryAbilityByWant_0400 registerId : ' + typeof registerId); - expect(typeof(registerId) == "number").assertTrue(); - - await appManager.unregisterApplicationStateObserver(parseInt(registerId), async(err, data) => { - console.log("SUB_AA_OpenHarmony_StateListener_0200 err1:" - + JSON.stringify(err) + ",data: " + JSON.stringify(data)); - expect(err["code"] == "1").assertTrue(); - }) - done(); - }) - - + +/* + * 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. + */ +// @ts-nocheck +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" +import abilityFeatureAbility from '@ohos.ability.featureAbility'; +import bundleManager from '@ohos.bundle'; +import appManager from "@ohos.application.appManager" + +describe('AbilityDisableTests', function () { + console.log("AbilityDisableTests --- start"); + + /* + * @tc.number SUB_AA_OpenHarmony_EqueryAbilityByWant_0100 + * @tc.name Call queryAbilityByWant to get moduleName + * @tc.desc Function test + * @tc.level 0 + */ + it("SUB_AA_OpenHarmony_EqueryAbilityByWant_0100", 0, async function (done) { + console.info("------------------logMessage SUB_AA_OpenHarmony_EqueryAbilityByWant_0100-------------------"); + var context = abilityFeatureAbility.getContext(); + console.log("+++++++++++++",context); + let bundleFlags=bundleManager.BundleFlag.GET_ABILITY_INFO_WITH_PERMISSION; + let userId=100; + let want={ + bundleName:"com.example.abilitydisable", + abilityName:"com.example.abilitydisable.MainAbility" + }; + bundleManager.queryAbilityByWant(want,bundleFlags,userId,(err, data) => { + console.log('SUB_AA_OpenHarmony_Clear_0100 queryAbilityByWant errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + for(var i=0;i { + console.log('SUB_AA_OpenHarmony_EqueryAbilityByWant_0200 queryAbilityByWant errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + for(var i=0;i { + console.log('SUB_AA_OpenHarmony_EqueryAbilityByWant_0300 getapplicationInfo errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data['name']).assertEqual("com.example.abilitydisable"); + }) + done(); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_EqueryAbilityByWant_0300 + * @tc.name Call AbilityStateData to get abilityType + * @tc.desc Function test + * @tc.level 0 + */ + it("SUB_AA_OpenHarmony_EqueryAbilityByWant_0400", 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_EqueryAbilityByWant_0400-------------"); + var registerId = appManager.registerApplicationStateObserver({ + onForegroundApplicationChanged: (data) => { + console.log("SUB_onForegroundApplicationChanged") + }, + onAbilityStateChanged: (data) => { + console.log("SUB_onAbilityStateChanged") + }, + onProcessCreated: (data) => { + console.log("SUB_onProcessCreated") + }, + onProcessDied: (data) => { + console.log("SUB_onProcessDied") + } + }) + console.log('SUB_AA_OpenHarmony_EqueryAbilityByWant_0400 registerId : ' + JSON.stringify(registerId)); + console.log('SUB_AA_OpenHarmony_EqueryAbilityByWant_0400 registerId : ' + typeof registerId); + expect(typeof(registerId) == "number").assertTrue(); + + await appManager.unregisterApplicationStateObserver(parseInt(registerId), async(err, data) => { + console.log("SUB_AA_OpenHarmony_StateListener_0200 err1:" + + JSON.stringify(err) + ",data: " + JSON.stringify(data)); + expect(err["code"] == "1").assertTrue(); + }) + done(); + }) + + }) \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/test/List.test.js old mode 100644 new mode 100755 index d12ff02b8..2a2007331 --- a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/test/List.test.js +++ b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -require('./AbilityDisableTest.js'); +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +require('./AbilityDisableTest.js'); diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/resources/base/element/string.json old mode 100644 new mode 100755 index 1d2808e5c..2e8b3cf8a --- a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/resources/base/element/string.json +++ b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/resources/base/element/string.json @@ -1,40 +1,40 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "description_mainability", - "value": "JS_Empty Ability" - }, - { - "name": "description_mainability2", - "value": "JS_Empty Ability" - }, - { - "name": "entry_MainAbility2", - "value": "entry_MainAbility2" - }, - { - "name": "description_mainability3", - "value": "JS_Empty Ability" - }, - { - "name": "entry_MainAbility3", - "value": "entry_MainAbility3" - }, - { - "name": "description_mainability4", - "value": "JS_Empty Ability" - }, - { - "name": "entry_MainAbility4", - "value": "entry_MainAbility4" - }, - { - "name": "description_serviceability", - "value": "hap sample empty service" - } - ] +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "JS_Empty Ability" + }, + { + "name": "description_mainability2", + "value": "JS_Empty Ability" + }, + { + "name": "entry_MainAbility2", + "value": "entry_MainAbility2" + }, + { + "name": "description_mainability3", + "value": "JS_Empty Ability" + }, + { + "name": "entry_MainAbility3", + "value": "entry_MainAbility3" + }, + { + "name": "description_mainability4", + "value": "JS_Empty Ability" + }, + { + "name": "entry_MainAbility4", + "value": "entry_MainAbility4" + }, + { + "name": "description_serviceability", + "value": "hap sample empty service" + } + ] } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/resources/base/media/icon.png b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/entry/src/main/resources/base/media/icon.png old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/fa/fa_equeryabilitybywant_test/signature/openharmony_sx.p7b old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_lock_test/BUILD.gn b/aafwk/aafwk_standard/fa/fa_lock_test/BUILD.gn old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_lock_test/Test.json b/aafwk/aafwk_standard/fa/fa_lock_test/Test.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_lock_test/entry/.gitignore b/aafwk/aafwk_standard/fa/fa_lock_test/entry/.gitignore index 7d5b7a94f..f77260b15 100644 --- a/aafwk/aafwk_standard/fa/fa_lock_test/entry/.gitignore +++ b/aafwk/aafwk_standard/fa/fa_lock_test/entry/.gitignore @@ -1,2 +1,2 @@ -/build -/node_modules +/build +/node_modules diff --git a/aafwk/aafwk_standard/fa/fa_lock_test/entry/build.gradle b/aafwk/aafwk_standard/fa/fa_lock_test/entry/build.gradle index 05a33cd3a..f104aa556 100644 --- a/aafwk/aafwk_standard/fa/fa_lock_test/entry/build.gradle +++ b/aafwk/aafwk_standard/fa/fa_lock_test/entry/build.gradle @@ -1,21 +1,21 @@ -apply plugin: 'com.huawei.ohos.hap' -//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 -ohos { - compileSdkVersion 8 - defaultConfig { - compatibleSdkVersion 8 - } - buildTypes { - release { - proguardOpt { - proguardEnabled false - rulesFiles 'proguard-rules.pro' - } - } - } -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) - testImplementation 'junit:junit:4.13.1' -} +apply plugin: 'com.huawei.ohos.hap' +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 +ohos { + compileSdkVersion 8 + defaultConfig { + compatibleSdkVersion 8 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) + testImplementation 'junit:junit:4.13.1' +} diff --git a/aafwk/aafwk_standard/fa/fa_lock_test/entry/package.json b/aafwk/aafwk_standard/fa/fa_lock_test/entry/package.json index 0967ef424..69a88e3b6 100644 --- a/aafwk/aafwk_standard/fa/fa_lock_test/entry/package.json +++ b/aafwk/aafwk_standard/fa/fa_lock_test/entry/package.json @@ -1 +1 @@ -{} +{} diff --git a/aafwk/aafwk_standard/fa/fa_lock_test/entry/src/main/config.json b/aafwk/aafwk_standard/fa/fa_lock_test/entry/src/main/config.json index fc80d6060..392328079 100644 --- a/aafwk/aafwk_standard/fa/fa_lock_test/entry/src/main/config.json +++ b/aafwk/aafwk_standard/fa/fa_lock_test/entry/src/main/config.json @@ -1,185 +1,185 @@ -{ - "app": { - "bundleName": "com.example.lock", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.lock", - "name": ".MyApplication", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_mainability", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "orientation": "unspecified", - "srcPath": "Ability2", - "name": ".Ability2", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_ability2", - "formsEnabled": false, - "label": "$string:entry_Ability2", - "type": "page", - "launchType": "standard" - }, - { - "orientation": "unspecified", - "srcPath": "Ability1", - "name": ".Ability1", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_ability1", - "formsEnabled": false, - "label": "$string:entry_Ability1", - "type": "page", - "launchType": "standard" - }, - { - "orientation": "unspecified", - "srcPath": "Ability3", - "name": ".Ability3", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_ability3", - "formsEnabled": false, - "label": "$string:entry_Ability3", - "type": "page", - "launchType": "standard" - }, - { - "orientation": "unspecified", - "srcPath": "Ability4", - "name": ".Ability4", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_ability4", - "formsEnabled": false, - "label": "$string:entry_Ability4", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".Ability2", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".Ability1", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".Ability3", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".Ability4", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.GET_BUNDLE_INFO", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.MANAGE_MISSIONS" - }, - { - "name": "ohos.permission.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name": "ohos.permission.REMOVE_CACHE_FILES", - "reason": "need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" - } - ] - } +{ + "app": { + "bundleName": "com.example.lock", + "vendor": "example", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.lock", + "name": ".MyApplication", + "mainAbility": ".MainAbility", + "srcPath": "", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "srcPath": "Ability2", + "name": ".Ability2", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_ability2", + "formsEnabled": false, + "label": "$string:entry_Ability2", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "srcPath": "Ability1", + "name": ".Ability1", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_ability1", + "formsEnabled": false, + "label": "$string:entry_Ability1", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "srcPath": "Ability3", + "name": ".Ability3", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_ability3", + "formsEnabled": false, + "label": "$string:entry_Ability3", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "srcPath": "Ability4", + "name": ".Ability4", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_ability4", + "formsEnabled": false, + "label": "$string:entry_Ability4", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".Ability2", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".Ability1", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".Ability3", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".Ability4", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.GET_BUNDLE_INFO", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.MANAGE_MISSIONS" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name": "ohos.permission.REMOVE_CACHE_FILES", + "reason": "need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" + } + ] + } } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_lock_test/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/fa/fa_lock_test/entry/src/main/js/test/List.test.js index 6e84dfb51..499f41fea 100644 --- a/aafwk/aafwk_standard/fa/fa_lock_test/entry/src/main/js/test/List.test.js +++ b/aafwk/aafwk_standard/fa/fa_lock_test/entry/src/main/js/test/List.test.js @@ -1,18 +1,18 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -//require('./Lock0200Test.js'); -require('./LockNew.js'); +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +//require('./Lock0200Test.js'); +require('./LockNew.js'); require('./LockMission.test.js'); \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_lock_test/entry/src/main/js/test/LockMission.test.js b/aafwk/aafwk_standard/fa/fa_lock_test/entry/src/main/js/test/LockMission.test.js index ffba776be..0a3a273e7 100644 --- a/aafwk/aafwk_standard/fa/fa_lock_test/entry/src/main/js/test/LockMission.test.js +++ b/aafwk/aafwk_standard/fa/fa_lock_test/entry/src/main/js/test/LockMission.test.js @@ -1,269 +1,269 @@ -/* - * Copyright (c) 2022 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' -import missionManager from "@ohos.application.missionManager"; - -describe('missionManager', function () { - console.info("----------------logMessage SUB_AA_OpenHarmony_Lock-------------------"); - - /* - * @tc.number SUB_AA_OpenHarmony_Lock_1500 - * @tc.name Locking function abnormal parameter_-1 - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_Lock_1500', 0, async function (done) { - console.info("-------------logMessage SUB_AA_OpenHarmony_Lock_1500---------") - missionManager.lockMission(-1, (err, data) => { - console.log('SUB_AA_OpenHarmony_Lock_1500 AsyncCallback errCode : ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code != 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_Lock_1800 - * @tc.name Lock function abnormal parameter _number decimal 0.2 - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_Lock_1800', 0, async function (done) { - console.log("------------start SUB_AA_OpenHarmony_Lock_1800-------------"); - var missionId = 0.2; - setTimeout(() => { - missionManager.lockMission(missionId).then((data) => { - console.log("SUB_AA_OpenHarmony_Lock_1800 lockMission data: " + - JSON.stringify(data)); - }).catch((error) => { - console.log("SUB_AA_OpenHarmony_Lock_1800 lockMission error: " + - JSON.stringify(error)); - expect(error.code != 0).assertTrue(); - done(); - }) - }, 1000) - console.log("------------end SUB_AA_OpenHarmony_Lock_1800-------------"); - }) - - /* - * @tc.number SUB_AA_OpenHarmony_Lock_1900 - * @tc.name Lock function abnormal parameter _number decimal 1.2 - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_Lock_1900', 0, async function (done) { - console.info("------------------logMessage SUB_AA_OpenHarmony_Lock_1900-------------------") - missionManager.lockMission(1.2, (err, data) => { - console.log('SUB_AA_OpenHarmony_Lock_1900 AsyncCallback errCode : ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(data == undefined).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_Lock_1700 - * @tc.name Lock function exception parameter _string type is not a number - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_Lock_1700', 0, async function (done) { - console.info("------------logMessage SUB_AA_OpenHarmony_Lock_1700-----------") - missionManager.lockMission("A", (err, data) => { - console.log('SUB_AA_OpenHarmony_Lock_1700 AsyncCallback errCode : ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code != 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_Lock_1600 - * @tc.name Lock function exception parameter _string type number - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_Lock_1600', 0, async function (done) { - console.info("---------------logMessage SUB_AA_OpenHarmony_Lock_1600------------") - missionManager.lockMission("12", (err, data) => { - console.log('SUB_AA_OpenHarmony_Lock_1600 AsyncCallback errCode : ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code != 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_Lock_1400 - * @tc.name Lock function exception parameter _undefined - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_Lock_1400', 0, async function (done) { - console.info("---------------logMessage SUB_AA_OpenHarmony_Lock_1400-------------") - missionManager.lockMission(undefined, (err, data) => { - console.log('SUB_AA_OpenHarmony_Lock_1400 AsyncCallback errCode : ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code != 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_Lock_2200 - * @tc.name Unlock function abnormal parameter_-1 - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_Lock_2200', 0, async function (done) { - console.info("------------------logMessage SUB_AA_OpenHarmony_Lock_2200-------------") - missionManager.unlockMission(-1, (err, data) => { - console.log('SUB_AA_OpenHarmony_Lock_2200 AsyncCallback errCode : ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code != 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_Lock_2500 - * @tc.name Unlock function abnormal parameter _number decimal 0.2 - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_Lock_2500', 0, async function (done) { - console.info("------------------logMessage SUB_AA_OpenHarmony_Lock_2500--------------") - missionManager.unlockMission(0.2, (err, data) => { - console.log('SUB_AA_OpenHarmony_Lock_2500 AsyncCallback errCode : ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code != 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_Lock_2400 - * @tc.name Unlock function exception parameter _string type non-numeric - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_Lock_2400', 0, async function (done) { - console.info("------------------logMessage SUB_AA_OpenHarmony_Lock_2400-----------") - missionManager.unlockMission("a", (err, data) => { - console.log('SUB_AA_OpenHarmony_Lock_2400 AsyncCallback errCode : ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code != 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_Lock_2300 - * @tc.name Unlock function exception parameter _string type number - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_Lock_2300', 0, async function (done) { - console.info("------------------logMessage SUB_AA_OpenHarmony_Lock_2300--------------") - missionManager.unlockMission("123", (err, data) => { - console.log('SUB_AA_OpenHarmony_Lock_2300 AsyncCallback errCode : ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code != 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_Lock_2100 - * @tc.name Unlock function exception parameter _undefined - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_Lock_2100', 0, async function (done) { - console.info("------------------logMessage SUB_AA_OpenHarmony_Lock_2100--------------") - missionManager.unlockMission(undefined, (err, data) => { - console.log('SUB_AA_OpenHarmony_Lock_2100 AsyncCallback errCode : ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code != 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_Lock_2600 - * @tc.name Unlock function abnormal parameter _number decimal 1.2 - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_Lock_2600', 0, async function (done) { - console.log("------------SUB_AA_OpenHarmony_Lock_2600-------------"); - var missionId = 1.2; - setTimeout(() => { - missionManager.unlockMission(missionId).then((data) => { - console.log("SUB_AA_OpenHarmony_Lock_2600 unlockMission data: " + - JSON.stringify(data)); - - }).catch((error) => { - console.log("SUB_AA_OpenHarmony_Lock_2600 unlockMission error: " + - JSON.stringify(error)); - expect(error.code != 0).assertTrue(); - done(); - }) - }, 1000) - console.log("------------end SUB_AA_OpenHarmony_Lock_2600-------------"); - }) - - /* - * @tc.number SUB_AA_OpenHarmony_Lock_2000 - * @tc.name Repeat lock - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_Lock_2000',0,async function (done){ - console.log("------------start SUB_AA_OpenHarmony_Lock_2000-------------"); - for(var i=0;i<2;i++){ - missionManager.lockMission(1.2, (error, data) => { - console.log("SUB_AA_OpenHarmony_Lock_0900, twosgetMissionInfos:" + - JSON.stringify(error) + ", " + JSON.stringify(data)); - expect(data == undefined).assertTrue(); - }) - } - done(); - }) - - /* - * @tc.number SUB_AA_OpenHarmony_Lock_2700 - * @tc.name Repeat unlock - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_Lock_2700',0,async function (done){ - var missionId = 1.2 - console.log("------------start SUB_AA_OpenHarmony_Lock_2700-------------"); - missionManager.lockMission(missionId, (error, data) => { - console.log("lockMission info" + JSON.stringify(data)); - }) - missionManager.unlockMission(missionId,(error, data) => { - for(var i=0;i<2;i++){ - missionManager.unlockMission(missionId,(error, data1) => { - console.log("unlockMission info" + JSON.stringify(data1)); - expect(data1 == undefined); - }) - } - }) - done(); - }) -}) +/* + * Copyright (c) 2022 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' +import missionManager from "@ohos.application.missionManager"; + +describe('missionManager', function () { + console.info("----------------logMessage SUB_AA_OpenHarmony_Lock-------------------"); + + /* + * @tc.number SUB_AA_OpenHarmony_Lock_1500 + * @tc.name Locking function abnormal parameter_-1 + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_Lock_1500', 0, async function (done) { + console.info("-------------logMessage SUB_AA_OpenHarmony_Lock_1500---------") + missionManager.lockMission(-1, (err, data) => { + console.log('SUB_AA_OpenHarmony_Lock_1500 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code != 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_Lock_1800 + * @tc.name Lock function abnormal parameter _number decimal 0.2 + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_Lock_1800', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_Lock_1800-------------"); + var missionId = 0.2; + setTimeout(() => { + missionManager.lockMission(missionId).then((data) => { + console.log("SUB_AA_OpenHarmony_Lock_1800 lockMission data: " + + JSON.stringify(data)); + }).catch((error) => { + console.log("SUB_AA_OpenHarmony_Lock_1800 lockMission error: " + + JSON.stringify(error)); + expect(error.code != 0).assertTrue(); + done(); + }) + }, 1000) + console.log("------------end SUB_AA_OpenHarmony_Lock_1800-------------"); + }) + + /* + * @tc.number SUB_AA_OpenHarmony_Lock_1900 + * @tc.name Lock function abnormal parameter _number decimal 1.2 + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_Lock_1900', 0, async function (done) { + console.info("------------------logMessage SUB_AA_OpenHarmony_Lock_1900-------------------") + missionManager.lockMission(1.2, (err, data) => { + console.log('SUB_AA_OpenHarmony_Lock_1900 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data == undefined).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_Lock_1700 + * @tc.name Lock function exception parameter _string type is not a number + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_Lock_1700', 0, async function (done) { + console.info("------------logMessage SUB_AA_OpenHarmony_Lock_1700-----------") + missionManager.lockMission("A", (err, data) => { + console.log('SUB_AA_OpenHarmony_Lock_1700 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code != 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_Lock_1600 + * @tc.name Lock function exception parameter _string type number + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_Lock_1600', 0, async function (done) { + console.info("---------------logMessage SUB_AA_OpenHarmony_Lock_1600------------") + missionManager.lockMission("12", (err, data) => { + console.log('SUB_AA_OpenHarmony_Lock_1600 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code != 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_Lock_1400 + * @tc.name Lock function exception parameter _undefined + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_Lock_1400', 0, async function (done) { + console.info("---------------logMessage SUB_AA_OpenHarmony_Lock_1400-------------") + missionManager.lockMission(undefined, (err, data) => { + console.log('SUB_AA_OpenHarmony_Lock_1400 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code != 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_Lock_2200 + * @tc.name Unlock function abnormal parameter_-1 + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_Lock_2200', 0, async function (done) { + console.info("------------------logMessage SUB_AA_OpenHarmony_Lock_2200-------------") + missionManager.unlockMission(-1, (err, data) => { + console.log('SUB_AA_OpenHarmony_Lock_2200 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code != 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_Lock_2500 + * @tc.name Unlock function abnormal parameter _number decimal 0.2 + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_Lock_2500', 0, async function (done) { + console.info("------------------logMessage SUB_AA_OpenHarmony_Lock_2500--------------") + missionManager.unlockMission(0.2, (err, data) => { + console.log('SUB_AA_OpenHarmony_Lock_2500 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code != 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_Lock_2400 + * @tc.name Unlock function exception parameter _string type non-numeric + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_Lock_2400', 0, async function (done) { + console.info("------------------logMessage SUB_AA_OpenHarmony_Lock_2400-----------") + missionManager.unlockMission("a", (err, data) => { + console.log('SUB_AA_OpenHarmony_Lock_2400 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code != 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_Lock_2300 + * @tc.name Unlock function exception parameter _string type number + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_Lock_2300', 0, async function (done) { + console.info("------------------logMessage SUB_AA_OpenHarmony_Lock_2300--------------") + missionManager.unlockMission("123", (err, data) => { + console.log('SUB_AA_OpenHarmony_Lock_2300 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code != 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_Lock_2100 + * @tc.name Unlock function exception parameter _undefined + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_Lock_2100', 0, async function (done) { + console.info("------------------logMessage SUB_AA_OpenHarmony_Lock_2100--------------") + missionManager.unlockMission(undefined, (err, data) => { + console.log('SUB_AA_OpenHarmony_Lock_2100 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code != 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_Lock_2600 + * @tc.name Unlock function abnormal parameter _number decimal 1.2 + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_Lock_2600', 0, async function (done) { + console.log("------------SUB_AA_OpenHarmony_Lock_2600-------------"); + var missionId = 1.2; + setTimeout(() => { + missionManager.unlockMission(missionId).then((data) => { + console.log("SUB_AA_OpenHarmony_Lock_2600 unlockMission data: " + + JSON.stringify(data)); + + }).catch((error) => { + console.log("SUB_AA_OpenHarmony_Lock_2600 unlockMission error: " + + JSON.stringify(error)); + expect(error.code != 0).assertTrue(); + done(); + }) + }, 1000) + console.log("------------end SUB_AA_OpenHarmony_Lock_2600-------------"); + }) + + /* + * @tc.number SUB_AA_OpenHarmony_Lock_2000 + * @tc.name Repeat lock + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_Lock_2000',0,async function (done){ + console.log("------------start SUB_AA_OpenHarmony_Lock_2000-------------"); + for(var i=0;i<2;i++){ + missionManager.lockMission(1.2, (error, data) => { + console.log("SUB_AA_OpenHarmony_Lock_0900, twosgetMissionInfos:" + + JSON.stringify(error) + ", " + JSON.stringify(data)); + expect(data == undefined).assertTrue(); + }) + } + done(); + }) + + /* + * @tc.number SUB_AA_OpenHarmony_Lock_2700 + * @tc.name Repeat unlock + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_Lock_2700',0,async function (done){ + var missionId = 1.2 + console.log("------------start SUB_AA_OpenHarmony_Lock_2700-------------"); + missionManager.lockMission(missionId, (error, data) => { + console.log("lockMission info" + JSON.stringify(data)); + }) + missionManager.unlockMission(missionId,(error, data) => { + for(var i=0;i<2;i++){ + missionManager.unlockMission(missionId,(error, data1) => { + console.log("unlockMission info" + JSON.stringify(data1)); + expect(data1 == undefined); + }) + } + }) + done(); + }) +}) diff --git a/aafwk/aafwk_standard/fa/fa_lock_test/entry/src/main/js/test/LockNew.js b/aafwk/aafwk_standard/fa/fa_lock_test/entry/src/main/js/test/LockNew.js index 731f2f336..8b7014a63 100644 --- a/aafwk/aafwk_standard/fa/fa_lock_test/entry/src/main/js/test/LockNew.js +++ b/aafwk/aafwk_standard/fa/fa_lock_test/entry/src/main/js/test/LockNew.js @@ -1,376 +1,376 @@ -/* - * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index"; -import missionManager from '@ohos.application.missionManager'; -import abilityFeatureAbility from '@ohos.ability.featureAbility'; -import commonEvent from '@ohos.commonEvent'; - -var START_ABILITY_TIMEOUT = 5000; - -describe('LockTest', function () { - console.log("LockTest --- start"); - var missionArray = []; - function sleep(numberMillis) { - var now = new Date(); - var exitTime = now.getTime() + numberMillis; - while (true) { - now = new Date(); - if (now.getTime() > exitTime) - return; - } - } - - /** - * @tc.number: SUB_AA_OpenHarmony_Lock_0400 - * @tc.name: wantConstant : Check specific enum - * @tc.desc: Check the return type of the interface (by Promise) - */ - it('SUB_AA_OpenHarmony_Lock_0700', 0, async function (done) { - console.info('=======SUB_AA_OpenHarmony_Lock_0700 step1 start=====startActivity====='); - abilityFeatureAbility.startAbility({ want: { - bundleName: "com.example.lock", - abilityName: "com.example.lock.Ability1" - } }) - .then((data) => { - console.info('SUB_AA_OpenHarmony_Lock_0300 startAbility1: ' + - JSON.stringify(data)); - console.info('SUB_AA_OpenHarmony_Lock_0300 - startAbility2 start: ') - abilityFeatureAbility.startAbility({ "want": { - bundleName: "com.example.lock", - abilityName: "com.example.lock.Ability2" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_Lock_0300 - startAbility2: ' + - JSON.stringify(error) + ", " + JSON.stringify(data)) - console.info('SUB_AA_OpenHarmony_Lock_0300 - startAbility3 start'); - abilityFeatureAbility.startAbility({ "want": { - bundleName: "com.example.lock", - abilityName: "com.example.lock.Ability3" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_Lock_0300 - startAbility3: ' + - JSON.stringify(error) + ", " + JSON.stringify(data)) - console.info('SUB_AA_OpenHarmony_Lock_0300 - startAbility4 start'); - abilityFeatureAbility.startAbility({ "want": { - bundleName: "com.example.lock", - abilityName: "com.example.lock.Ability4" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_Lock_0300 - startAbility4: ' + - JSON.stringify(error) + ", " + JSON.stringify(data)) - getMissionInfosOne(); - }); - }); - }); - }).catch((error) => { - console.error('SUB_AA_OpenHarmony_Lock_0700 startAbility1 error ' + - JSON.stringify(error)); - }) - setTimeout(() => { - done(); - }, 5000); - }) - - function getMissionInfosOne() { - console.log('=======SUB_AA_OpenHarmony_Lock_0700 step2 start==========getMissionInfos====='); - missionArray = []; - missionManager.getMissionInfos('', 500, (err, data) => { - console.log('SUB_AA_OpenHarmony_Lock_0700 getMissionInfo err: ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code == 0).assertTrue(); - var i; - for (i = 0; i < data.length; i++) { - console.log("getMissionInfos return1 " + JSON.stringify(data[i])); - if (data[i].want.abilityName == 'com.example.lock.Ability1' && - data[i].runningState == 0) { - missionArray[0] = new Object(); - missionArray[0].id = data[i].missionId; - missionArray[0].name = data[i].want.abilityName; - } - if (data[i].want.abilityName == 'com.example.lock.Ability2' && - data[i].runningState == 0) { - missionArray[1] = new Object(); - missionArray[1].id = data[i].missionId; - missionArray[1].name = data[i].want.abilityName; - } - if (data[i].want.abilityName == 'com.example.lock.Ability3' && - data[i].runningState == 0) { - missionArray[2] = new Object(); - missionArray[2].id = data[i].missionId; - missionArray[2].name = data[i].want.abilityName; - } - if (data[i].want.abilityName == 'com.example.lock.Ability4' && - data[i].runningState == 0) { - missionArray[3] = new Object(); - missionArray[3].id = data[i].missionId; - missionArray[3].name = data[i].want.abilityName; - } - if (data[i].want.abilityName == 'com.example.lock.MainAbility' && - data[i].runningState == 0) { - missionArray[4] = new Object(); - missionArray[4].id = data[i].missionId; - missionArray[4].name = data[i].want.abilityName; - } - } - console.log("###" + JSON.stringify(missionArray)); - expect(missionArray.length == 5).assertTrue(); - lockMissionMy(); - }) - } - - function lockMissionMy() { - console.log('===============SUB_AA_OpenHarmony_Lock_0700 step3 start=====lockMission======'); - console.log('SUB_AA_OpenHarmony_Lock_0700 missionArray' + JSON.stringify(missionArray)); - var i; - var j = 0; - for (i = 0; i < missionArray.length; i++) { - if (missionArray[i].name == 'com.example.lock.Ability1' || missionArray[i].name == - 'com.example.lock.Ability4'|| missionArray[i].name == 'com.example.lock.MainAbility') { - console.log('SUB_AA_OpenHarmony_Lock_0700 j===' + j); - console.log('SUB_AA_OpenHarmony_Lock_0700 ' + JSON.stringify(missionArray[i].id)); - missionManager.lockMission(missionArray[i].id, (err, data) => { - console.log('SUB_AA_OpenHarmony_Lock_0700 lockMission err:' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(data == undefined).assertTrue(); - j++; - if (j == 3) { - getMissionInfosTest(); - //clearAllMission(); - } - }) - } - } - } - - function unlockMissionTest() { - console.log('===============SUB_AA_OpenHarmony_Lock_0700 step6 start=====unLockMission======'); - console.log("unlockMissionMy start " + JSON.stringify(missionArray)); - missionManager.unlockMission(missionArray[1].id, (err, data) => { - console.log('SUB_AA_OpenHarmony_Lock_0700 unlockMission err:' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(data == undefined).assertTrue(); - }); - } - - function getMissionInfosTest(){ - console.log('==========SUB_AA_OpenHarmony_Lock_0700 step5 start=====getMissionInfosTest======'); - missionArray = [] - missionManager.getMissionInfos('', 500, (err, data) => { - console.log('getMissionInfosTwo getMissionInfos4 err: ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code == 0).assertTrue(); - var i; - for (i = 0; i < data.length; i++) { - console.log("getMissionInfos return1 " + JSON.stringify(data[i])); - if (data[i].want.abilityName == 'com.example.lock.Ability1' && - data[i].runningState == 0) { - expect(data[i].lockedState == true).assertTrue(); - expect(data[i].timestamp != 0).assertTrue(); - expect(data[i].label).assertEquals("$string:entry_MainAbility"); - missionArray[0] = new Object(); - missionArray[0].id = data[i].missionId; - missionArray[0].name = data[i].want.abilityName; - } - if (data[i].want.abilityName == 'com.example.lock.Ability4' && - data[i].runningState == 0) { - expect(data[i].lockedState == true).assertTrue(); - expect(data[i].timestamp != 0).assertTrue(); - expect(data[i].label).assertEquals("$string:entry_MainAbility"); - missionArray[1] = new Object(); - missionArray[1].id = data[i].missionId; - missionArray[1].name = data[i].want.abilityName; - } - } - console.log("###" + JSON.stringify(missionArray)); - console.log("###" + JSON.stringify(missionArray.length)); - expect(missionArray.length == 2).assertTrue(); - unlockMissionTest(); - }) - } - - function clearAllMission(done) { - console.log('==========SUB_AA_OpenHarmony_Lock_0700 step4 start=====clearAllMissions======'); - missionManager.clearAllMissions((err, data) => { - console.log('getMissionInfosTwo clearAllMission err: ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - getMissionInfosTwo(); - }); - } - - function getMissionInfosTwo(done) { - console.log('==========SUB_AA_OpenHarmony_Lock_0700 step5 start=====getMissionInfos======'); - missionArray = [] - missionManager.getMissionInfos('', 500, (err, data) => { - console.log('getMissionInfosTwo getMissionInfo err: ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code == 0).assertTrue(); - var i; - for (i = 0; i < data.length; i++) { - console.log("getMissionInfos return1 " + JSON.stringify(data[i])); - if (data[i].want.abilityName == 'com.example.lock.Ability1' && - data[i].runningState == 0) { - expect(data[i].lockedState == true).assertTrue(); - missionArray[0] = new Object(); - missionArray[0].id = data[i].missionId; - missionArray[0].name = data[i].want.abilityName; - } - if (data[i].want.abilityName == 'com.example.lock.Ability2') { - expect().assertFail(); - } - if (data[i].want.abilityName == 'com.example.lock.Ability3' && - data[i].runningState == 0) { - expect().assertFail(); - } - if (data[i].want.abilityName == 'com.example.lock.Ability4' && - data[i].runningState == 0) { - expect(data[i].lockedState == true).assertTrue(); - missionArray[1] = new Object(); - missionArray[1].id = data[i].missionId; - missionArray[1].name = data[i].want.abilityName; - } - } - console.log("###" + JSON.stringify(missionArray)); - console.log("###" + JSON.stringify(missionArray.length)); - done(); - expect(missionArray.length == 2).assertTrue(); - //unlockMissionMy(); - }) - } - - function unlockMissionMy() { - console.log('===========SUB_AA_OpenHarmony_Lock_0700 step6 start=====unLockMission======'); - console.log("unlockMissionMy start " + JSON.stringify(missionArray)); - missionManager.unlockMission(missionArray[1].id, (err, data) => { - console.log('SUB_AA_OpenHarmony_Lock_0700 unlockMission err:' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(data == undefined).assertTrue(); - clearAllMission2(); - }); - } - - function clearAllMission2(done) { - console.log('===========SUB_AA_OpenHarmony_Lock_0700 step7 start=====clearAllMissions======'); - var myEvents = { - events: - [ - "Ability1_onShow", - "Ability4_onDestroy" - ] - }; - var Subscriber; - let id; - var data = []; - - function SubscribeCallBack(err, data) { - console.debug("beforeAll====>Subscribe CallBack data:====>" + JSON.stringify(data)); - switch (data.event) { - case "Ability1_onShow": - console.log("Ability1_onShow"); - data[0] = "Ability1_onCreate"; - break; - case "Ability4_onDestroy": - console.log("Ability4_onDestroy"); - data[1] = "Ability2_onCreate"; - break; - default: - } - if (data.length == 2) { - clearTimeout(id); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - - } - }; - commonEvent.createSubscriber(myEvents).then(async (data) => { - console.debug("SUB_AA_OpenHarmony_Lock_0400====>Create Subscriber====>"); - Subscriber = data; - console.log("SUB_AA_OpenHarmony_Lock_0700 Subscriber " + JSON.stringify(Subscriber)); - await commonEvent.subscribe(Subscriber, SubscribeCallBack); - }).catch((error) => { - console.error('Operation failed. Cause: ' + JSON.stringify(error)); - done(); - }); - - function UnSubscribeCallback() { - console.debug("====>UnSubscribe CallBack====>"); - } - - function timeout() { - expect().assertFail(); - console.debug('SUB_AA_OpenHarmony_Lock_0700=====timeout======'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - done(); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - - missionManager.clearAllMissions(); - sleep(500); - getMissionInfosThree(); - } - - function getMissionInfosThree(done) { - console.log('===========SUB_AA_OpenHarmony_Lock_0700 step8 start=====getMissonInfos======'); - missionArray = []; - missionManager.getMissionInfos('', 500, (err, data) => { - console.log('getMissionInfosThree getMissionInfo err: ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code == 0).assertTrue(); - var i; - for (i = 0; i < data.length; i++) { - console.log("getMissionInfos return1 " + JSON.stringify(data[i])); - if (data[i].want.abilityName == 'com.example.lock.Ability1' && - data[i].runningState == 0) { - expect(data[i].lockedState == true).assertTrue(); - missionArray[0] = new Object(); - missionArray[0].id = data[i].missionId; - missionArray[0].name = data[i].want.abilityName; - } - if (data[i].want.abilityName == 'com.example.lock.Ability2') { - expect().assertFail(); - done(); - } - if (data[i].want.abilityName == 'com.example.lock.Ability3' && - data[i].runningState == 0) { - expect().assertFail(); - done(); - } - if (data[i].want.abilityName == 'com.example.lock.Ability4' && - data[i].runningState == 0) { - expect().assertFail(); - done(); - } - } - console.log("###" + JSON.stringify(missionArray)); - expect(missionArray.length == 1).assertTrue(); - console.log('===============SUB_AA_OpenHarmony_Lock_0700 step9 start==========='); - console.info('LockTest TearDown: ' + JSON.stringify(missionArray)); - var i; - for (i = 0; i < missionArray.length; i++) { - missionManager.unlockMission(missionArray[i].id, (err, data) => { - console.log('SUB_AA_OpenHarmony_Lock_0700 unlockMission err:' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(data == undefined).assertTrue(); - missionManager.clearAllMissions(); - if (i == missionArray.length) { - console.info('LockTest - myTearDown: done'); - missionManager.clearAllMissions(); - done(); - } - console.info('LockTest - myTearDown%%: i' + i); - console.info('LockTest - myTearDown%%: length' + missionArray.length); - }); - } - }) - } -} -) +/* + * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index"; +import missionManager from '@ohos.application.missionManager'; +import abilityFeatureAbility from '@ohos.ability.featureAbility'; +import commonEvent from '@ohos.commonEvent'; + +var START_ABILITY_TIMEOUT = 5000; + +describe('LockTest', function () { + console.log("LockTest --- start"); + var missionArray = []; + function sleep(numberMillis) { + var now = new Date(); + var exitTime = now.getTime() + numberMillis; + while (true) { + now = new Date(); + if (now.getTime() > exitTime) + return; + } + } + + /** + * @tc.number: SUB_AA_OpenHarmony_Lock_0400 + * @tc.name: wantConstant : Check specific enum + * @tc.desc: Check the return type of the interface (by Promise) + */ + it('SUB_AA_OpenHarmony_Lock_0700', 0, async function (done) { + console.info('=======SUB_AA_OpenHarmony_Lock_0700 step1 start=====startActivity====='); + abilityFeatureAbility.startAbility({ want: { + bundleName: "com.example.lock", + abilityName: "com.example.lock.Ability1" + } }) + .then((data) => { + console.info('SUB_AA_OpenHarmony_Lock_0300 startAbility1: ' + + JSON.stringify(data)); + console.info('SUB_AA_OpenHarmony_Lock_0300 - startAbility2 start: ') + abilityFeatureAbility.startAbility({ "want": { + bundleName: "com.example.lock", + abilityName: "com.example.lock.Ability2" + } }, (error, data) => { + console.log('SUB_AA_OpenHarmony_Lock_0300 - startAbility2: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + console.info('SUB_AA_OpenHarmony_Lock_0300 - startAbility3 start'); + abilityFeatureAbility.startAbility({ "want": { + bundleName: "com.example.lock", + abilityName: "com.example.lock.Ability3" + } }, (error, data) => { + console.log('SUB_AA_OpenHarmony_Lock_0300 - startAbility3: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + console.info('SUB_AA_OpenHarmony_Lock_0300 - startAbility4 start'); + abilityFeatureAbility.startAbility({ "want": { + bundleName: "com.example.lock", + abilityName: "com.example.lock.Ability4" + } }, (error, data) => { + console.log('SUB_AA_OpenHarmony_Lock_0300 - startAbility4: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + getMissionInfosOne(); + }); + }); + }); + }).catch((error) => { + console.error('SUB_AA_OpenHarmony_Lock_0700 startAbility1 error ' + + JSON.stringify(error)); + }) + setTimeout(() => { + done(); + }, 5000); + }) + + function getMissionInfosOne() { + console.log('=======SUB_AA_OpenHarmony_Lock_0700 step2 start==========getMissionInfos====='); + missionArray = []; + missionManager.getMissionInfos('', 500, (err, data) => { + console.log('SUB_AA_OpenHarmony_Lock_0700 getMissionInfo err: ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code == 0).assertTrue(); + var i; + for (i = 0; i < data.length; i++) { + console.log("getMissionInfos return1 " + JSON.stringify(data[i])); + if (data[i].want.abilityName == 'com.example.lock.Ability1' && + data[i].runningState == 0) { + missionArray[0] = new Object(); + missionArray[0].id = data[i].missionId; + missionArray[0].name = data[i].want.abilityName; + } + if (data[i].want.abilityName == 'com.example.lock.Ability2' && + data[i].runningState == 0) { + missionArray[1] = new Object(); + missionArray[1].id = data[i].missionId; + missionArray[1].name = data[i].want.abilityName; + } + if (data[i].want.abilityName == 'com.example.lock.Ability3' && + data[i].runningState == 0) { + missionArray[2] = new Object(); + missionArray[2].id = data[i].missionId; + missionArray[2].name = data[i].want.abilityName; + } + if (data[i].want.abilityName == 'com.example.lock.Ability4' && + data[i].runningState == 0) { + missionArray[3] = new Object(); + missionArray[3].id = data[i].missionId; + missionArray[3].name = data[i].want.abilityName; + } + if (data[i].want.abilityName == 'com.example.lock.MainAbility' && + data[i].runningState == 0) { + missionArray[4] = new Object(); + missionArray[4].id = data[i].missionId; + missionArray[4].name = data[i].want.abilityName; + } + } + console.log("###" + JSON.stringify(missionArray)); + expect(missionArray.length == 5).assertTrue(); + lockMissionMy(); + }) + } + + function lockMissionMy() { + console.log('===============SUB_AA_OpenHarmony_Lock_0700 step3 start=====lockMission======'); + console.log('SUB_AA_OpenHarmony_Lock_0700 missionArray' + JSON.stringify(missionArray)); + var i; + var j = 0; + for (i = 0; i < missionArray.length; i++) { + if (missionArray[i].name == 'com.example.lock.Ability1' || missionArray[i].name == + 'com.example.lock.Ability4'|| missionArray[i].name == 'com.example.lock.MainAbility') { + console.log('SUB_AA_OpenHarmony_Lock_0700 j===' + j); + console.log('SUB_AA_OpenHarmony_Lock_0700 ' + JSON.stringify(missionArray[i].id)); + missionManager.lockMission(missionArray[i].id, (err, data) => { + console.log('SUB_AA_OpenHarmony_Lock_0700 lockMission err:' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data == undefined).assertTrue(); + j++; + if (j == 3) { + getMissionInfosTest(); + //clearAllMission(); + } + }) + } + } + } + + function unlockMissionTest() { + console.log('===============SUB_AA_OpenHarmony_Lock_0700 step6 start=====unLockMission======'); + console.log("unlockMissionMy start " + JSON.stringify(missionArray)); + missionManager.unlockMission(missionArray[1].id, (err, data) => { + console.log('SUB_AA_OpenHarmony_Lock_0700 unlockMission err:' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data == undefined).assertTrue(); + }); + } + + function getMissionInfosTest(){ + console.log('==========SUB_AA_OpenHarmony_Lock_0700 step5 start=====getMissionInfosTest======'); + missionArray = [] + missionManager.getMissionInfos('', 500, (err, data) => { + console.log('getMissionInfosTwo getMissionInfos4 err: ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code == 0).assertTrue(); + var i; + for (i = 0; i < data.length; i++) { + console.log("getMissionInfos return1 " + JSON.stringify(data[i])); + if (data[i].want.abilityName == 'com.example.lock.Ability1' && + data[i].runningState == 0) { + expect(data[i].lockedState == true).assertTrue(); + expect(data[i].timestamp != 0).assertTrue(); + expect(data[i].label).assertEquals("$string:entry_MainAbility"); + missionArray[0] = new Object(); + missionArray[0].id = data[i].missionId; + missionArray[0].name = data[i].want.abilityName; + } + if (data[i].want.abilityName == 'com.example.lock.Ability4' && + data[i].runningState == 0) { + expect(data[i].lockedState == true).assertTrue(); + expect(data[i].timestamp != 0).assertTrue(); + expect(data[i].label).assertEquals("$string:entry_MainAbility"); + missionArray[1] = new Object(); + missionArray[1].id = data[i].missionId; + missionArray[1].name = data[i].want.abilityName; + } + } + console.log("###" + JSON.stringify(missionArray)); + console.log("###" + JSON.stringify(missionArray.length)); + expect(missionArray.length == 2).assertTrue(); + unlockMissionTest(); + }) + } + + function clearAllMission(done) { + console.log('==========SUB_AA_OpenHarmony_Lock_0700 step4 start=====clearAllMissions======'); + missionManager.clearAllMissions((err, data) => { + console.log('getMissionInfosTwo clearAllMission err: ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + getMissionInfosTwo(); + }); + } + + function getMissionInfosTwo(done) { + console.log('==========SUB_AA_OpenHarmony_Lock_0700 step5 start=====getMissionInfos======'); + missionArray = [] + missionManager.getMissionInfos('', 500, (err, data) => { + console.log('getMissionInfosTwo getMissionInfo err: ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code == 0).assertTrue(); + var i; + for (i = 0; i < data.length; i++) { + console.log("getMissionInfos return1 " + JSON.stringify(data[i])); + if (data[i].want.abilityName == 'com.example.lock.Ability1' && + data[i].runningState == 0) { + expect(data[i].lockedState == true).assertTrue(); + missionArray[0] = new Object(); + missionArray[0].id = data[i].missionId; + missionArray[0].name = data[i].want.abilityName; + } + if (data[i].want.abilityName == 'com.example.lock.Ability2') { + expect().assertFail(); + } + if (data[i].want.abilityName == 'com.example.lock.Ability3' && + data[i].runningState == 0) { + expect().assertFail(); + } + if (data[i].want.abilityName == 'com.example.lock.Ability4' && + data[i].runningState == 0) { + expect(data[i].lockedState == true).assertTrue(); + missionArray[1] = new Object(); + missionArray[1].id = data[i].missionId; + missionArray[1].name = data[i].want.abilityName; + } + } + console.log("###" + JSON.stringify(missionArray)); + console.log("###" + JSON.stringify(missionArray.length)); + done(); + expect(missionArray.length == 2).assertTrue(); + //unlockMissionMy(); + }) + } + + function unlockMissionMy() { + console.log('===========SUB_AA_OpenHarmony_Lock_0700 step6 start=====unLockMission======'); + console.log("unlockMissionMy start " + JSON.stringify(missionArray)); + missionManager.unlockMission(missionArray[1].id, (err, data) => { + console.log('SUB_AA_OpenHarmony_Lock_0700 unlockMission err:' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data == undefined).assertTrue(); + clearAllMission2(); + }); + } + + function clearAllMission2(done) { + console.log('===========SUB_AA_OpenHarmony_Lock_0700 step7 start=====clearAllMissions======'); + var myEvents = { + events: + [ + "Ability1_onShow", + "Ability4_onDestroy" + ] + }; + var Subscriber; + let id; + var data = []; + + function SubscribeCallBack(err, data) { + console.debug("beforeAll====>Subscribe CallBack data:====>" + JSON.stringify(data)); + switch (data.event) { + case "Ability1_onShow": + console.log("Ability1_onShow"); + data[0] = "Ability1_onCreate"; + break; + case "Ability4_onDestroy": + console.log("Ability4_onDestroy"); + data[1] = "Ability2_onCreate"; + break; + default: + } + if (data.length == 2) { + clearTimeout(id); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + + } + }; + commonEvent.createSubscriber(myEvents).then(async (data) => { + console.debug("SUB_AA_OpenHarmony_Lock_0400====>Create Subscriber====>"); + Subscriber = data; + console.log("SUB_AA_OpenHarmony_Lock_0700 Subscriber " + JSON.stringify(Subscriber)); + await commonEvent.subscribe(Subscriber, SubscribeCallBack); + }).catch((error) => { + console.error('Operation failed. Cause: ' + JSON.stringify(error)); + done(); + }); + + function UnSubscribeCallback() { + console.debug("====>UnSubscribe CallBack====>"); + } + + function timeout() { + expect().assertFail(); + console.debug('SUB_AA_OpenHarmony_Lock_0700=====timeout======'); + commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); + done(); + } + + id = setTimeout(timeout, START_ABILITY_TIMEOUT); + + missionManager.clearAllMissions(); + sleep(500); + getMissionInfosThree(); + } + + function getMissionInfosThree(done) { + console.log('===========SUB_AA_OpenHarmony_Lock_0700 step8 start=====getMissonInfos======'); + missionArray = []; + missionManager.getMissionInfos('', 500, (err, data) => { + console.log('getMissionInfosThree getMissionInfo err: ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code == 0).assertTrue(); + var i; + for (i = 0; i < data.length; i++) { + console.log("getMissionInfos return1 " + JSON.stringify(data[i])); + if (data[i].want.abilityName == 'com.example.lock.Ability1' && + data[i].runningState == 0) { + expect(data[i].lockedState == true).assertTrue(); + missionArray[0] = new Object(); + missionArray[0].id = data[i].missionId; + missionArray[0].name = data[i].want.abilityName; + } + if (data[i].want.abilityName == 'com.example.lock.Ability2') { + expect().assertFail(); + done(); + } + if (data[i].want.abilityName == 'com.example.lock.Ability3' && + data[i].runningState == 0) { + expect().assertFail(); + done(); + } + if (data[i].want.abilityName == 'com.example.lock.Ability4' && + data[i].runningState == 0) { + expect().assertFail(); + done(); + } + } + console.log("###" + JSON.stringify(missionArray)); + expect(missionArray.length == 1).assertTrue(); + console.log('===============SUB_AA_OpenHarmony_Lock_0700 step9 start==========='); + console.info('LockTest TearDown: ' + JSON.stringify(missionArray)); + var i; + for (i = 0; i < missionArray.length; i++) { + missionManager.unlockMission(missionArray[i].id, (err, data) => { + console.log('SUB_AA_OpenHarmony_Lock_0700 unlockMission err:' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(data == undefined).assertTrue(); + missionManager.clearAllMissions(); + if (i == missionArray.length) { + console.info('LockTest - myTearDown: done'); + missionManager.clearAllMissions(); + done(); + } + console.info('LockTest - myTearDown%%: i' + i); + console.info('LockTest - myTearDown%%: length' + missionArray.length); + }); + } + }) + } +} +) diff --git a/aafwk/aafwk_standard/fa/fa_lock_test/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/fa/fa_lock_test/entry/src/main/resources/base/element/string.json index 1164d3a59..03038ecbb 100644 --- a/aafwk/aafwk_standard/fa/fa_lock_test/entry/src/main/resources/base/element/string.json +++ b/aafwk/aafwk_standard/fa/fa_lock_test/entry/src/main/resources/base/element/string.json @@ -1,44 +1,44 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "description_mainability", - "value": "JS_Empty Ability" - }, - { - "name": "description_ability2", - "value": "JS_Empty Ability" - }, - { - "name": "entry_Ability2", - "value": "entry_Ability2" - }, - { - "name": "description_ability1", - "value": "JS_Empty Ability" - }, - { - "name": "entry_Ability1", - "value": "entry_Ability1" - }, - { - "name": "description_ability3", - "value": "JS_Empty Ability" - }, - { - "name": "entry_Ability3", - "value": "entry_Ability3" - }, - { - "name": "description_ability4", - "value": "JS_Empty Ability" - }, - { - "name": "entry_Ability4", - "value": "entry_Ability4" - } - ] +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "JS_Empty Ability" + }, + { + "name": "description_ability2", + "value": "JS_Empty Ability" + }, + { + "name": "entry_Ability2", + "value": "entry_Ability2" + }, + { + "name": "description_ability1", + "value": "JS_Empty Ability" + }, + { + "name": "entry_Ability1", + "value": "entry_Ability1" + }, + { + "name": "description_ability3", + "value": "JS_Empty Ability" + }, + { + "name": "entry_Ability3", + "value": "entry_Ability3" + }, + { + "name": "description_ability4", + "value": "JS_Empty Ability" + }, + { + "name": "entry_Ability4", + "value": "entry_Ability4" + } + ] } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_lock_test/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/fa/fa_lock_test/signature/openharmony_sx.p7b old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/.gitignore b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/.gitignore index 7d5b7a94f..f77260b15 100644 --- a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/.gitignore +++ b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/.gitignore @@ -1,2 +1,2 @@ -/build -/node_modules +/build +/node_modules diff --git a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/build.gradle b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/build.gradle index cef7b37de..c40c1f08c 100644 --- a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/build.gradle +++ b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/build.gradle @@ -1,21 +1,21 @@ -apply plugin: 'com.huawei.ohos.hap' -//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 -ohos { - compileSdkVersion 8 - defaultConfig { - compatibleSdkVersion 7 - } - buildTypes { - release { - proguardOpt { - proguardEnabled false - rulesFiles 'proguard-rules.pro' - } - } - } -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) - testImplementation 'junit:junit:4.13.1' -} +apply plugin: 'com.huawei.ohos.hap' +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 +ohos { + compileSdkVersion 8 + defaultConfig { + compatibleSdkVersion 7 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) + testImplementation 'junit:junit:4.13.1' +} diff --git a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/package.json b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/package.json index 0967ef424..69a88e3b6 100644 --- a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/package.json +++ b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/package.json @@ -1 +1 @@ -{} +{} diff --git a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/src/main/config.json b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/src/main/config.json index 366ab4fbf..d62097724 100644 --- a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/src/main/config.json +++ b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/src/main/config.json @@ -1,70 +1,70 @@ -{ - "app": { - "bundleName": "com.example.missionmanager", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.missionmanager", - "name": ".MyApplication", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_mainability", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ],"reqPermissions": [ - {"name":"ohos.permission.MANAGE_LOCAL_ACCOUNTS"}, - {"name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION"}, - {"name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"}, - {"name":"ohos.permission.MANAGE_MISSIONS"} - ] - - } +{ + "app": { + "bundleName": "com.example.missionmanager", + "vendor": "example", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.missionmanager", + "name": ".MyApplication", + "mainAbility": ".MainAbility", + "srcPath": "", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ],"reqPermissions": [ + {"name":"ohos.permission.MANAGE_LOCAL_ACCOUNTS"}, + {"name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION"}, + {"name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"}, + {"name":"ohos.permission.MANAGE_MISSIONS"} + ] + + } } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/src/main/js/test/List.test.js index 08f48bb00..70e9c3866 100644 --- a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/src/main/js/test/List.test.js +++ b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2022 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. - */ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ require('./MissionManager.test.js'); \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/src/main/js/test/MissionManager.test.js b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/src/main/js/test/MissionManager.test.js index d73f1c5d2..c46e244f1 100644 --- a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/src/main/js/test/MissionManager.test.js +++ b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/src/main/js/test/MissionManager.test.js @@ -1,183 +1,183 @@ -/* - * Copyright (c) 2022 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' -import featureAbility from '@ohos.ability.featureAbility'; -import missionManager from "@ohos.application.missionManager"; -import commonEvent from '@ohos.commonEvent'; -describe('missionManager', function () { - console.info("------------------logMessage SUB_AA_OpenHarmony_MissionManager_6500-------------------"); - var missionIds = []; - var timestamps = []; - var ability1LifeEventsonHide = { - events : [ - "singletonEntry2Ability1_onHide", - ] - } - var ability1LifeEvents = { - events : ["singletonEntry2Ability1_onShow", - "singletonEntry2Ability1_onHide", - "singletonEntry2Ability1_onInactive", - "singletonEntry2Ability1_onDestroy"] - } - var listKey = [""]; - var Subscriber = ""; - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_6500 - * @tc.name The timestamp of the verification ability will change - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_6500', 0, async function (done) { - listKey = [""]; - function SubscribeCallBack(error, data) { - console.log(" Subscribe CallBack data:" + JSON.stringify(data)); - if(data.event == "singletonEntry2Ability1_onHide"){ - listKey[0] = "onHide"; - console.log("print listKey" + listKey); - } - } - commonEvent.createSubscriber(ability1LifeEventsonHide).then(async (data) => { - Subscriber = data; - await commonEvent.subscribe(Subscriber, SubscribeCallBack); - }); - setTimeout(function () { - featureAbility.startAbility( - { want: { - bundleName: "com.example.missionmanager", - abilityName: "com.example.entry2.MainAbility" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_6500 - startAbility1: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - }); - }, 1000) - setTimeout(()=>{ - missionManager.getMissionInfos('', 100, (error, data) => { - console.log("SUB_AA_OpenHarmony_MissionManager_6500, twosgetMissionInfos:" + JSON.stringify(data)); - for (var i = 0;i < data.length; i++) { - console.log('aaaa' + JSON.stringify(data[i].missionId)+"::"+data[i]["want"].abilityName); - if (data[i].want.abilityName == "com.example.entry2.MainAbility"){ - console.log("uuuuu"+ JSON.stringify(data[i].want.abilityName)); - missionIds.push(data[i].missionId); - timestamps.push(data[i].timestamp); - } else if ([i].want.abilityName != "com.example.entry2.MainAbility"){ - console.log("failed222222222222"); - } - }; - }) - },1000) - setTimeout(function () { - featureAbility.startAbility( - { want: { - bundleName: "com.example.missionmanager", - abilityName: "com.example.entry2.MainAbility2" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_6500 - startAbility2: ' + - JSON.stringify(error) + ", " + JSON.stringify(data)) - console.log("print listKey111" + listKey); - setTimeout(function () { - expect(listKey[0] == "onHide").assertTrue(); - done(); - }, 3000) - }); - }, 1300) - setTimeout(()=>{ - console.log("ttttyyyyy" + missionIds+":::"+timestamps[0]); - for(var i=0;i { - console.log("SUB_AA_OpenHarmony_MissionManager_6500, infos2:" + JSON.stringify(data) + ""); - console.log(data.timestamp+"::::"+timestamps[1]); - expect(data.timestamp == timestamps[1]).assertTrue(); - }) - } - },2000) - console.log("------------end start SUB_AA_OpenHarmony_MissionManager_6500-------------"); - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_6400 - * @tc.name Verify the continuable information in the missionInfo of the ability obtained by getMissionInfos - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_6400', 0, async function (done) { - console.log("------------start SUB_AA_OpenHarmony_MissionManager_6400-------------"); - var TAG = "SUB_AA_OpenHarmony_MissionManager_6400"; - var missionInfo = ["","","","","","","","","",""]; - setTimeout(function () { - featureAbility.startAbility( - { want: { - bundleName: "com.example.myapplication3", - abilityName: "com.example.entry2.MainAbility1" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_6400 - startAbility: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - }); - }, 1000) - console.log("------------end start SUB_AA_OpenHarmony_MissionManager_6400-------------"); - setTimeout(()=>{ - missionManager.getMissionInfos('', 10, (err, data) => { - console.log("SUB_AA_OpenHarmony_MissionManager_6400, twosgetMissionInfos:" + JSON.stringify(data)); - for (var i = 0;i < data.length; i++) { - missionInfo[i] = data[i]; - console.log('qweqweqweqweqwe' + JSON.stringify(missionInfo[i].continuable)); - if(missionInfo[i].want.abilityName == "com.example.entry2.MainAbility1"){ - expect(missionInfo[i].continuable == false).assertTrue(); - }; - } - }) - },1000) - done(); - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_6300 - * @tc.name Verify the want information in the missionInfo of the ability obtained by getMissionInfos - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_6300', 0, async function (done) { - console.log("------------start SUB_AA_OpenHarmony_MissionManager_6300-------------"); - var TAG = "SUB_AA_OpenHarmony_MissionManager_6300"; - var missionInfo = ["","","","","","","","","",""]; - setTimeout(function () { - featureAbility.startAbility( - { want: { - bundleName: "com.example.myapplication3", - abilityName: "com.example.entry2.MainAbility1" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_6300 - startAbility: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - }); - }, 1000) - console.log("------------end start SUB_AA_OpenHarmony_MissionManager_6300-------------"); - setTimeout(()=>{ - missionManager.getMissionInfos('', 10, (err, data) => { - console.log("SUB_AA_OpenHarmony_MissionManager_6300, twosgetMissionInfos:" + JSON.stringify(data)); - for (var i = 0;i < data.length; i++) { - missionInfo[i] = data[i]; - console.log('qweqweqweqweqwe' + JSON.stringify(missionInfo[i].want)); - if(missionInfo[i].want.abilityName == "com.example.entry2.MainAbility1"){ - if(missionInfo[i].want.bundleName == "com.example.myapplication3"){ - console.log('weweqqq'); - expect(missionInfo[i].want.bundleName == "com.example.myapplication3").assertTrue(); - } - }; - } - }) - },1000) - done(); - }) +/* + * Copyright (c) 2022 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' +import featureAbility from '@ohos.ability.featureAbility'; +import missionManager from "@ohos.application.missionManager"; +import commonEvent from '@ohos.commonEvent'; +describe('missionManager', function () { + console.info("------------------logMessage SUB_AA_OpenHarmony_MissionManager_6500-------------------"); + var missionIds = []; + var timestamps = []; + var ability1LifeEventsonHide = { + events : [ + "singletonEntry2Ability1_onHide", + ] + } + var ability1LifeEvents = { + events : ["singletonEntry2Ability1_onShow", + "singletonEntry2Ability1_onHide", + "singletonEntry2Ability1_onInactive", + "singletonEntry2Ability1_onDestroy"] + } + var listKey = [""]; + var Subscriber = ""; + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_6500 + * @tc.name The timestamp of the verification ability will change + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_6500', 0, async function (done) { + listKey = [""]; + function SubscribeCallBack(error, data) { + console.log(" Subscribe CallBack data:" + JSON.stringify(data)); + if(data.event == "singletonEntry2Ability1_onHide"){ + listKey[0] = "onHide"; + console.log("print listKey" + listKey); + } + } + commonEvent.createSubscriber(ability1LifeEventsonHide).then(async (data) => { + Subscriber = data; + await commonEvent.subscribe(Subscriber, SubscribeCallBack); + }); + setTimeout(function () { + featureAbility.startAbility( + { want: { + bundleName: "com.example.missionmanager", + abilityName: "com.example.entry2.MainAbility" + } }, (error, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_6500 - startAbility1: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + }); + }, 1000) + setTimeout(()=>{ + missionManager.getMissionInfos('', 100, (error, data) => { + console.log("SUB_AA_OpenHarmony_MissionManager_6500, twosgetMissionInfos:" + JSON.stringify(data)); + for (var i = 0;i < data.length; i++) { + console.log('aaaa' + JSON.stringify(data[i].missionId)+"::"+data[i]["want"].abilityName); + if (data[i].want.abilityName == "com.example.entry2.MainAbility"){ + console.log("uuuuu"+ JSON.stringify(data[i].want.abilityName)); + missionIds.push(data[i].missionId); + timestamps.push(data[i].timestamp); + } else if ([i].want.abilityName != "com.example.entry2.MainAbility"){ + console.log("failed222222222222"); + } + }; + }) + },1000) + setTimeout(function () { + featureAbility.startAbility( + { want: { + bundleName: "com.example.missionmanager", + abilityName: "com.example.entry2.MainAbility2" + } }, (error, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_6500 - startAbility2: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + console.log("print listKey111" + listKey); + setTimeout(function () { + expect(listKey[0] == "onHide").assertTrue(); + done(); + }, 3000) + }); + }, 1300) + setTimeout(()=>{ + console.log("ttttyyyyy" + missionIds+":::"+timestamps[0]); + for(var i=0;i { + console.log("SUB_AA_OpenHarmony_MissionManager_6500, infos2:" + JSON.stringify(data) + ""); + console.log(data.timestamp+"::::"+timestamps[1]); + expect(data.timestamp == timestamps[1]).assertTrue(); + }) + } + },2000) + console.log("------------end start SUB_AA_OpenHarmony_MissionManager_6500-------------"); + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_6400 + * @tc.name Verify the continuable information in the missionInfo of the ability obtained by getMissionInfos + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_6400', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_MissionManager_6400-------------"); + var TAG = "SUB_AA_OpenHarmony_MissionManager_6400"; + var missionInfo = ["","","","","","","","","",""]; + setTimeout(function () { + featureAbility.startAbility( + { want: { + bundleName: "com.example.myapplication3", + abilityName: "com.example.entry2.MainAbility1" + } }, (error, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_6400 - startAbility: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + }); + }, 1000) + console.log("------------end start SUB_AA_OpenHarmony_MissionManager_6400-------------"); + setTimeout(()=>{ + missionManager.getMissionInfos('', 10, (err, data) => { + console.log("SUB_AA_OpenHarmony_MissionManager_6400, twosgetMissionInfos:" + JSON.stringify(data)); + for (var i = 0;i < data.length; i++) { + missionInfo[i] = data[i]; + console.log('qweqweqweqweqwe' + JSON.stringify(missionInfo[i].continuable)); + if(missionInfo[i].want.abilityName == "com.example.entry2.MainAbility1"){ + expect(missionInfo[i].continuable == false).assertTrue(); + }; + } + }) + },1000) + done(); + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_6300 + * @tc.name Verify the want information in the missionInfo of the ability obtained by getMissionInfos + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_6300', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_MissionManager_6300-------------"); + var TAG = "SUB_AA_OpenHarmony_MissionManager_6300"; + var missionInfo = ["","","","","","","","","",""]; + setTimeout(function () { + featureAbility.startAbility( + { want: { + bundleName: "com.example.myapplication3", + abilityName: "com.example.entry2.MainAbility1" + } }, (error, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_6300 - startAbility: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + }); + }, 1000) + console.log("------------end start SUB_AA_OpenHarmony_MissionManager_6300-------------"); + setTimeout(()=>{ + missionManager.getMissionInfos('', 10, (err, data) => { + console.log("SUB_AA_OpenHarmony_MissionManager_6300, twosgetMissionInfos:" + JSON.stringify(data)); + for (var i = 0;i < data.length; i++) { + missionInfo[i] = data[i]; + console.log('qweqweqweqweqwe' + JSON.stringify(missionInfo[i].want)); + if(missionInfo[i].want.abilityName == "com.example.entry2.MainAbility1"){ + if(missionInfo[i].want.bundleName == "com.example.myapplication3"){ + console.log('weweqqq'); + expect(missionInfo[i].want.bundleName == "com.example.myapplication3").assertTrue(); + } + }; + } + }) + },1000) + done(); + }) }) \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/src/main/resources/base/element/string.json index 610d89afc..d1321867f 100644 --- a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/src/main/resources/base/element/string.json +++ b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry/src/main/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "description_mainability", - "value": "JS_Empty Ability" - } - ] +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "JS_Empty Ability" + } + ] } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/.gitignore b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/.gitignore index 7d5b7a94f..f77260b15 100644 --- a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/.gitignore +++ b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/.gitignore @@ -1,2 +1,2 @@ -/build -/node_modules +/build +/node_modules diff --git a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/build.gradle b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/build.gradle index 85b7b9eb7..486ae0316 100644 --- a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/build.gradle +++ b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/build.gradle @@ -1,23 +1,23 @@ -apply plugin: 'com.huawei.ohos.hap' -//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 -ohos { - compileSdkVersion 8 - defaultConfig { - compatibleSdkVersion 7 - } - buildTypes { - release { - proguardOpt { - proguardEnabled false - rulesFiles 'proguard-rules.pro' - } - } - } - entryModules "entry" -} - -dependencies { - entryImplementation project(':entry') - implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) - testImplementation 'junit:junit:4.13.1' -} +apply plugin: 'com.huawei.ohos.hap' +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 +ohos { + compileSdkVersion 8 + defaultConfig { + compatibleSdkVersion 7 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } + entryModules "entry" +} + +dependencies { + entryImplementation project(':entry') + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) + testImplementation 'junit:junit:4.13.1' +} diff --git a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/package.json b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/package.json index 0967ef424..69a88e3b6 100644 --- a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/package.json +++ b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/package.json @@ -1 +1 @@ -{} +{} diff --git a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/src/main/config.json b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/src/main/config.json index 08f551812..4b11ab57b 100644 --- a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/src/main/config.json +++ b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/src/main/config.json @@ -1,83 +1,83 @@ -{ - "app": { - "bundleName": "com.example.missionmanager", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.entry2", - "name": ".MyApplication", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry2", - "moduleType": "feature", - "installationFree": false - }, - "abilities": [ - { - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_mainability", - "formsEnabled": false, - "label": "$string:entry2_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility2", - "name": ".MainAbility2", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_mainability2", - "formsEnabled": false, - "label": "$string:entry2_MainAbility2", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility2", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ],"reqPermissions": [ - {"name":"ohos.permission.MANAGE_LOCAL_ACCOUNTS"}, - {"name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION"}, - {"name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"}, - {"name":"ohos.permission.MANAGE_MISSIONS"} - ] - } +{ + "app": { + "bundleName": "com.example.missionmanager", + "vendor": "example", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.entry2", + "name": ".MyApplication", + "mainAbility": ".MainAbility", + "srcPath": "", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry2", + "moduleType": "feature", + "installationFree": false + }, + "abilities": [ + { + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:entry2_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility2", + "name": ".MainAbility2", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability2", + "formsEnabled": false, + "label": "$string:entry2_MainAbility2", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility2", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ],"reqPermissions": [ + {"name":"ohos.permission.MANAGE_LOCAL_ACCOUNTS"}, + {"name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION"}, + {"name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"}, + {"name":"ohos.permission.MANAGE_MISSIONS"} + ] + } } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/src/main/js/test2/List2.test.js b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/src/main/js/test2/List2.test.js index 7a11fa78c..b9d04af2f 100644 --- a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/src/main/js/test2/List2.test.js +++ b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/src/main/js/test2/List2.test.js @@ -1,16 +1,16 @@ -/* - * Copyright (c) 2022 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. - */ - +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + require('./entry2.test.js') \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/src/main/js/test2/entry2.test.js b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/src/main/js/test2/entry2.test.js index 3a0d7b092..51bc3cb2e 100644 --- a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/src/main/js/test2/entry2.test.js +++ b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/src/main/js/test2/entry2.test.js @@ -1,16 +1,16 @@ -/* - * Copyright (c) 2022 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 {describe, expect, it} from 'deccjsunit/index' +/* + * Copyright (c) 2022 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 {describe, expect, it} from 'deccjsunit/index' import commonEvent from '@ohos.commonevent' \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/src/main/resources/base/element/string.json index fc530e3a0..99c2ada7a 100644 --- a/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/src/main/resources/base/element/string.json +++ b/aafwk/aafwk_standard/fa/fa_missionmanager_test/entry2/src/main/resources/base/element/string.json @@ -1,20 +1,20 @@ -{ - "string": [ - { - "name": "entry2_MainAbility", - "value": "entry2_MainAbility" - }, - { - "name": "description_mainability", - "value": "JS_Empty Ability" - }, - { - "name": "description_mainability2", - "value": "JS_Empty Ability" - }, - { - "name": "entry2_MainAbility2", - "value": "entry2_MainAbility2" - } - ] +{ + "string": [ + { + "name": "entry2_MainAbility", + "value": "entry2_MainAbility" + }, + { + "name": "description_mainability", + "value": "JS_Empty Ability" + }, + { + "name": "description_mainability2", + "value": "JS_Empty Ability" + }, + { + "name": "entry2_MainAbility2", + "value": "entry2_MainAbility2" + } + ] } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/BUILD.gn b/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/BUILD.gn old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/Test.json b/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/Test.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/entry/.gitignore b/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/entry/.gitignore index 7d5b7a94f..f77260b15 100644 --- a/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/entry/.gitignore +++ b/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/entry/.gitignore @@ -1,2 +1,2 @@ -/build -/node_modules +/build +/node_modules diff --git a/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/entry/build.gradle b/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/entry/build.gradle index cef7b37de..c40c1f08c 100644 --- a/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/entry/build.gradle +++ b/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/entry/build.gradle @@ -1,21 +1,21 @@ -apply plugin: 'com.huawei.ohos.hap' -//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 -ohos { - compileSdkVersion 8 - defaultConfig { - compatibleSdkVersion 7 - } - buildTypes { - release { - proguardOpt { - proguardEnabled false - rulesFiles 'proguard-rules.pro' - } - } - } -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) - testImplementation 'junit:junit:4.13.1' -} +apply plugin: 'com.huawei.ohos.hap' +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 +ohos { + compileSdkVersion 8 + defaultConfig { + compatibleSdkVersion 7 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) + testImplementation 'junit:junit:4.13.1' +} diff --git a/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/entry/package.json b/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/entry/package.json index 0967ef424..69a88e3b6 100644 --- a/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/entry/package.json +++ b/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/entry/package.json @@ -1 +1 @@ -{} +{} diff --git a/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/entry/src/main/js/test/AbilityDisableTest.js b/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/entry/src/main/js/test/AbilityDisableTest.js index 0d97430ee..ec47b0bb6 100644 --- a/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/entry/src/main/js/test/AbilityDisableTest.js +++ b/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/entry/src/main/js/test/AbilityDisableTest.js @@ -1,408 +1,408 @@ - -/* - * 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. - */ -// @ts-nocheck -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" -import missionManager from '@ohos.application.missionManager'; -import featureAbility from '@ohos.ability.featureAbility'; -import bundleManager from '@ohos.bundle'; -import appManager from "@ohos.application.appManager" -import commonEvent from '@ohos.commonEvent'; -import {onDestroys} from "../MainAbility2/app.js" -import abilityManager from '@ohos.application.abilityManager' -import ConfigurationConstant from "@ohos.application.ConfigurationConstant"; - -function startAility(){ - setTimeout(()=>{ - featureAbility.startAbility({ want: { - bundleName: "com.example.abilitydisable", - abilityName: "com.example.abilitydisable.MainAbility2" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_Clear_0400 - startMainAbility2: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - }); - },100) - setTimeout(()=>{ - featureAbility.startAbility({ want: { - bundleName: "com.example.abilitydisable", - abilityName: "com.example.abilitydisable.MainAbility3" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_Clear_0400 - startMainAbility3: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)); - }); - },400) -} -function lockMissions(titles,missionId,times){ - setTimeout(()=>{ - console.log(titles+" lockMission missionIds[1]+++++123456::::"+missionId + typeof missionId) - for(var i=0;i{ - console.log(titles+'lockMission1 errCode:' + JSON.stringify(err) + " data: " + JSON.stringify(data)); - }); - }; - },times); -} -function clearAllMissions(){ - missionManager.clearAllMissions((err,data)=>{ - console.log('clearAllMissions errCode: ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - }) -} - -function fns(){ - setTimeout(()=>{ - featureAbility.startAbility({ want: { - bundleName: "com.example.abilitydisable", - abilityName: "com.example.abilitydisable.MainAbility2" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_Clear_0100 - startMainAbility2: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - expect(err.code == 0).assertTrue(); - }); - },100) - setTimeout(()=>{ - featureAbility.startAbility({ want: { - bundleName: "com.example.abilitydisable", - abilityName: "com.example.abilitydisable.MainAbility4" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_Clear_0100 - startMainAbility4: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - expect(err.code == 0).assertTrue(); - }); - },300) - setTimeout(()=>{ - featureAbility.startAbility({ want: { - bundleName: "com.example.abilitydisable", - abilityName: "com.example.abilitydisable.MainAbility3" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_Clear_0100 - startMainAbility3: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)) - expect(err.code == 0).assertTrue(); - }); - },500) - setTimeout(()=>{ - missionManager.getMissionInfos("", 20, (err, data) => { - console.log('SUB_AA_OpenHarmony_Clear_0100 getMissionInfos errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - for (var i = 0;i < data.length; i++) { - console.log("bundleName:"+data[i].want["abilityName"]) - if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility3" - || data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility4" - ||data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility" - ||data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility2"){ - console.log("data[i]['lockedState']::::"+data[i]['lockedState']); - console.log("data[i].missionId" + data[i].missionId); - console.log("SUB_AA_OpenHarmony_Clear_0100, missionId:" + data[i].missionId); - missionIds.push(data[i].missionId); - } - } - console.log('SUB_AA_OpenHarmony_Clear_0100 missionId:'+ missionIds + - typeof missionIds + ":::::"+missionIds[1] + typeof missionIds[1]); - }) - console.log("SUB_AA_OpenHarmony_Clear_0100" + JSON.stringify(missionIds)); - },800) - setTimeout(()=>{ - missionManager.lockMission(parseInt(missionIds[1]),(err,data)=>{ - console.log('SUB_AA_OpenHarmony_Clear_0100 lockMission1 missionIds[1] : ' + - JSON.stringify(missionIds[1]), + parseInt(missionIds[1])); - console.log('SUB_AA_OpenHarmony_Clear_0100 lockMission1 errCode : ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - }) - },1200) - setTimeout(()=>{ - missionManager.lockMission(parseInt(missionIds[2]),(err,data)=>{ - console.log('SUB_AA_OpenHarmony_Clear_0100 lockMission2 errCode : ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - }) - },1500) - setTimeout(()=>{ - missionManager.getMissionInfos("", 20, (err, data) => { - console.log("SUB_AA_OpenHarmony_Clear_0100, twosgetMissionInfos:" + - JSON.stringify(data)); - for (var i = 0;i < data.length; i++) { - console.log("data[i].missionId:missionIds[2] news missionIds[1]" + - data[i].missionId + missionIds[2] + missionIds[1]) - if(data[i].missionId == missionIds[1] || data[i].missionId == missionIds[2]){ - console.log("data[i]['lockedState']222:::::::"+data[i]['lockedState']); - expect(data[i]['lockedState'] == true).assertTrue(); - } - } - }) - console.log("SUB_AA_OpenHarmony_Clear_0100" + JSON.stringify(missionIds)); - },3500) - setTimeout(()=>{ - missionManager.getMissionInfos("", 20, (err, data) => { - console.log('SUB_AA_OpenHarmony_Clear_0100 getMissionInfos errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); -// var terminateSelf = - for (var i = 0;i < data.length; i++) { - console.log("bundleName:"+data[i].want["abilityName"]) - if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility3" - || data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility4" - ||data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility" - ||data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility2"){ - console.log("data[i]['lockedState']::::"+data[i]['lockedState']); - expect(data[i].lockedState == false).assertTrue(); - } - } - console.log('SUB_AA_OpenHarmony_Clear_0100 missionId:'+ missionIds + - typeof missionIds + ":::::"+missionIds[1] + typeof missionIds[1]); - }) - console.log("SUB_AA_OpenHarmony_Clear_0100" + JSON.stringify(missionIds)); - },4000) - setTimeout(()=>{ - missionManager.moveMissionToFront(parseInt(missionIds[2]),(err,data)=>{ - console.log('SUB_AA_OpenHarmony_Clear_0100 moveMissionToFront errCode : ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - }) - },4500) - setTimeout(()=>{ - missionManager.clearAllMissions((err,data)=>{ - console.log('SUB_AA_OpenHarmony_Clear_0100 clearAllMissions errCode: ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - - }) - },5000) - setTimeout(()=>{ - missionManager.getMissionInfos("", 20, (err, data) => { - console.log('SUB_AA_OpenHarmony_Clear_0100 getMissionInfos errCode : ' + - JSON.stringify(err) + " data: " + JSON.stringify(data)); - for (var i = 0;i < data.length; i++) { - console.log("bundleName:"+data[i].want["abilityName"]) - if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility3" || - data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility4" || - data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility"|| - data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility2"){ - console.log("data[i]['lockedState']end::::"+data[i]['lockedState']); - expect(data[i]['lockedState'] == true).assertTrue(); - } - } - console.log('SUB_AA_OpenHarmony_Clear_0100 missionId:'+ - missionIds + typeof missionIds + ":::::"+missionIds[1] + typeof missionIds[1]); - }) - console.log("SUB_AA_OpenHarmony_Clear_0100" + - JSON.stringify(missionIds)); - },8000) - expect(lists.indexOf(JSON.stringify("singletonEntryAbulity2_onShow"))!=-1).assertTrue(); - -} -describe('AbilityDisableTests', function () { - let mainAbility1ListS = new Array() - let lists = new Array() - function subscriberCallBackMainAbility2Destory(err,data){ - console.log("Subscribe2 CallBack data:" + JSON.stringify(data)); - lists.push(data["event"]); - console.log("subscriberCallBackMainAbility2Destory lists:"+lists); - }; - function subscriberCallBack_mainAbility1_Destory(err,data){ - console.log("Subscribe3 CallBack data:" + JSON.stringify(data)); - mainAbility1ListS.push(data["event"]) - console.log("subscriberCallBack_mainAbility3_Destory mainAbility1ListS:"+mainAbility1ListS); - } - console.log("AbilityDisableTests --- start"); - var ability2LifeEvents = { - events:["ApplicationMainAbility2_onDestroy", - "singletonEntryAbulity2_onHide", - "singletonEntryAbulity2_onActive", - "singletonEntryAbulity2_onInactive", - "singletonEntryAbility2_onDestroy", - "singletonEntryAbulity2_onShow", - "ApplicationMainAbility2_onCreate",] - }; - var ability1LifeEvents = { - events:["singletonEntryAbulity3_onHide", - "singletonEntryAbulity3_onActive", - "singletonEntryAbulity3_onInactive", - "singletonEntryAbility3_onDestroy", - "singletonEntryAbulity3_onShow", - "ApplicationMainAbility3_onCreate", - "ApplicationMainAbility3_onDestroy", - ] - }; - - /* - * @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_2900 - * @tc.name Verify the full-screen switching application - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MoveMissionToFront_2900', 0, async function (done) { - - var Subscriber2 = []; - var Subscriber1 = []; - var mainAbility1missinds = [] - console.log("SUB_AA_OpenHarmony_MoveMissionToFront_2900 --- start") - commonEvent.createSubscriber(ability2LifeEvents).then(async (data)=>{ - console.log("Create Subscriber2=======>:"+JSON.stringify(data)); - Subscriber2 = data; - console.log("data2 is:" + JSON.stringify(Subscriber2)); - await commonEvent.subscribe(Subscriber2,subscriberCallBackMainAbility2Destory) - }); - commonEvent.createSubscriber(ability1LifeEvents).then(async (data)=>{ - console.log("Create Subscriber1=======>:"+JSON.stringify(data)); - Subscriber1 = data; - console.log("data2 is:" + JSON.stringify(Subscriber1)); - await commonEvent.subscribe(Subscriber1,subscriberCallBack_mainAbility1_Destory) - }); - setTimeout(()=>{ - featureAbility.startAbility({ want: { - bundleName: "com.example.abilitydisable", - abilityName: "com.example.abilitydisable.MainAbility2" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_MoveMissionToFront_2900 - startMainAbility2: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)); - }); - },500) - setTimeout(()=>{ - featureAbility.startAbility({ want: { - bundleName: "com.example.abilitydisable", - abilityName: "com.example.abilitydisable.MainAbility3" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_MoveMissionToFront_2900 - startMainAbility3: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)); - }); - },1000); - setTimeout(()=>{ - console.log("1111subscriberCallBackMainAbility2Destory lists:"+lists); - expect(lists.indexOf(JSON.stringify("singletonEntryAbulity2_onShow"))!=-1).assertTrue(); - expect(lists.indexOf(JSON.stringify("ApplicationMainAbility2_onCreate"))!=-1).assertTrue(); - },2500) - setTimeout(()=>{ - missionManager.getMissionInfos("", 100, (err, data) => { - console.log('SUB_AA_OpenHarmony_MoveMissionToFront_2900 getMissionInfos errCode: '+ - JSON.stringify(err) + " data: " + JSON.stringify(data)); - for (var i = 0;i < data.length; i++) { - if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility2"){ - mainAbility1missinds.push(data[i]["missionId"]) - } - - } - console.log("mainAbility1missinds:"+mainAbility1missinds); - }); - },3000) - setTimeout(()=>{ - console.log('SUB_AA_OpenHarmony_MoveMissionToFront_2900 moveMissionToFront dataCode:++++++'); - missionManager.moveMissionToFront(parseInt(mainAbility1missinds[0]),{ - parameters:{ "windowMode":1 }}).then((data)=>{ - console.log('SUB_AA_OpenHarmony_MoveMissionToFront_2900 moveMissionToFront dataCode:'+ " data:" - + JSON.stringify(data)); - expect().assertFail(); - }).catch((err)=>{ - console.log('SUB_AA_OpenHarmony_MoveMissionToFront_2900 moveMissionToFront errCode:'+ " err:" - + JSON.stringify(err)); - }); - },3888); - setTimeout(()=>{ - console.log("1111subscriberCallBack_mainAbility1_Destory lists:"+ mainAbility1ListS); - expect(mainAbility1ListS.indexOf(JSON.stringify("singletonEntrymainAb" + - "ility1ListSAbulity1_onInactive"))!=-1).assertTrue(); - expect(mainAbility1ListS.indexOf(JSON.stringify("singletonEntryA" + - "bulity1_onHide"))!=-1).assertTrue(); - },3999); - done() - }); - - /* - * @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_3000 - * @tc.name Verify the left split screen switching application - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MoveMissionToFront_3000', 0, async function (done) { - var Subscriber2 = ""; - var Subscriber1 = ""; - var mainAbility1missinds = [] - console.log("SUB_AA_OpenHarmony_MoveMissionToFront_3000 --- start") - commonEvent.createSubscriber(ability2LifeEvents).then(async (data)=>{ - console.log("Create Subscriber2=======>:"+JSON.stringify(data)); - Subscriber2 = data; - console.log("data2 is:" + JSON.stringify(Subscriber2)); - await commonEvent.subscribe(Subscriber2,subscriberCallBackMainAbility2Destory) - }); - commonEvent.createSubscriber(ability1LifeEvents).then(async (data)=>{ - console.log("Create Subscriber1=======>:"+JSON.stringify(data)); - Subscriber1 = data; - console.log("data2 is:" + JSON.stringify(Subscriber1)); - await commonEvent.subscribe(Subscriber1,subscriberCallBack_mainAbility1_Destory) - }); - - setTimeout(()=>{ - featureAbility.startAbility({ want: { - bundleName: "com.example.abilitydisable", - abilityName: "com.example.abilitydisable.MainAbility2" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_MoveMissionToFront_3000 - startMainAbility2: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)); - }); - },500); - setTimeout(()=>{ - featureAbility.startAbility({ want: { - bundleName: "com.example.abilitydisable", - abilityName: "com.example.abilitydisable.MainAbility3" - } }, (error, data) => { - console.log('SUB_AA_OpenHarmony_MoveMissionToFront_3000 - startMainAbility3: ' - + JSON.stringify(error) + ", " + JSON.stringify(data)); - }); - },1000); - setTimeout(()=>{ - console.log("1111subscriberCallBack_mainAbility2_lists: - singletonEntryAbulity2_onShow:"+lists); - console.log("+++++++++++++++++"+lists.indexOf("singletonEntryAbulity2_onShow") - +"+++++++"+lists.indexOf("ApplicationMainAbility2_onCreate")+lists) - expect(lists.indexOf(JSON.stringify("singletonEntryAbulity2_onShow"))!=-1).assertTrue(); - expect(lists.indexOf(JSON.stringify("ApplicationMainAbility2_onCreate"))!=-1).assertTrue(); - },2500); - setTimeout(()=>{ - missionManager.getMissionInfos("", 100, (err, data) => { - console.log('SUB_AA_OpenHarmony_MoveMissionToFront_3000 - getMissionInfos errCode: '+ - JSON.stringify(err) + " data: " + JSON.stringify(data)); - for (var i = 0;i < data.length; i++) { - console.log("bundleName222222:"+data[i].want["abilityName"]+ - "data[i]['lockedState']::::"+data[i]['lockedState']); - if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility3"){ - console.log('data[i]["missionId"]'+data[i]["missionId"] + "::::"+ - data[i].want["abilityName"]); - mainAbility1missinds.push(data[i]["missionId"]) - } - } - console.log("mainAbility1missinds:"+mainAbility1missinds); - }); - },3000); - setTimeout(()=>{ - console.log('SUB_AA_OpenHarmony_MoveMissionToFront_3000 - moveMissionToFront dataCode:++++++'); - missionManager.moveMissionToFront(parseInt(mainAbility1missinds[0]),{ - parameters:{ "windowMode":100 }}).then((data)=>{ - console.log('SUB_AA_OpenHarmony_MoveMissionToFront_3000 - moveMissionToFront dataCode:'+ - " data:" + JSON.stringify(data)); - }).catch((err)=>{ - console.log('SUB_AA_OpenHarmony_MoveMissionToFront_3000 - moveMissionToFront errCode:'+ - " err:" + JSON.stringify(err)); - }); - },3888); - setTimeout(()=>{ - console.log("1111subscriberCallBack_mainAbility1_Destory lists:"+ mainAbility1ListS); - console.log("+++++++++++++++++"+mainAbility1ListS.indexOf("mainAbility1ListS_onShow") - +"+++++++"+mainAbility1ListS.indexOf("ApplicationMainAbility2_onCreate") - +mainAbility1ListS) - expect(mainAbility1ListS.indexOf(JSON.stringify("singletonEntryAbulity1_onInactive"))==-1).assertTrue(); - expect(mainAbility1ListS.indexOf(JSON.stringify("singletonEntryAbulity1_onHide"))==-1).assertTrue(); - },3999); - done(); - }); -}) + +/* + * 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. + */ +// @ts-nocheck +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" +import missionManager from '@ohos.application.missionManager'; +import featureAbility from '@ohos.ability.featureAbility'; +import bundleManager from '@ohos.bundle'; +import appManager from "@ohos.application.appManager" +import commonEvent from '@ohos.commonEvent'; +import {onDestroys} from "../MainAbility2/app.js" +import abilityManager from '@ohos.application.abilityManager' +import ConfigurationConstant from "@ohos.application.ConfigurationConstant"; + +function startAility(){ + setTimeout(()=>{ + featureAbility.startAbility({ want: { + bundleName: "com.example.abilitydisable", + abilityName: "com.example.abilitydisable.MainAbility2" + } }, (error, data) => { + console.log('SUB_AA_OpenHarmony_Clear_0400 - startMainAbility2: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + }); + },100) + setTimeout(()=>{ + featureAbility.startAbility({ want: { + bundleName: "com.example.abilitydisable", + abilityName: "com.example.abilitydisable.MainAbility3" + } }, (error, data) => { + console.log('SUB_AA_OpenHarmony_Clear_0400 - startMainAbility3: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)); + }); + },400) +} +function lockMissions(titles,missionId,times){ + setTimeout(()=>{ + console.log(titles+" lockMission missionIds[1]+++++123456::::"+missionId + typeof missionId) + for(var i=0;i{ + console.log(titles+'lockMission1 errCode:' + JSON.stringify(err) + " data: " + JSON.stringify(data)); + }); + }; + },times); +} +function clearAllMissions(){ + missionManager.clearAllMissions((err,data)=>{ + console.log('clearAllMissions errCode: ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + }) +} + +function fns(){ + setTimeout(()=>{ + featureAbility.startAbility({ want: { + bundleName: "com.example.abilitydisable", + abilityName: "com.example.abilitydisable.MainAbility2" + } }, (error, data) => { + console.log('SUB_AA_OpenHarmony_Clear_0100 - startMainAbility2: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + expect(err.code == 0).assertTrue(); + }); + },100) + setTimeout(()=>{ + featureAbility.startAbility({ want: { + bundleName: "com.example.abilitydisable", + abilityName: "com.example.abilitydisable.MainAbility4" + } }, (error, data) => { + console.log('SUB_AA_OpenHarmony_Clear_0100 - startMainAbility4: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + expect(err.code == 0).assertTrue(); + }); + },300) + setTimeout(()=>{ + featureAbility.startAbility({ want: { + bundleName: "com.example.abilitydisable", + abilityName: "com.example.abilitydisable.MainAbility3" + } }, (error, data) => { + console.log('SUB_AA_OpenHarmony_Clear_0100 - startMainAbility3: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)) + expect(err.code == 0).assertTrue(); + }); + },500) + setTimeout(()=>{ + missionManager.getMissionInfos("", 20, (err, data) => { + console.log('SUB_AA_OpenHarmony_Clear_0100 getMissionInfos errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + for (var i = 0;i < data.length; i++) { + console.log("bundleName:"+data[i].want["abilityName"]) + if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility3" + || data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility4" + ||data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility" + ||data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility2"){ + console.log("data[i]['lockedState']::::"+data[i]['lockedState']); + console.log("data[i].missionId" + data[i].missionId); + console.log("SUB_AA_OpenHarmony_Clear_0100, missionId:" + data[i].missionId); + missionIds.push(data[i].missionId); + } + } + console.log('SUB_AA_OpenHarmony_Clear_0100 missionId:'+ missionIds + + typeof missionIds + ":::::"+missionIds[1] + typeof missionIds[1]); + }) + console.log("SUB_AA_OpenHarmony_Clear_0100" + JSON.stringify(missionIds)); + },800) + setTimeout(()=>{ + missionManager.lockMission(parseInt(missionIds[1]),(err,data)=>{ + console.log('SUB_AA_OpenHarmony_Clear_0100 lockMission1 missionIds[1] : ' + + JSON.stringify(missionIds[1]), + parseInt(missionIds[1])); + console.log('SUB_AA_OpenHarmony_Clear_0100 lockMission1 errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + }) + },1200) + setTimeout(()=>{ + missionManager.lockMission(parseInt(missionIds[2]),(err,data)=>{ + console.log('SUB_AA_OpenHarmony_Clear_0100 lockMission2 errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + }) + },1500) + setTimeout(()=>{ + missionManager.getMissionInfos("", 20, (err, data) => { + console.log("SUB_AA_OpenHarmony_Clear_0100, twosgetMissionInfos:" + + JSON.stringify(data)); + for (var i = 0;i < data.length; i++) { + console.log("data[i].missionId:missionIds[2] news missionIds[1]" + + data[i].missionId + missionIds[2] + missionIds[1]) + if(data[i].missionId == missionIds[1] || data[i].missionId == missionIds[2]){ + console.log("data[i]['lockedState']222:::::::"+data[i]['lockedState']); + expect(data[i]['lockedState'] == true).assertTrue(); + } + } + }) + console.log("SUB_AA_OpenHarmony_Clear_0100" + JSON.stringify(missionIds)); + },3500) + setTimeout(()=>{ + missionManager.getMissionInfos("", 20, (err, data) => { + console.log('SUB_AA_OpenHarmony_Clear_0100 getMissionInfos errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); +// var terminateSelf = + for (var i = 0;i < data.length; i++) { + console.log("bundleName:"+data[i].want["abilityName"]) + if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility3" + || data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility4" + ||data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility" + ||data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility2"){ + console.log("data[i]['lockedState']::::"+data[i]['lockedState']); + expect(data[i].lockedState == false).assertTrue(); + } + } + console.log('SUB_AA_OpenHarmony_Clear_0100 missionId:'+ missionIds + + typeof missionIds + ":::::"+missionIds[1] + typeof missionIds[1]); + }) + console.log("SUB_AA_OpenHarmony_Clear_0100" + JSON.stringify(missionIds)); + },4000) + setTimeout(()=>{ + missionManager.moveMissionToFront(parseInt(missionIds[2]),(err,data)=>{ + console.log('SUB_AA_OpenHarmony_Clear_0100 moveMissionToFront errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + }) + },4500) + setTimeout(()=>{ + missionManager.clearAllMissions((err,data)=>{ + console.log('SUB_AA_OpenHarmony_Clear_0100 clearAllMissions errCode: ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + + }) + },5000) + setTimeout(()=>{ + missionManager.getMissionInfos("", 20, (err, data) => { + console.log('SUB_AA_OpenHarmony_Clear_0100 getMissionInfos errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + for (var i = 0;i < data.length; i++) { + console.log("bundleName:"+data[i].want["abilityName"]) + if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility3" || + data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility4" || + data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility"|| + data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility2"){ + console.log("data[i]['lockedState']end::::"+data[i]['lockedState']); + expect(data[i]['lockedState'] == true).assertTrue(); + } + } + console.log('SUB_AA_OpenHarmony_Clear_0100 missionId:'+ + missionIds + typeof missionIds + ":::::"+missionIds[1] + typeof missionIds[1]); + }) + console.log("SUB_AA_OpenHarmony_Clear_0100" + + JSON.stringify(missionIds)); + },8000) + expect(lists.indexOf(JSON.stringify("singletonEntryAbulity2_onShow"))!=-1).assertTrue(); + +} +describe('AbilityDisableTests', function () { + let mainAbility1ListS = new Array() + let lists = new Array() + function subscriberCallBackMainAbility2Destory(err,data){ + console.log("Subscribe2 CallBack data:" + JSON.stringify(data)); + lists.push(data["event"]); + console.log("subscriberCallBackMainAbility2Destory lists:"+lists); + }; + function subscriberCallBack_mainAbility1_Destory(err,data){ + console.log("Subscribe3 CallBack data:" + JSON.stringify(data)); + mainAbility1ListS.push(data["event"]) + console.log("subscriberCallBack_mainAbility3_Destory mainAbility1ListS:"+mainAbility1ListS); + } + console.log("AbilityDisableTests --- start"); + var ability2LifeEvents = { + events:["ApplicationMainAbility2_onDestroy", + "singletonEntryAbulity2_onHide", + "singletonEntryAbulity2_onActive", + "singletonEntryAbulity2_onInactive", + "singletonEntryAbility2_onDestroy", + "singletonEntryAbulity2_onShow", + "ApplicationMainAbility2_onCreate",] + }; + var ability1LifeEvents = { + events:["singletonEntryAbulity3_onHide", + "singletonEntryAbulity3_onActive", + "singletonEntryAbulity3_onInactive", + "singletonEntryAbility3_onDestroy", + "singletonEntryAbulity3_onShow", + "ApplicationMainAbility3_onCreate", + "ApplicationMainAbility3_onDestroy", + ] + }; + + /* + * @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_2900 + * @tc.name Verify the full-screen switching application + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MoveMissionToFront_2900', 0, async function (done) { + + var Subscriber2 = []; + var Subscriber1 = []; + var mainAbility1missinds = [] + console.log("SUB_AA_OpenHarmony_MoveMissionToFront_2900 --- start") + commonEvent.createSubscriber(ability2LifeEvents).then(async (data)=>{ + console.log("Create Subscriber2=======>:"+JSON.stringify(data)); + Subscriber2 = data; + console.log("data2 is:" + JSON.stringify(Subscriber2)); + await commonEvent.subscribe(Subscriber2,subscriberCallBackMainAbility2Destory) + }); + commonEvent.createSubscriber(ability1LifeEvents).then(async (data)=>{ + console.log("Create Subscriber1=======>:"+JSON.stringify(data)); + Subscriber1 = data; + console.log("data2 is:" + JSON.stringify(Subscriber1)); + await commonEvent.subscribe(Subscriber1,subscriberCallBack_mainAbility1_Destory) + }); + setTimeout(()=>{ + featureAbility.startAbility({ want: { + bundleName: "com.example.abilitydisable", + abilityName: "com.example.abilitydisable.MainAbility2" + } }, (error, data) => { + console.log('SUB_AA_OpenHarmony_MoveMissionToFront_2900 - startMainAbility2: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)); + }); + },500) + setTimeout(()=>{ + featureAbility.startAbility({ want: { + bundleName: "com.example.abilitydisable", + abilityName: "com.example.abilitydisable.MainAbility3" + } }, (error, data) => { + console.log('SUB_AA_OpenHarmony_MoveMissionToFront_2900 - startMainAbility3: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)); + }); + },1000); + setTimeout(()=>{ + console.log("1111subscriberCallBackMainAbility2Destory lists:"+lists); + expect(lists.indexOf(JSON.stringify("singletonEntryAbulity2_onShow"))!=-1).assertTrue(); + expect(lists.indexOf(JSON.stringify("ApplicationMainAbility2_onCreate"))!=-1).assertTrue(); + },2500) + setTimeout(()=>{ + missionManager.getMissionInfos("", 100, (err, data) => { + console.log('SUB_AA_OpenHarmony_MoveMissionToFront_2900 getMissionInfos errCode: '+ + JSON.stringify(err) + " data: " + JSON.stringify(data)); + for (var i = 0;i < data.length; i++) { + if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility2"){ + mainAbility1missinds.push(data[i]["missionId"]) + } + + } + console.log("mainAbility1missinds:"+mainAbility1missinds); + }); + },3000) + setTimeout(()=>{ + console.log('SUB_AA_OpenHarmony_MoveMissionToFront_2900 moveMissionToFront dataCode:++++++'); + missionManager.moveMissionToFront(parseInt(mainAbility1missinds[0]),{ + parameters:{ "windowMode":1 }}).then((data)=>{ + console.log('SUB_AA_OpenHarmony_MoveMissionToFront_2900 moveMissionToFront dataCode:'+ " data:" + + JSON.stringify(data)); + expect().assertFail(); + }).catch((err)=>{ + console.log('SUB_AA_OpenHarmony_MoveMissionToFront_2900 moveMissionToFront errCode:'+ " err:" + + JSON.stringify(err)); + }); + },3888); + setTimeout(()=>{ + console.log("1111subscriberCallBack_mainAbility1_Destory lists:"+ mainAbility1ListS); + expect(mainAbility1ListS.indexOf(JSON.stringify("singletonEntrymainAb" + + "ility1ListSAbulity1_onInactive"))!=-1).assertTrue(); + expect(mainAbility1ListS.indexOf(JSON.stringify("singletonEntryA" + + "bulity1_onHide"))!=-1).assertTrue(); + },3999); + done() + }); + + /* + * @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_3000 + * @tc.name Verify the left split screen switching application + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MoveMissionToFront_3000', 0, async function (done) { + var Subscriber2 = ""; + var Subscriber1 = ""; + var mainAbility1missinds = [] + console.log("SUB_AA_OpenHarmony_MoveMissionToFront_3000 --- start") + commonEvent.createSubscriber(ability2LifeEvents).then(async (data)=>{ + console.log("Create Subscriber2=======>:"+JSON.stringify(data)); + Subscriber2 = data; + console.log("data2 is:" + JSON.stringify(Subscriber2)); + await commonEvent.subscribe(Subscriber2,subscriberCallBackMainAbility2Destory) + }); + commonEvent.createSubscriber(ability1LifeEvents).then(async (data)=>{ + console.log("Create Subscriber1=======>:"+JSON.stringify(data)); + Subscriber1 = data; + console.log("data2 is:" + JSON.stringify(Subscriber1)); + await commonEvent.subscribe(Subscriber1,subscriberCallBack_mainAbility1_Destory) + }); + + setTimeout(()=>{ + featureAbility.startAbility({ want: { + bundleName: "com.example.abilitydisable", + abilityName: "com.example.abilitydisable.MainAbility2" + } }, (error, data) => { + console.log('SUB_AA_OpenHarmony_MoveMissionToFront_3000 - startMainAbility2: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)); + }); + },500); + setTimeout(()=>{ + featureAbility.startAbility({ want: { + bundleName: "com.example.abilitydisable", + abilityName: "com.example.abilitydisable.MainAbility3" + } }, (error, data) => { + console.log('SUB_AA_OpenHarmony_MoveMissionToFront_3000 - startMainAbility3: ' + + JSON.stringify(error) + ", " + JSON.stringify(data)); + }); + },1000); + setTimeout(()=>{ + console.log("1111subscriberCallBack_mainAbility2_lists: + singletonEntryAbulity2_onShow:"+lists); + console.log("+++++++++++++++++"+lists.indexOf("singletonEntryAbulity2_onShow") + +"+++++++"+lists.indexOf("ApplicationMainAbility2_onCreate")+lists) + expect(lists.indexOf(JSON.stringify("singletonEntryAbulity2_onShow"))!=-1).assertTrue(); + expect(lists.indexOf(JSON.stringify("ApplicationMainAbility2_onCreate"))!=-1).assertTrue(); + },2500); + setTimeout(()=>{ + missionManager.getMissionInfos("", 100, (err, data) => { + console.log('SUB_AA_OpenHarmony_MoveMissionToFront_3000 + getMissionInfos errCode: '+ + JSON.stringify(err) + " data: " + JSON.stringify(data)); + for (var i = 0;i < data.length; i++) { + console.log("bundleName222222:"+data[i].want["abilityName"]+ + "data[i]['lockedState']::::"+data[i]['lockedState']); + if(data[i].want["abilityName"] == "com.example.abilitydisable.MainAbility3"){ + console.log('data[i]["missionId"]'+data[i]["missionId"] + "::::"+ + data[i].want["abilityName"]); + mainAbility1missinds.push(data[i]["missionId"]) + } + } + console.log("mainAbility1missinds:"+mainAbility1missinds); + }); + },3000); + setTimeout(()=>{ + console.log('SUB_AA_OpenHarmony_MoveMissionToFront_3000 + moveMissionToFront dataCode:++++++'); + missionManager.moveMissionToFront(parseInt(mainAbility1missinds[0]),{ + parameters:{ "windowMode":100 }}).then((data)=>{ + console.log('SUB_AA_OpenHarmony_MoveMissionToFront_3000 + moveMissionToFront dataCode:'+ + " data:" + JSON.stringify(data)); + }).catch((err)=>{ + console.log('SUB_AA_OpenHarmony_MoveMissionToFront_3000 + moveMissionToFront errCode:'+ + " err:" + JSON.stringify(err)); + }); + },3888); + setTimeout(()=>{ + console.log("1111subscriberCallBack_mainAbility1_Destory lists:"+ mainAbility1ListS); + console.log("+++++++++++++++++"+mainAbility1ListS.indexOf("mainAbility1ListS_onShow") + +"+++++++"+mainAbility1ListS.indexOf("ApplicationMainAbility2_onCreate") + +mainAbility1ListS) + expect(mainAbility1ListS.indexOf(JSON.stringify("singletonEntryAbulity1_onInactive"))==-1).assertTrue(); + expect(mainAbility1ListS.indexOf(JSON.stringify("singletonEntryAbulity1_onHide"))==-1).assertTrue(); + },3999); + done(); + }); +}) diff --git a/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/entry/src/main/js/test/List.test.js index d12ff02b8..2a2007331 100644 --- a/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/entry/src/main/js/test/List.test.js +++ b/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -require('./AbilityDisableTest.js'); +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +require('./AbilityDisableTest.js'); diff --git a/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/entry/src/main/resources/base/element/string.json index 1d2808e5c..2e8b3cf8a 100644 --- a/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/entry/src/main/resources/base/element/string.json +++ b/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/entry/src/main/resources/base/element/string.json @@ -1,40 +1,40 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "description_mainability", - "value": "JS_Empty Ability" - }, - { - "name": "description_mainability2", - "value": "JS_Empty Ability" - }, - { - "name": "entry_MainAbility2", - "value": "entry_MainAbility2" - }, - { - "name": "description_mainability3", - "value": "JS_Empty Ability" - }, - { - "name": "entry_MainAbility3", - "value": "entry_MainAbility3" - }, - { - "name": "description_mainability4", - "value": "JS_Empty Ability" - }, - { - "name": "entry_MainAbility4", - "value": "entry_MainAbility4" - }, - { - "name": "description_serviceability", - "value": "hap sample empty service" - } - ] +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "JS_Empty Ability" + }, + { + "name": "description_mainability2", + "value": "JS_Empty Ability" + }, + { + "name": "entry_MainAbility2", + "value": "entry_MainAbility2" + }, + { + "name": "description_mainability3", + "value": "JS_Empty Ability" + }, + { + "name": "entry_MainAbility3", + "value": "entry_MainAbility3" + }, + { + "name": "description_mainability4", + "value": "JS_Empty Ability" + }, + { + "name": "entry_MainAbility4", + "value": "entry_MainAbility4" + }, + { + "name": "description_serviceability", + "value": "hap sample empty service" + } + ] } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/fa/fa_movemissiontofront_test/signature/openharmony_sx.p7b old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_state_test/BUILD.gn b/aafwk/aafwk_standard/fa/fa_state_test/BUILD.gn old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_state_test/Test.json b/aafwk/aafwk_standard/fa/fa_state_test/Test.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_state_test/entry/src/main/config.json b/aafwk/aafwk_standard/fa/fa_state_test/entry/src/main/config.json index 5d6048801..01e55a717 100644 --- a/aafwk/aafwk_standard/fa/fa_state_test/entry/src/main/config.json +++ b/aafwk/aafwk_standard/fa/fa_state_test/entry/src/main/config.json @@ -1,90 +1,90 @@ -{ - "app": { - "bundleName": "com.example.statelistener", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.statelistener", - "name": ".MyApplication", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_mainability", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.GET_BUNDLE_INFO", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.RUNNING_STATE_OBSERVER", - "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", - "reason": "need use ohos.perILEGED" - }, - { - "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason": "need use ohos._PRIVILEGED" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason": "need use ohos._PRIVILEGED" - }, - { - "name": "ohos.permission.GET_RUNNING_INFO", - "reason": "need use ohos.permi" - } - ] - } +{ + "app": { + "bundleName": "com.example.statelistener", + "vendor": "example", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.statelistener", + "name": ".MyApplication", + "mainAbility": ".MainAbility", + "srcPath": "", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.GET_BUNDLE_INFO", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.RUNNING_STATE_OBSERVER", + "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", + "reason": "need use ohos.perILEGED" + }, + { + "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason": "need use ohos._PRIVILEGED" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason": "need use ohos._PRIVILEGED" + }, + { + "name": "ohos.permission.GET_RUNNING_INFO", + "reason": "need use ohos.permi" + } + ] + } } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_state_test/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/fa/fa_state_test/entry/src/main/js/test/List.test.js index c97152de1..21f6f7f66 100644 --- a/aafwk/aafwk_standard/fa/fa_state_test/entry/src/main/js/test/List.test.js +++ b/aafwk/aafwk_standard/fa/fa_state_test/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ require('./startFULL.test.js'); \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_state_test/entry/src/main/js/test/startFULL.test.js b/aafwk/aafwk_standard/fa/fa_state_test/entry/src/main/js/test/startFULL.test.js index 53c9e092d..8bec45d22 100644 --- a/aafwk/aafwk_standard/fa/fa_state_test/entry/src/main/js/test/startFULL.test.js +++ b/aafwk/aafwk_standard/fa/fa_state_test/entry/src/main/js/test/startFULL.test.js @@ -1,81 +1,81 @@ -/* - * 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 appManager from '@ohos.application.appManager'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" -import featureAbility from '@ohos.ability.featureAbility'; -import abilityfeatureAbility from '@ohos.ability.featureAbility'; -var appbefore -var appafter -describe("appManagerTest", function () { - console.log("---appManagerTest-- starting---"); - function sleep(time) { - return new Promise((resolve) => setTimeout(resolve, time)) - } - - /** - * @tc.number: SUB_AA_OpenHarmony_StateListener_0300 - * @tc.name: Find all foreground application validations - * @tc.desc: Function test - * @tc.level 0 - */ - it("SUB_AA_OpenHarmony_StateListener_0300", 0, async function (done) { - await appManager.getForegroundApplications().then((data) => { - console.log("---appM- starting---"); - for (var i = 0; i < data.length; i++) { - if (data[i].bundleName == "com.example.statelistener") { - appbefore = data[i] - } - } - checkAppBefore(appbefore) - }).catch(()=>{ - expect().assertFail() - }) - var want = { - "bundleName": "com.example.fzgc", - "abilityName": "com.example.fzgc.MainAbility" - } - await featureAbility.startAbility({ want }).then().catch(); - await sleep(1000) - await appManager.getForegroundApplications().then((data) => { - for (var i = 0; i < data.length; i++) { - if (data[i].bundleName == "com.example.fzgc") { - appafter = data[i] - } - } - checkAppAfter(appafter) - }).catch(()=>{ - expect().assertFail() - }) - await sleep(2000) - done(); - }) - - function checkAppAfter(app) { - expect(app.state == 2).assertTrue(); - expect(app.uid > 0).assertTrue(); - expect(app.bundleName).assertEqual('com.example.fzgc'); - } - function checkAppBefore(app) { - expect(app.state == 2).assertTrue(); - expect(app.uid > 0).assertTrue(); - expect(app.bundleName).assertEqual('com.example.statelistener'); - } -}) - - - - - - +/* + * 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 appManager from '@ohos.application.appManager'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" +import featureAbility from '@ohos.ability.featureAbility'; +import abilityfeatureAbility from '@ohos.ability.featureAbility'; +var appbefore +var appafter +describe("appManagerTest", function () { + console.log("---appManagerTest-- starting---"); + function sleep(time) { + return new Promise((resolve) => setTimeout(resolve, time)) + } + + /** + * @tc.number: SUB_AA_OpenHarmony_StateListener_0300 + * @tc.name: Find all foreground application validations + * @tc.desc: Function test + * @tc.level 0 + */ + it("SUB_AA_OpenHarmony_StateListener_0300", 0, async function (done) { + await appManager.getForegroundApplications().then((data) => { + console.log("---appM- starting---"); + for (var i = 0; i < data.length; i++) { + if (data[i].bundleName == "com.example.statelistener") { + appbefore = data[i] + } + } + checkAppBefore(appbefore) + }).catch(()=>{ + expect().assertFail() + }) + var want = { + "bundleName": "com.example.fzgc", + "abilityName": "com.example.fzgc.MainAbility" + } + await featureAbility.startAbility({ want }).then().catch(); + await sleep(1000) + await appManager.getForegroundApplications().then((data) => { + for (var i = 0; i < data.length; i++) { + if (data[i].bundleName == "com.example.fzgc") { + appafter = data[i] + } + } + checkAppAfter(appafter) + }).catch(()=>{ + expect().assertFail() + }) + await sleep(2000) + done(); + }) + + function checkAppAfter(app) { + expect(app.state == 2).assertTrue(); + expect(app.uid > 0).assertTrue(); + expect(app.bundleName).assertEqual('com.example.fzgc'); + } + function checkAppBefore(app) { + expect(app.state == 2).assertTrue(); + expect(app.uid > 0).assertTrue(); + expect(app.bundleName).assertEqual('com.example.statelistener'); + } +}) + + + + + + diff --git a/aafwk/aafwk_standard/fa/fa_state_test/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/fa/fa_state_test/entry/src/main/resources/base/element/string.json index 610d89afc..d1321867f 100644 --- a/aafwk/aafwk_standard/fa/fa_state_test/entry/src/main/resources/base/element/string.json +++ b/aafwk/aafwk_standard/fa/fa_state_test/entry/src/main/resources/base/element/string.json @@ -1,12 +1,12 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "description_mainability", - "value": "JS_Empty Ability" - } - ] +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "JS_Empty Ability" + } + ] } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_state_test/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/fa/fa_state_test/signature/openharmony_sx.p7b old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/BUILD.gn b/aafwk/aafwk_standard/fa/fa_statelistener_test/BUILD.gn old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/Test.json b/aafwk/aafwk_standard/fa/fa_statelistener_test/Test.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/config.json b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/config.json old mode 100644 new mode 100755 index 3d6d3e6e0..f357e0836 --- a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/config.json +++ b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/config.json @@ -1,87 +1,87 @@ -{ - "app": { - "bundleName": "com.example.fenxdy", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.fenxdy", - "name": ".MyApplication", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_mainability", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "orientation": "unspecified", - "srcPath": "MainAbility2", - "name": ".MainAbility2", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_mainability2", - "formsEnabled": false, - "label": "$string:entry_MainAbility2", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility2", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } +{ + "app": { + "bundleName": "com.example.fenxdy", + "vendor": "example", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.fenxdy", + "name": ".MyApplication", + "mainAbility": ".MainAbility", + "srcPath": "", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "srcPath": "MainAbility2", + "name": ".MainAbility2", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability2", + "formsEnabled": false, + "label": "$string:entry_MainAbility2", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility2", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/app.js b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/app.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/i18n/en-US.json b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/i18n/en-US.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/i18n/zh-CN.json b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/i18n/zh-CN.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/pages/index/index.css b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/pages/index/index.css old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/pages/index/index.hml b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/pages/index/index.hml old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/pages/index/index.js b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/pages/index/index.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/pages/second/second.css b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/pages/second/second.css old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/pages/second/second.hml b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/pages/second/second.hml old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/pages/second/second.js b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility/pages/second/second.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/app.js b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/app.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/i18n/en-US.json b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/i18n/en-US.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/i18n/zh-CN.json b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/i18n/zh-CN.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/pages/index/index.css b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/pages/index/index.css old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/pages/index/index.hml b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/pages/index/index.hml old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/pages/index/index.js b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/pages/index/index.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/pages/second/second.css b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/pages/second/second.css old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/pages/second/second.hml b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/pages/second/second.hml old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/pages/second/second.js b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/MainAbility2/pages/second/second.js old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/test/List.test.js old mode 100644 new mode 100755 index 221d743dd..fd96c69b6 --- a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/test/List.test.js +++ b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/test/List.test.js @@ -1,18 +1,18 @@ - -/* - * 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. - */ - - + +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + require('./startFULL.test.js'); \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/test/startFULL.test.js b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/test/startFULL.test.js old mode 100644 new mode 100755 index 1040d8c2a..dc2b04339 --- a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/test/startFULL.test.js +++ b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/js/test/startFULL.test.js @@ -1,71 +1,71 @@ -/* - * 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. - */ -// @ts-nocheck -import appManager from '@ohos.application.appManager'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" - -var subscriberInfoMainAbility2 = { - events: ["SUB_AA_OpenHarmony_StateListener_0300_CommonEvent"], -}; - - -describe("appManagerTest", function () { - console.log("----appManagerTest is starting------"); - - /** - * @tc.number: SUB_AA_OpenHarmony_StateListener_0200 - * @tc.name: Re-call deregister listener interface validation - * @tc.desc: Function test - * @tc.level 0 - */ - it("SUB_AA_OpenHarmony_StateListener_0200", 0, async function (done) { - console.log("------------start SUB_AA_OpenHarmony_StateListener_0200-------------"); - var registerId = appManager.registerApplicationStateObserver({ - onForegroundApplicationChanged: (data) => { - console.log("SUB_onForegroundApplicationChanged") - }, - onAbilityStateChanged: (data) => { - console.log("SUB_onAbilityStateChanged") - }, - onProcessCreated: (data) => { - console.log("SUB_onProcessCreated") - }, - onProcessDied: (data) => { - console.log("SUB_onProcessDied") - } - }) - console.log('SUB_AA_OpenHarmony_StateListener_0200 registerId : ' + JSON.stringify(registerId)); - console.log('SUB_AA_OpenHarmony_StateListener_0200 registerId : ' + typeof registerId); - expect(typeof(registerId) == "number").assertTrue(); - - await appManager.unregisterApplicationStateObserver(registerId, async(err, data) => { - console.log("SUB_AA_OpenHarmony_StateListener_0200 err1:" - + JSON.stringify(err) + ",data: " + JSON.stringify(data)); - }) - await appManager.unregisterApplicationStateObserver(registerId, async(err, data) => { - console.log("SUB_AA_OpenHarmony_StateListener_0200 err2:" - + JSON.stringify(err) + ",data: " + JSON.stringify(data)); - expect(err.code == 1).assertTrue(); - done(); - }) - - }) - - -}) - - - - +/* + * 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. + */ +// @ts-nocheck +import appManager from '@ohos.application.appManager'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" + +var subscriberInfoMainAbility2 = { + events: ["SUB_AA_OpenHarmony_StateListener_0300_CommonEvent"], +}; + + +describe("appManagerTest", function () { + console.log("----appManagerTest is starting------"); + + /** + * @tc.number: SUB_AA_OpenHarmony_StateListener_0200 + * @tc.name: Re-call deregister listener interface validation + * @tc.desc: Function test + * @tc.level 0 + */ + it("SUB_AA_OpenHarmony_StateListener_0200", 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_StateListener_0200-------------"); + var registerId = appManager.registerApplicationStateObserver({ + onForegroundApplicationChanged: (data) => { + console.log("SUB_onForegroundApplicationChanged") + }, + onAbilityStateChanged: (data) => { + console.log("SUB_onAbilityStateChanged") + }, + onProcessCreated: (data) => { + console.log("SUB_onProcessCreated") + }, + onProcessDied: (data) => { + console.log("SUB_onProcessDied") + } + }) + console.log('SUB_AA_OpenHarmony_StateListener_0200 registerId : ' + JSON.stringify(registerId)); + console.log('SUB_AA_OpenHarmony_StateListener_0200 registerId : ' + typeof registerId); + expect(typeof(registerId) == "number").assertTrue(); + + await appManager.unregisterApplicationStateObserver(registerId, async(err, data) => { + console.log("SUB_AA_OpenHarmony_StateListener_0200 err1:" + + JSON.stringify(err) + ",data: " + JSON.stringify(data)); + }) + await appManager.unregisterApplicationStateObserver(registerId, async(err, data) => { + console.log("SUB_AA_OpenHarmony_StateListener_0200 err2:" + + JSON.stringify(err) + ",data: " + JSON.stringify(data)); + expect(err.code == 1).assertTrue(); + done(); + }) + + }) + + +}) + + + + diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/resources/base/element/string.json old mode 100644 new mode 100755 index 425cf6173..92f5ff8a4 --- a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/resources/base/element/string.json +++ b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/resources/base/element/string.json @@ -1,20 +1,20 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "description_mainability", - "value": "JS_Empty Ability" - }, - { - "name": "description_mainability2", - "value": "JS_Empty Ability" - }, - { - "name": "entry_MainAbility2", - "value": "entry_MainAbility2" - } - ] +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "JS_Empty Ability" + }, + { + "name": "description_mainability2", + "value": "JS_Empty Ability" + }, + { + "name": "entry_MainAbility2", + "value": "entry_MainAbility2" + } + ] } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/resources/base/media/icon.png b/aafwk/aafwk_standard/fa/fa_statelistener_test/entry/src/main/resources/base/media/icon.png old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_statelistener_test/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/fa/fa_statelistener_test/signature/openharmony_sx.p7b old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_sumstate_test/BUILD.gn b/aafwk/aafwk_standard/fa/fa_sumstate_test/BUILD.gn old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_sumstate_test/Test.json b/aafwk/aafwk_standard/fa/fa_sumstate_test/Test.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_sumstate_test/entry/src/main/config.json b/aafwk/aafwk_standard/fa/fa_sumstate_test/entry/src/main/config.json index a59289dd4..27aa861ea 100644 --- a/aafwk/aafwk_standard/fa/fa_sumstate_test/entry/src/main/config.json +++ b/aafwk/aafwk_standard/fa/fa_sumstate_test/entry/src/main/config.json @@ -1,113 +1,113 @@ -{ - "app": { - "bundleName": "com.example.sum_statelistener", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.sum_statelistener", - "name": ".MyApplication", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_mainability", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "orientation": "unspecified", - "srcPath": "MainAbility2", - "name": ".MainAbility2", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:description_mainability2", - "formsEnabled": false, - "label": "$string:entry_MainAbility2", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index", - "pages/second/second" - ], - "name": ".MainAbility2", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.GET_BUNDLE_INFO", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.RUNNING_STATE_OBSERVER", - "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", - "reason": "need use ohos.perILEGED" - }, - { - "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason": "need use ohos._PRIVILEGED" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason": "need use ohos._PRIVILEGED" - }, - { - "name": "ohos.permission.GET_RUNNING_INFO", - "reason": "need use ohos.permi" - } - ] - } +{ + "app": { + "bundleName": "com.example.sum_statelistener", + "vendor": "example", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.sum_statelistener", + "name": ".MyApplication", + "mainAbility": ".MainAbility", + "srcPath": "", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "srcPath": "MainAbility2", + "name": ".MainAbility2", + "srcLanguage": "js", + "icon": "$media:icon", + "description": "$string:description_mainability2", + "formsEnabled": false, + "label": "$string:entry_MainAbility2", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "pages": [ + "pages/index/index", + "pages/second/second" + ], + "name": ".MainAbility2", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.GET_BUNDLE_INFO", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.RUNNING_STATE_OBSERVER", + "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", + "reason": "need use ohos.perILEGED" + }, + { + "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason": "need use ohos._PRIVILEGED" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason": "need use ohos._PRIVILEGED" + }, + { + "name": "ohos.permission.GET_RUNNING_INFO", + "reason": "need use ohos.permi" + } + ] + } } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_sumstate_test/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/fa/fa_sumstate_test/entry/src/main/js/test/List.test.js index c97152de1..21f6f7f66 100644 --- a/aafwk/aafwk_standard/fa/fa_sumstate_test/entry/src/main/js/test/List.test.js +++ b/aafwk/aafwk_standard/fa/fa_sumstate_test/entry/src/main/js/test/List.test.js @@ -1,15 +1,15 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ require('./startFULL.test.js'); \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_sumstate_test/entry/src/main/js/test/startFULL.test.js b/aafwk/aafwk_standard/fa/fa_sumstate_test/entry/src/main/js/test/startFULL.test.js index 4e2717e0b..e527a8a68 100644 --- a/aafwk/aafwk_standard/fa/fa_sumstate_test/entry/src/main/js/test/startFULL.test.js +++ b/aafwk/aafwk_standard/fa/fa_sumstate_test/entry/src/main/js/test/startFULL.test.js @@ -1,201 +1,201 @@ -/* - * 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 appManager from '@ohos.application.appManager'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" -import featureAbility from '@ohos.ability.featureAbility'; -import abilityfeatureAbility from '@ohos.ability.featureAbility'; - -var assistData -var arr1 = [] -var AbilityStateChanged1 = [] -var ForegroundApplication1 = [] -var testData -var appbefore -var appafter -describe("appManagerTest", function () { - console.log("---appManagerTest-- starting---"); - - /** - * @tc.number: SUB_AA_OpenHarmony_StateListener_3200 - * @tc.name: Verify the onProcessDied callback - * @tc.desc: Function test - * @tc.level 0 - */ - it("SUB_AA_OpenHarmony_StateListener_3200", 0, async function (done) { - console.log("---start SUB_AA_OpenHarmony_StateListener_3200-----"); - await sleep(1000) - console.log("---start SUB_AA_OpenHarmony_StateListener_3200-----"); - var rest = appManager.registerApplicationStateObserver({ - onForegroundApplicationChanged: (aapData) => { - console.log("SUB_onForegroundApplicationChanged" + JSON.stringify(aapData)) - ForegroundApplication1.push(aapData); - console.log('ForegroundApplication :' + JSON.stringify(ForegroundApplication1)) - }, - onAbilityStateChanged: (StateData) => { - console.log("==onAbilityStateChanged1==>" + JSON.stringify(StateData)) - AbilityStateChanged1.push(StateData) - console.log('AbilityStateChanged1:' + JSON.stringify(AbilityStateChanged1)) - }, - onProcessCreated: (CreateData) => { - console.log("SUB_onProcessCreated" + JSON.stringify(CreateData)) - arr1.push('onProcessCreated', CreateData) - console.log('arr2:' + JSON.stringify(arr1)) - }, - onProcessDied: (ProcessData) => { - console.log("SUB_onProcessDied" + JSON.stringify(ProcessData)) - arr1.push('onProcessDied', ProcessData) - console.log("SUB_onProcessDied" + JSON.stringify(arr1)) - console.log('arr3:' + JSON.stringify(arr1)) - } - }) - await sleep(400); - var want = { - "bundleName": "com.example.fzstatelistener", - "abilityName": "com.example.fzstatelistener.MainAbility" - } - await featureAbility.startAbility({ want }).then().catch(); - await sleep(1000); - console.log('AbilityStateChanged1===>' + JSON.stringify(AbilityStateChanged1)) - console.log('ForegroundApplication1===>' + JSON.stringify(ForegroundApplication1)) - checkArr(arr1, AbilityStateChanged1, ForegroundApplication1) - done(); - }) - - function checkArr(arr, AbilityStateChanged, ForegroundApplication) { - console.log('==app1==:' + AbilityStateChanged.length) - if (arr == [] || AbilityStateChanged == [] || ForegroundApplication == []) { - expect().assertFail() - } - console.log('==check process==>strat' + JSON.stringify(arr)) - let process = getProcessData(arr, 'onProcessCreated') - console.log(' processlist :' + JSON.stringify(process)) - for (let i = 0;i < process.length; i++) { - console.log('==check process==> process[i] :' + JSON.stringify(process[i])) - if (process[i].bundleName == 'com.example.fzstatelistener') { - assistData = process[i] - console.log('==assistData==>' + JSON.stringify(assistData)) - } - } - - checkProcessData(assistData) - console.log('==app==:' + AbilityStateChanged.length) - for (let i = 0;i < AbilityStateChanged.length; i++) { - console.log('==appState==> :' + JSON.stringify(AbilityStateChanged[i])) - if (AbilityStateChanged[i].bundleName == 'com.example.fzstatelistener') { - assistData = AbilityStateChanged[i] - console.log('==check assistData==> :' + JSON.stringify(assistData)) - } - else if (AbilityStateChanged[i].bundleName == 'com.example.sum_statelistener') { - testData = AbilityStateChanged[i] - console.log('==check testData==> :' + JSON.stringify(testData)) - - } - } - if (testData == undefined || assistData == undefined) { - console.log('testData||assistData is null') - expect().assertFail() - } - checkAbilityStateData(assistData) - checkAbilityStateData2(testData) - console.log('==app==:' + ForegroundApplication.length) - for (let i = 0;i < ForegroundApplication.length; i++) { - console.log('==abilityState==>' + JSON.stringify(ForegroundApplication[i])) - if (ForegroundApplication[i].bundleName == 'com.example.fzstatelistener') { - assistData = ForegroundApplication[i] - console.log('==check assistData2==> :' + JSON.stringify(assistData)) - - } - else if (ForegroundApplication[i].bundleName == 'com.example.sum_statelistener') { - testData = ForegroundApplication[i] - console.log('==check testData2==> :' + JSON.stringify(testData)) - } - } - if (testData == undefined || assistData == undefined) { - console.log('testData||assistData is null') - expect().assertFail() - } - checkAppStateData(assistData) - checkAppStateData2(testData) - } - - function checkAbilityStateData2(list) { - console.log('==checkAbilityStateData2==>' + JSON.stringify(list)) - expect('com.example.sum_statelistener').assertEqual(list.bundleName) - expect('com.example.sum_statelistener.MainAbility').assertEqual(list.abilityName) - expect(list.pid > 0).assertTrue() - expect(list.uid > 0).assertTrue() - expect(3).assertEqual(list.state) - } - - function checkAbilityStateData(list) { - console.log('==checkAbilityStateData==>' + JSON.stringify(list)) - expect('com.example.fzstatelistener').assertEqual(list.bundleName) - expect('com.example.fzstatelistener.MainAbility').assertEqual(list.abilityName) - expect(list.pid > 0).assertTrue() - expect(list.uid > 0).assertTrue() - expect(2).assertEqual(list.state) - } - - function checkAppStateData2(list) { - console.log('==checkAppStateData2==>' + JSON.stringify(list)) - expect('com.example.sum_statelistener').assertEqual(list.bundleName) - expect(list.uid > 0).assertTrue() - expect(3).assertEqual(list.state) - } - - function checkAppStateData(list) { - console.log('==checkAppStateData==>' + JSON.stringify(list)) - expect('com.example.fzstatelistener').assertEqual(list.bundleName) - expect(list.uid > 0).assertTrue() - expect(2).assertEqual(list.state) - } - - function checkProcessData(list) { - console.log('==dhhFdh==>' + JSON.stringify(list)) - expect('com.example.fzstatelistener').assertEqual(list.bundleName) - console.log('==list.bundleName==>' + JSON.stringify(list.bundleName)) - expect(list.pid > 0).assertTrue() - console.log('==list.pid==>' + JSON.stringify(list.pid)) - expect(list.uid > 0).assertTrue() - console.log('==list.uid==>' + JSON.stringify(list.uid)) - } - - function getProcessData(reslist, key) { - console.log('getProcessData---start' + JSON.stringify(reslist)) - var listofkey = []; - for (let i = 0;i < reslist.length; i++) { - console.log('==getProcessData==> reslist[i] : ' + JSON.stringify(reslist[i])) - var callback = reslist[i] - console.log('==callback==> : ' + JSON.stringify(callback)) - if (callback == key) { - listofkey.push(reslist[i+1]) - console.log('==reslist[i+1]==> : ' + JSON.stringify(reslist[i+1])) - } - } - console.log('getProcessData' + JSON.stringify(listofkey)) - return listofkey - } - - function sleep(time) { - return new Promise((resolve) => setTimeout(resolve, time)) - } - -}) - - - - - - +/* + * 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 appManager from '@ohos.application.appManager'; +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" +import featureAbility from '@ohos.ability.featureAbility'; +import abilityfeatureAbility from '@ohos.ability.featureAbility'; + +var assistData +var arr1 = [] +var AbilityStateChanged1 = [] +var ForegroundApplication1 = [] +var testData +var appbefore +var appafter +describe("appManagerTest", function () { + console.log("---appManagerTest-- starting---"); + + /** + * @tc.number: SUB_AA_OpenHarmony_StateListener_3200 + * @tc.name: Verify the onProcessDied callback + * @tc.desc: Function test + * @tc.level 0 + */ + it("SUB_AA_OpenHarmony_StateListener_3200", 0, async function (done) { + console.log("---start SUB_AA_OpenHarmony_StateListener_3200-----"); + await sleep(1000) + console.log("---start SUB_AA_OpenHarmony_StateListener_3200-----"); + var rest = appManager.registerApplicationStateObserver({ + onForegroundApplicationChanged: (aapData) => { + console.log("SUB_onForegroundApplicationChanged" + JSON.stringify(aapData)) + ForegroundApplication1.push(aapData); + console.log('ForegroundApplication :' + JSON.stringify(ForegroundApplication1)) + }, + onAbilityStateChanged: (StateData) => { + console.log("==onAbilityStateChanged1==>" + JSON.stringify(StateData)) + AbilityStateChanged1.push(StateData) + console.log('AbilityStateChanged1:' + JSON.stringify(AbilityStateChanged1)) + }, + onProcessCreated: (CreateData) => { + console.log("SUB_onProcessCreated" + JSON.stringify(CreateData)) + arr1.push('onProcessCreated', CreateData) + console.log('arr2:' + JSON.stringify(arr1)) + }, + onProcessDied: (ProcessData) => { + console.log("SUB_onProcessDied" + JSON.stringify(ProcessData)) + arr1.push('onProcessDied', ProcessData) + console.log("SUB_onProcessDied" + JSON.stringify(arr1)) + console.log('arr3:' + JSON.stringify(arr1)) + } + }) + await sleep(400); + var want = { + "bundleName": "com.example.fzstatelistener", + "abilityName": "com.example.fzstatelistener.MainAbility" + } + await featureAbility.startAbility({ want }).then().catch(); + await sleep(1000); + console.log('AbilityStateChanged1===>' + JSON.stringify(AbilityStateChanged1)) + console.log('ForegroundApplication1===>' + JSON.stringify(ForegroundApplication1)) + checkArr(arr1, AbilityStateChanged1, ForegroundApplication1) + done(); + }) + + function checkArr(arr, AbilityStateChanged, ForegroundApplication) { + console.log('==app1==:' + AbilityStateChanged.length) + if (arr == [] || AbilityStateChanged == [] || ForegroundApplication == []) { + expect().assertFail() + } + console.log('==check process==>strat' + JSON.stringify(arr)) + let process = getProcessData(arr, 'onProcessCreated') + console.log(' processlist :' + JSON.stringify(process)) + for (let i = 0;i < process.length; i++) { + console.log('==check process==> process[i] :' + JSON.stringify(process[i])) + if (process[i].bundleName == 'com.example.fzstatelistener') { + assistData = process[i] + console.log('==assistData==>' + JSON.stringify(assistData)) + } + } + + checkProcessData(assistData) + console.log('==app==:' + AbilityStateChanged.length) + for (let i = 0;i < AbilityStateChanged.length; i++) { + console.log('==appState==> :' + JSON.stringify(AbilityStateChanged[i])) + if (AbilityStateChanged[i].bundleName == 'com.example.fzstatelistener') { + assistData = AbilityStateChanged[i] + console.log('==check assistData==> :' + JSON.stringify(assistData)) + } + else if (AbilityStateChanged[i].bundleName == 'com.example.sum_statelistener') { + testData = AbilityStateChanged[i] + console.log('==check testData==> :' + JSON.stringify(testData)) + + } + } + if (testData == undefined || assistData == undefined) { + console.log('testData||assistData is null') + expect().assertFail() + } + checkAbilityStateData(assistData) + checkAbilityStateData2(testData) + console.log('==app==:' + ForegroundApplication.length) + for (let i = 0;i < ForegroundApplication.length; i++) { + console.log('==abilityState==>' + JSON.stringify(ForegroundApplication[i])) + if (ForegroundApplication[i].bundleName == 'com.example.fzstatelistener') { + assistData = ForegroundApplication[i] + console.log('==check assistData2==> :' + JSON.stringify(assistData)) + + } + else if (ForegroundApplication[i].bundleName == 'com.example.sum_statelistener') { + testData = ForegroundApplication[i] + console.log('==check testData2==> :' + JSON.stringify(testData)) + } + } + if (testData == undefined || assistData == undefined) { + console.log('testData||assistData is null') + expect().assertFail() + } + checkAppStateData(assistData) + checkAppStateData2(testData) + } + + function checkAbilityStateData2(list) { + console.log('==checkAbilityStateData2==>' + JSON.stringify(list)) + expect('com.example.sum_statelistener').assertEqual(list.bundleName) + expect('com.example.sum_statelistener.MainAbility').assertEqual(list.abilityName) + expect(list.pid > 0).assertTrue() + expect(list.uid > 0).assertTrue() + expect(3).assertEqual(list.state) + } + + function checkAbilityStateData(list) { + console.log('==checkAbilityStateData==>' + JSON.stringify(list)) + expect('com.example.fzstatelistener').assertEqual(list.bundleName) + expect('com.example.fzstatelistener.MainAbility').assertEqual(list.abilityName) + expect(list.pid > 0).assertTrue() + expect(list.uid > 0).assertTrue() + expect(2).assertEqual(list.state) + } + + function checkAppStateData2(list) { + console.log('==checkAppStateData2==>' + JSON.stringify(list)) + expect('com.example.sum_statelistener').assertEqual(list.bundleName) + expect(list.uid > 0).assertTrue() + expect(3).assertEqual(list.state) + } + + function checkAppStateData(list) { + console.log('==checkAppStateData==>' + JSON.stringify(list)) + expect('com.example.fzstatelistener').assertEqual(list.bundleName) + expect(list.uid > 0).assertTrue() + expect(2).assertEqual(list.state) + } + + function checkProcessData(list) { + console.log('==dhhFdh==>' + JSON.stringify(list)) + expect('com.example.fzstatelistener').assertEqual(list.bundleName) + console.log('==list.bundleName==>' + JSON.stringify(list.bundleName)) + expect(list.pid > 0).assertTrue() + console.log('==list.pid==>' + JSON.stringify(list.pid)) + expect(list.uid > 0).assertTrue() + console.log('==list.uid==>' + JSON.stringify(list.uid)) + } + + function getProcessData(reslist, key) { + console.log('getProcessData---start' + JSON.stringify(reslist)) + var listofkey = []; + for (let i = 0;i < reslist.length; i++) { + console.log('==getProcessData==> reslist[i] : ' + JSON.stringify(reslist[i])) + var callback = reslist[i] + console.log('==callback==> : ' + JSON.stringify(callback)) + if (callback == key) { + listofkey.push(reslist[i+1]) + console.log('==reslist[i+1]==> : ' + JSON.stringify(reslist[i+1])) + } + } + console.log('getProcessData' + JSON.stringify(listofkey)) + return listofkey + } + + function sleep(time) { + return new Promise((resolve) => setTimeout(resolve, time)) + } + +}) + + + + + + diff --git a/aafwk/aafwk_standard/fa/fa_sumstate_test/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/fa/fa_sumstate_test/entry/src/main/resources/base/element/string.json index 425cf6173..92f5ff8a4 100644 --- a/aafwk/aafwk_standard/fa/fa_sumstate_test/entry/src/main/resources/base/element/string.json +++ b/aafwk/aafwk_standard/fa/fa_sumstate_test/entry/src/main/resources/base/element/string.json @@ -1,20 +1,20 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "description_mainability", - "value": "JS_Empty Ability" - }, - { - "name": "description_mainability2", - "value": "JS_Empty Ability" - }, - { - "name": "entry_MainAbility2", - "value": "entry_MainAbility2" - } - ] +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "JS_Empty Ability" + }, + { + "name": "description_mainability2", + "value": "JS_Empty Ability" + }, + { + "name": "entry_MainAbility2", + "value": "entry_MainAbility2" + } + ] } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_sumstate_test/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/fa/fa_sumstate_test/signature/openharmony_sx.p7b old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_taskmanager_test/entry/.gitignore b/aafwk/aafwk_standard/fa/fa_taskmanager_test/entry/.gitignore index 7d5b7a94f..f77260b15 100644 --- a/aafwk/aafwk_standard/fa/fa_taskmanager_test/entry/.gitignore +++ b/aafwk/aafwk_standard/fa/fa_taskmanager_test/entry/.gitignore @@ -1,2 +1,2 @@ -/build -/node_modules +/build +/node_modules diff --git a/aafwk/aafwk_standard/fa/fa_taskmanager_test/entry/build.gradle b/aafwk/aafwk_standard/fa/fa_taskmanager_test/entry/build.gradle index cef7b37de..c40c1f08c 100644 --- a/aafwk/aafwk_standard/fa/fa_taskmanager_test/entry/build.gradle +++ b/aafwk/aafwk_standard/fa/fa_taskmanager_test/entry/build.gradle @@ -1,21 +1,21 @@ -apply plugin: 'com.huawei.ohos.hap' -//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 -ohos { - compileSdkVersion 8 - defaultConfig { - compatibleSdkVersion 7 - } - buildTypes { - release { - proguardOpt { - proguardEnabled false - rulesFiles 'proguard-rules.pro' - } - } - } -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) - testImplementation 'junit:junit:4.13.1' -} +apply plugin: 'com.huawei.ohos.hap' +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 +ohos { + compileSdkVersion 8 + defaultConfig { + compatibleSdkVersion 7 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) + testImplementation 'junit:junit:4.13.1' +} diff --git a/aafwk/aafwk_standard/fa/fa_taskmanager_test/entry/package.json b/aafwk/aafwk_standard/fa/fa_taskmanager_test/entry/package.json index 0967ef424..69a88e3b6 100644 --- a/aafwk/aafwk_standard/fa/fa_taskmanager_test/entry/package.json +++ b/aafwk/aafwk_standard/fa/fa_taskmanager_test/entry/package.json @@ -1 +1 @@ -{} +{} diff --git a/aafwk/aafwk_standard/fa/fa_taskmanager_test/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/fa/fa_taskmanager_test/entry/src/main/js/test/List.test.js index 88bb2cf21..e51be7f60 100644 --- a/aafwk/aafwk_standard/fa/fa_taskmanager_test/entry/src/main/js/test/List.test.js +++ b/aafwk/aafwk_standard/fa/fa_taskmanager_test/entry/src/main/js/test/List.test.js @@ -1,16 +1,16 @@ -/* - * Copyright (c) 2022 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. - */ - +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + require('./MissionManagerTest.js'); \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_taskmanager_test/entry/src/main/js/test/MissionManagerTest.js b/aafwk/aafwk_standard/fa/fa_taskmanager_test/entry/src/main/js/test/MissionManagerTest.js index 84e31aca3..f94555b53 100644 --- a/aafwk/aafwk_standard/fa/fa_taskmanager_test/entry/src/main/js/test/MissionManagerTest.js +++ b/aafwk/aafwk_standard/fa/fa_taskmanager_test/entry/src/main/js/test/MissionManagerTest.js @@ -1,427 +1,427 @@ -// @ts-nocheck -/* - * Copyright (c) 2022 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" -import missionManager from '@ohos.application.missionManager'; -//import ability_featureAbility from '@ohos.ability.featureAbility'; - -describe('ShiAbilityDisableTest', function () { - var result - console.log("ShiAbilityDisableTest --- start"); - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_4000 - * @tc.name The interface parameter local id and is 1 - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_4000',0, async function (done){ - missionManager.getMissionInfos("", 1, (err, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_4000 AsyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code == 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_4100 - * @tc.name Interface parameter does not exist and 1 - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_4100', 0, async function (done) { - missionManager.getMissionInfos("aaaaaa", 1, (err, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_4100 AsyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code != 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_4200 - * @tc.name Interface parameter null and 1 - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_4200', 0, async function (done) { - missionManager.getMissionInfos('', 1, (err, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_4200 AsyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code == 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_4300 - * @tc.name Interface parameter null and 10 - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_4300', 0, async function (done) { - missionManager.getMissionInfos('', 10, (err, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_4300 AsyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code == 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_4400 - * @tc.name Interface parameter null and 1000 - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_4400', 0, async function (done){ - missionManager.getMissionInfos('', 1000, (err, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_4400 AsyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code == 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_4500 - * @tc.name Interface parameter null and null - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_4500', 0, async function (done){ - missionManager.getMissionInfos("", "", (err, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_4500 AsyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code != 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_4600 - * @tc.name Interface parameter null and string 1 - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_4600', 0, async function (done){ - missionManager.getMissionInfos("", "1", (err, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_4600 AsyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code != 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_4700 - * @tc.name Interface parameter null and floating point number - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_4700', 0, async function (done){ - missionManager.getMissionInfos('', 2.0, (err, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_4700 AsyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code == 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_4800 - * @tc.name Interface parameter null and null - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_4800', 0, async function (done){ - missionManager.getMissionInfos("", "", (err, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_4800 AsyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_4900 - * @tc.name Interface parameter does not exist and null - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_4900', 0, async function (done){ - missionManager.getMissionInfos("bbbb", "", (err, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_4900 AsyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code != 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_5000 - * @tc.name Interface parameter does not exist and 1 - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_5000', 0, async function (done){ - missionManager.getMissionInfos("", 1, (err, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_5000 AsyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code != 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_5100 - * @tc.name Interface parameter null and null - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_5100', 0, async function (done){ - missionManager.getMissionInfos("", "", (err, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_5100 AsyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_5200 - * @tc.name Interface parameter null and id - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_5200', 0, async function (done){ - var id = 65024; - missionManager.getMissionInfos("", id, (err, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_5200 AsyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code != 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_5300 - * @tc.name Interface parameter null and null - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_5300', 0, async function (done) { - missionManager.getMissionInfo('', '', (err, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_5300 AsyncCallback errCode ##: ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code != 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_5400 - * @tc.name Interface parameter null and string - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_5400', 0, async function (done) { - missionManager.getMissionInfo('', "aa", (err, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_5400 AsyncCallback errCode ##: ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code != 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_5500 - * @tc.name Interface parameter null and float - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_5500', 0, async function (done){ - missionManager.getMissionInfos("", 2.0, (err, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_5500 AsyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_5600 - * @tc.name Interface parameter undefined - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_5600', 0, async function (done) { - let object = undefined - var result = missionManager.registerMissionListener(object); - console.log('SUB_AA_OpenHarmony_MissionManager_5600 result ###' + JSON.stringify(result)); - expect(result != undefined).assertTrue(); - done(); - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_5700 - * @tc.name Interface parameter Empty object - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_5700', 0, async function (done) { - let object = {} - var result = missionManager.registerMissionListener(object); - console.log('SUB_AA_OpenHarmony_MissionManager_5700 result ### ' + JSON.stringify(object)); - console.log('SUB_AA_OpenHarmony_MissionManager_5700 result ### ' + JSON.stringify(result)); - expect(result != undefined).assertTrue(); - done(); - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_5800 - * @tc.name Multiple registration listening - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_5800', 0, async function (done){ - for(let i = 0; i< 5; i++){ - result = missionManager.registerMissionListener({ - onMissionCreated:function onMissionCreated(number){ - console.log("SUB_onForegroundApplicationChanged") - }, - onMissionDestroyed:function onMissionDestroyed(number){ - console.log("SUB_onAbilityStateChanged") - }, - onMissionSnapshotChanged:function onMissionSnapshotChanged(number){ - console.log("SUB_onProcessCreated") - }, - onMissionMovedToFront:function onMissionMovedToFront(number){ - console.log("SUB_onProcessDied") - }, - }); - console.log('SUB_AA_OpenHarmony_MissionManager_5800 result ### ' + JSON.stringify(result)); - expect(result != undefined).assertTrue(); - done(); - } - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_5900 - * @tc.name Interface parameter non-existent - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_5900', 0, async function (done) { - console.log("---------start SUB_AA_OpenHarmony_MissionManager_5900------------") - var id = 44642; - missionManager.unregisterMissionListener(id, (err, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_5900 AsyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code == 0).assertTrue(); - done(); - }) - console.log("---------start SUB_AA_OpenHarmony_MissionManager_5900------------") - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_6000 - * @tc.name Interface parameter Registered ID - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_6000', 0, async function (done){ - missionManager.unregisterMissionListener(result, (err, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_6000 AsyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code == 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_6100 - * @tc.name Interface parameter Unregistered ID - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_6100', 0, async function (done){ - missionManager.unregisterMissionListener(result, (err, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_6100 AsyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code == 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_6200 - * @tc.name Interface parameter undefined - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_6200', 0, async function (done){ - let listenerId = undefined - missionManager.unregisterMissionListener(listenerId, (err, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_6200 AsyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code != 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_6300 - * @tc.name Interface parameter null - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_6300', 0, async function (done) { - missionManager.unregisterMissionListener(null, (err, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_6300 AsyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code != 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_6400 - * @tc.name Interface parameter string - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_6400', 0, async function (done){ - missionManager.unregisterMissionListener('cc', (err, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_6400 AsyncCallback errCode : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code != 0).assertTrue(); - done(); - }) - }) - - /* - * @tc.number SUB_AA_OpenHarmony_MissionManager_6500 - * @tc.name Interface parameter float - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MissionManager_6500', 0, async function (done){ - missionManager.unregisterMissionListener(2.0, (err, data) => { - console.log('SUB_AA_OpenHarmony_MissionManager_6500 AsyncCallback errCode123123 : ' - + JSON.stringify(err) + " data: " + JSON.stringify(data)); - expect(err.code == 0).assertTrue(); - done(); - }) - }) +// @ts-nocheck +/* + * Copyright (c) 2022 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" +import missionManager from '@ohos.application.missionManager'; +//import ability_featureAbility from '@ohos.ability.featureAbility'; + +describe('ShiAbilityDisableTest', function () { + var result + console.log("ShiAbilityDisableTest --- start"); + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_4000 + * @tc.name The interface parameter local id and is 1 + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_4000',0, async function (done){ + missionManager.getMissionInfos("", 1, (err, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_4000 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code == 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_4100 + * @tc.name Interface parameter does not exist and 1 + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_4100', 0, async function (done) { + missionManager.getMissionInfos("aaaaaa", 1, (err, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_4100 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code != 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_4200 + * @tc.name Interface parameter null and 1 + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_4200', 0, async function (done) { + missionManager.getMissionInfos('', 1, (err, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_4200 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code == 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_4300 + * @tc.name Interface parameter null and 10 + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_4300', 0, async function (done) { + missionManager.getMissionInfos('', 10, (err, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_4300 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code == 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_4400 + * @tc.name Interface parameter null and 1000 + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_4400', 0, async function (done){ + missionManager.getMissionInfos('', 1000, (err, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_4400 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code == 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_4500 + * @tc.name Interface parameter null and null + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_4500', 0, async function (done){ + missionManager.getMissionInfos("", "", (err, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_4500 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code != 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_4600 + * @tc.name Interface parameter null and string 1 + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_4600', 0, async function (done){ + missionManager.getMissionInfos("", "1", (err, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_4600 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code != 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_4700 + * @tc.name Interface parameter null and floating point number + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_4700', 0, async function (done){ + missionManager.getMissionInfos('', 2.0, (err, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_4700 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code == 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_4800 + * @tc.name Interface parameter null and null + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_4800', 0, async function (done){ + missionManager.getMissionInfos("", "", (err, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_4800 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_4900 + * @tc.name Interface parameter does not exist and null + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_4900', 0, async function (done){ + missionManager.getMissionInfos("bbbb", "", (err, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_4900 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code != 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_5000 + * @tc.name Interface parameter does not exist and 1 + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_5000', 0, async function (done){ + missionManager.getMissionInfos("", 1, (err, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_5000 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code != 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_5100 + * @tc.name Interface parameter null and null + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_5100', 0, async function (done){ + missionManager.getMissionInfos("", "", (err, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_5100 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_5200 + * @tc.name Interface parameter null and id + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_5200', 0, async function (done){ + var id = 65024; + missionManager.getMissionInfos("", id, (err, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_5200 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code != 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_5300 + * @tc.name Interface parameter null and null + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_5300', 0, async function (done) { + missionManager.getMissionInfo('', '', (err, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_5300 AsyncCallback errCode ##: ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code != 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_5400 + * @tc.name Interface parameter null and string + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_5400', 0, async function (done) { + missionManager.getMissionInfo('', "aa", (err, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_5400 AsyncCallback errCode ##: ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code != 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_5500 + * @tc.name Interface parameter null and float + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_5500', 0, async function (done){ + missionManager.getMissionInfos("", 2.0, (err, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_5500 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_5600 + * @tc.name Interface parameter undefined + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_5600', 0, async function (done) { + let object = undefined + var result = missionManager.registerMissionListener(object); + console.log('SUB_AA_OpenHarmony_MissionManager_5600 result ###' + JSON.stringify(result)); + expect(result != undefined).assertTrue(); + done(); + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_5700 + * @tc.name Interface parameter Empty object + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_5700', 0, async function (done) { + let object = {} + var result = missionManager.registerMissionListener(object); + console.log('SUB_AA_OpenHarmony_MissionManager_5700 result ### ' + JSON.stringify(object)); + console.log('SUB_AA_OpenHarmony_MissionManager_5700 result ### ' + JSON.stringify(result)); + expect(result != undefined).assertTrue(); + done(); + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_5800 + * @tc.name Multiple registration listening + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_5800', 0, async function (done){ + for(let i = 0; i< 5; i++){ + result = missionManager.registerMissionListener({ + onMissionCreated:function onMissionCreated(number){ + console.log("SUB_onForegroundApplicationChanged") + }, + onMissionDestroyed:function onMissionDestroyed(number){ + console.log("SUB_onAbilityStateChanged") + }, + onMissionSnapshotChanged:function onMissionSnapshotChanged(number){ + console.log("SUB_onProcessCreated") + }, + onMissionMovedToFront:function onMissionMovedToFront(number){ + console.log("SUB_onProcessDied") + }, + }); + console.log('SUB_AA_OpenHarmony_MissionManager_5800 result ### ' + JSON.stringify(result)); + expect(result != undefined).assertTrue(); + done(); + } + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_5900 + * @tc.name Interface parameter non-existent + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_5900', 0, async function (done) { + console.log("---------start SUB_AA_OpenHarmony_MissionManager_5900------------") + var id = 44642; + missionManager.unregisterMissionListener(id, (err, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_5900 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code == 0).assertTrue(); + done(); + }) + console.log("---------start SUB_AA_OpenHarmony_MissionManager_5900------------") + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_6000 + * @tc.name Interface parameter Registered ID + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_6000', 0, async function (done){ + missionManager.unregisterMissionListener(result, (err, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_6000 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code == 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_6100 + * @tc.name Interface parameter Unregistered ID + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_6100', 0, async function (done){ + missionManager.unregisterMissionListener(result, (err, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_6100 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code == 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_6200 + * @tc.name Interface parameter undefined + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_6200', 0, async function (done){ + let listenerId = undefined + missionManager.unregisterMissionListener(listenerId, (err, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_6200 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code != 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_6300 + * @tc.name Interface parameter null + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_6300', 0, async function (done) { + missionManager.unregisterMissionListener(null, (err, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_6300 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code != 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_6400 + * @tc.name Interface parameter string + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_6400', 0, async function (done){ + missionManager.unregisterMissionListener('cc', (err, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_6400 AsyncCallback errCode : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code != 0).assertTrue(); + done(); + }) + }) + + /* + * @tc.number SUB_AA_OpenHarmony_MissionManager_6500 + * @tc.name Interface parameter float + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MissionManager_6500', 0, async function (done){ + missionManager.unregisterMissionListener(2.0, (err, data) => { + console.log('SUB_AA_OpenHarmony_MissionManager_6500 AsyncCallback errCode123123 : ' + + JSON.stringify(err) + " data: " + JSON.stringify(data)); + expect(err.code == 0).assertTrue(); + done(); + }) + }) }) \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_taskmanager_test/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/fa/fa_taskmanager_test/entry/src/main/resources/base/element/string.json index 7603e007f..d5f23d474 100644 --- a/aafwk/aafwk_standard/fa/fa_taskmanager_test/entry/src/main/resources/base/element/string.json +++ b/aafwk/aafwk_standard/fa/fa_taskmanager_test/entry/src/main/resources/base/element/string.json @@ -1,44 +1,44 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "description_mainability", - "value": "JS_Empty Ability" - }, - { - "name": "description_mainability2", - "value": "JS_Empty Ability" - }, - { - "name": "entry_MainAbility2", - "value": "entry_MainAbility2" - }, - { - "name": "description_mainability3", - "value": "JS_Empty Ability" - }, - { - "name": "entry_MainAbility3", - "value": "entry_MainAbility3" - }, - { - "name": "description_mainability4", - "value": "JS_Empty Ability" - }, - { - "name": "entry_MainAbility4", - "value": "entry_MainAbility4" - }, - { - "name": "description_mainability5", - "value": "JS_Empty Ability" - }, - { - "name": "entry_MainAbility5", - "value": "entry_MainAbility5" - } - ] +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "JS_Empty Ability" + }, + { + "name": "description_mainability2", + "value": "JS_Empty Ability" + }, + { + "name": "entry_MainAbility2", + "value": "entry_MainAbility2" + }, + { + "name": "description_mainability3", + "value": "JS_Empty Ability" + }, + { + "name": "entry_MainAbility3", + "value": "entry_MainAbility3" + }, + { + "name": "description_mainability4", + "value": "JS_Empty Ability" + }, + { + "name": "entry_MainAbility4", + "value": "entry_MainAbility4" + }, + { + "name": "description_mainability5", + "value": "JS_Empty Ability" + }, + { + "name": "entry_MainAbility5", + "value": "entry_MainAbility5" + } + ] } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_taskswiting_test/BUILD.gn b/aafwk/aafwk_standard/fa/fa_taskswiting_test/BUILD.gn old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_taskswiting_test/Test.json b/aafwk/aafwk_standard/fa/fa_taskswiting_test/Test.json old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/fa/fa_taskswiting_test/entry/src/main/js/test/List.test.js b/aafwk/aafwk_standard/fa/fa_taskswiting_test/entry/src/main/js/test/List.test.js index 5bc7d34ed..95f7b53fa 100644 --- a/aafwk/aafwk_standard/fa/fa_taskswiting_test/entry/src/main/js/test/List.test.js +++ b/aafwk/aafwk_standard/fa/fa_taskswiting_test/entry/src/main/js/test/List.test.js @@ -1,16 +1,16 @@ -/* - * 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. - */ - +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + require('./taskSwitchJsunit.test.js') \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_taskswiting_test/entry/src/main/js/test/taskSwitchJsunit.test.js b/aafwk/aafwk_standard/fa/fa_taskswiting_test/entry/src/main/js/test/taskSwitchJsunit.test.js index ea84d2ef6..c60d35c17 100644 --- a/aafwk/aafwk_standard/fa/fa_taskswiting_test/entry/src/main/js/test/taskSwitchJsunit.test.js +++ b/aafwk/aafwk_standard/fa/fa_taskswiting_test/entry/src/main/js/test/taskSwitchJsunit.test.js @@ -1,338 +1,338 @@ -// @ts-nocheck -/* - * 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 {describe, expect, it} from 'deccjsunit/index' -import missionManager from '@ohos.application.missionManager' -import featureAbility from '@ohos.ability.featureability' - -describe("taskSwitchTest", function() { - console.log("------------------ taskSwitchTest is starting ------------------"); - - var TAG = ""; - - /* - * @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_0100 - * @tc.name Switching the mission in the launcherlist to the foreground is not supported - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MoveMissionToFront_0100', 0, async function (done) { - console.log("------------start SUB_AA_OpenHarmony_MoveMissionToFront_0100-------------"); - var missionId = 1; - try { - missionManager.moveMissionToFront(missionId, (error, data) => { - console.log("SUB_AA_OpenHarmony_MoveMissionToFront_0100 error: " + - JSON.stringify(error) + ", data: " + JSON.stringify(data)); - expect(error.code == 2097181).assertTrue(); - done(); - }) - } catch(error) { - console.log("SUB_AA_OpenHarmony_MoveMissionToFront_0100: error " + error); - } - console.log("------------end SUB_AA_OpenHarmony_MoveMissionToFront_0100-------------"); - }); - - /* - * @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_2400 - * @tc.name The input parameter missionid of movemissiontorfront is undefined - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MoveMissionToFront_2400', 0, async function (done) { - console.log("------------start SUB_AA_OpenHarmony_MoveMissionToFront_2400-------------"); - var missionId = undefined; - try { - missionManager.moveMissionToFront(missionId, (error, data) => { - console.log("SUB_AA_OpenHarmony_MoveMissionToFront_2400 error: " + - JSON.stringify(error) + ", data: " + JSON.stringify(data)); - expect(error.code == -1).assertTrue(); - done(); - }) - } catch(error) { - console.log("SUB_AA_OpenHarmony_MoveMissionToFront_2400: error " + error); - } - console.log("------------end SUB_AA_OpenHarmony_MoveMissionToFront_2400-------------"); - }); - - /* - * @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_2500 - * @tc.name The input parameter missionid of movemissiontorfront is an ID that does not exist - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MoveMissionToFront_2500', 0, async function (done) { - console.log("------------start SUB_AA_OpenHarmony_MoveMissionToFront_2500-------------"); - var missionId = -1; - try { - missionManager.moveMissionToFront(missionId, (error, data) => { - console.log("SUB_AA_OpenHarmony_MoveMissionToFront_2500 error: " + - JSON.stringify(error) + ", data: " + JSON.stringify(data)); - expect(error.code == 2097181).assertTrue(); - done(); - }) - } catch(error) { - console.log("SUB_AA_OpenHarmony_MoveMissionToFront_2500: error " + error); - } - console.log("------------end SUB_AA_OpenHarmony_MoveMissionToFront_2500-------------"); - }); - - /* - * @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_2600 - * @tc.name The input parameter missionid of movemissiontorfront is a number of type string - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MoveMissionToFront_2600', 0, async function (done) { - console.log("------------start SUB_AA_OpenHarmony_MoveMissionToFront_2600-------------"); - var missionId = "2"; - try { - missionManager.moveMissionToFront(missionId, (error, data) => { - console.log("SUB_AA_OpenHarmony_MoveMissionToFront_2600 error: " + - JSON.stringify(error) + ", data: " + JSON.stringify(data)); - expect(error.code == -1).assertTrue(); - done(); - }) - } catch(error) { - console.log("SUB_AA_OpenHarmony_MoveMissionToFront_2600: error " + error); - } - console.log("------------end SUB_AA_OpenHarmony_MoveMissionToFront_2600-------------"); - }); - - /* - * @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_2700 - * @tc.name The input parameter missionid of movemissiontorfront is a non numeric string - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MoveMissionToFront_2700', 0, async function (done) { - console.log("------------start SUB_AA_OpenHarmony_MoveMissionToFront_2700-------------"); - var missionId = "aa"; - try { - missionManager.moveMissionToFront(missionId, (error, data) => { - console.log("SUB_AA_OpenHarmony_MoveMissionToFront_2700 error: " + - JSON.stringify(error) + ", data: " + JSON.stringify(data)); - expect(error.code == -1).assertTrue(); - done(); - }) - } catch(error) { - console.log("SUB_AA_OpenHarmony_MoveMissionToFront_2700: error " + error); - } - console.log("------------end SUB_AA_OpenHarmony_MoveMissionToFront_2700-------------"); - }); - - /* - * @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_1900 - * @tc.name Switching the mission in the launcherlist to the foreground is not supported - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MoveMissionToFront_1900', 0, async function (done) { - console.log("------------start SUB_AA_OpenHarmony_MoveMissionToFront_1900-------------"); - TAG = "SUB_AA_OpenHarmony_MoveMissionToFront_1900" - var abilityMissionList = [] - var missionid = ""; - var result = missionManager.registerMissionListener({ - onMissionCreated: (missionid) => { - console.log(TAG + "onMissionCreated callback") - }, - onMissionDestroyed: (missionid) => { - console.log(TAG + "onMissionDestroyed callback") - } - }) - - setTimeout(function(){ - featureAbility.startAbility({ - want: { - bundleName: "com.example.taskswitching", - abilityName: "com.example.taskswitching.MainAbility2" - } - }, (error, data) => { - console.log(TAG + " startAbility success, error: " - + JSON.stringify(error) + ", data: " + JSON.stringify(data)); - }); - }, 2000) - - setTimeout(function(){ - missionManager.getMissionInfos("", 20, (error, data) => { - console.log(TAG + "Emtry MainAbility getMissionInfos success, error: " - + JSON.stringify(error) + ", data: " + JSON.stringify(data)); - for(var i = 0; i { - console.log(TAG + "Emtry MainAbility clearAllMissions success, error: " - + JSON.stringify(error) + ", data: " + JSON.stringify(data)); - }) - },3000) - - setTimeout(function(){ - console.log(TAG + "result is : " + result) - expect(result != "").assertTrue(); - done() - }, 4000); - console.log("------------end SUB_AA_OpenHarmony_MoveMissionToFront_1900-------------"); - }); - - /* - * @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_2000 - * @tc.name Switching the mission in the launcherlist to the foreground is not supported - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MoveMissionToFront_2000', 0, async function (done) { - console.log("------------start SUB_AA_OpenHarmony_MoveMissionToFront_2000-------------"); - TAG = "SUB_AA_OpenHarmony_MoveMissionToFront_2000" - var missionid = ""; - - var result = missionManager.registerMissionListener({ - onMissionSnapshotChanged: (missionid) => { - console.log(TAG + "onMissionSnaptShotChanged callback") - } - }) - - setTimeout(function() { - featureAbility.startAbility({ - want: { - bundleName: "com.example.taskswitching", - abilityName: "com.example.taskswitching.MainAbility2" - } - }, (error, data) => { - console.log(TAG + " startAbility success, error: " - + JSON.stringify(error) + ", data: " + JSON.stringify(data)); - }); - }, 3000) - - setTimeout(function() { - console.log(TAG + "result is : " + result) - expect(result != "").assertTrue(); - done() - }, 4000) - console.log("------------end SUB_AA_OpenHarmony_MoveMissionToFront_2000-------------"); - }); - - /* - * @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_2100 - * @tc.name Switching the mission in the launcherlist to the foreground is not supported - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MoveMissionToFront_2100', 0, async function (done) { - console.log("------------start SUB_AA_OpenHarmony_MoveMissionToFront_2100-------------"); - TAG = "SUB_AA_OpenHarmony_MoveMissionToFront_2100" - var abilityMissionList =[]; - var missionid = ""; - - var result = missionManager.registerMissionListener({ - onMissionMovedToFront: (missionid) => { - console.log(TAG + "onMissionMovedToFront callback") - } - }) - - setTimeout(function() { - featureAbility.startAbility({ - want: { - bundleName: "com.example.taskswitching", - abilityName: "com.example.taskswitching.MainAbility2" - } - }, (error, data) => { - console.log(TAG + " startAbility success, error: " - + JSON.stringify(error) + ", data: " + JSON.stringify(data)); - }); - }, 2000) - - - setTimeout(function(){ - missionManager.getMissionInfos("", 20, (error, data) => { - console.log(TAG + "Emtry MainAbility getMissionInfos success, error: " - + JSON.stringify(error) + ", data: " + JSON.stringify(data)); - for(var i = 0; i { - console.log(TAG + "MainAbility moveMissionToFront success, error: " - + JSON.stringify(error) + ", data: " + JSON.stringify(data)); - }); - }, 4000) - - setTimeout(function() { - console.log(TAG + "result is : " + result) - expect(result != "").assertTrue(); - done() - }, 4500) - console.log("------------end SUB_AA_OpenHarmony_MoveMissionToFront_2100-------------"); - }); - - - /* - * @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_2900 - * @tc.name Switching the mission in the launcherlist to the foreground is not supported - * @tc.desc Function test - * @tc.level 0 - */ - it('SUB_AA_OpenHarmony_MoveMissionToFront_2900', 0, async function (done) { - console.log("------------start SUB_AA_OpenHarmony_MoveMissionToFront_2900-------------"); - TAG = "SUB_AA_OpenHarmony_MoveMissionToFront_2900" - var abilityMissionList = []; - setTimeout(function(){ - featureAbility.startAbility({ - want: { - bundleName : "com.example.taskswitching", - abilityName : "com.example.taskswitching.MainAbility2" - } - }, (error, data) => { - console.log(TAG + " startAbility success, error: " - + JSON.stringify(error) + ", data: " + JSON.stringify(data)); - }); - }, 1000); - - setTimeout(function(){ - missionManager.getMissionInfos("", 20, (error, data) => { - console.log(TAG + "Emtry MainAbility2 getMissionInfos success, error: " - + JSON.stringify(error) + ", data: " + JSON.stringify(data)); - - for(var i = 0; i { - console.log(TAG + "getMissionSnapShot success, err: " - + JSON.stringify(err) + ", data: " + JSON.stringify(data)) - expect(JSON.stringify(data.ability.bundleName) == "com.example.taskswitching") - done() - }) - }, 4000) - console.log("------------end SUB_AA_OpenHarmony_MoveMissionToFront_2900-------------"); - }); - - console.log("------------------ taskSwitchTest is end ------------------"); -}) +// @ts-nocheck +/* + * 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 {describe, expect, it} from 'deccjsunit/index' +import missionManager from '@ohos.application.missionManager' +import featureAbility from '@ohos.ability.featureability' + +describe("taskSwitchTest", function() { + console.log("------------------ taskSwitchTest is starting ------------------"); + + var TAG = ""; + + /* + * @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_0100 + * @tc.name Switching the mission in the launcherlist to the foreground is not supported + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MoveMissionToFront_0100', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_MoveMissionToFront_0100-------------"); + var missionId = 1; + try { + missionManager.moveMissionToFront(missionId, (error, data) => { + console.log("SUB_AA_OpenHarmony_MoveMissionToFront_0100 error: " + + JSON.stringify(error) + ", data: " + JSON.stringify(data)); + expect(error.code == 2097181).assertTrue(); + done(); + }) + } catch(error) { + console.log("SUB_AA_OpenHarmony_MoveMissionToFront_0100: error " + error); + } + console.log("------------end SUB_AA_OpenHarmony_MoveMissionToFront_0100-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_2400 + * @tc.name The input parameter missionid of movemissiontorfront is undefined + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MoveMissionToFront_2400', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_MoveMissionToFront_2400-------------"); + var missionId = undefined; + try { + missionManager.moveMissionToFront(missionId, (error, data) => { + console.log("SUB_AA_OpenHarmony_MoveMissionToFront_2400 error: " + + JSON.stringify(error) + ", data: " + JSON.stringify(data)); + expect(error.code == -1).assertTrue(); + done(); + }) + } catch(error) { + console.log("SUB_AA_OpenHarmony_MoveMissionToFront_2400: error " + error); + } + console.log("------------end SUB_AA_OpenHarmony_MoveMissionToFront_2400-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_2500 + * @tc.name The input parameter missionid of movemissiontorfront is an ID that does not exist + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MoveMissionToFront_2500', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_MoveMissionToFront_2500-------------"); + var missionId = -1; + try { + missionManager.moveMissionToFront(missionId, (error, data) => { + console.log("SUB_AA_OpenHarmony_MoveMissionToFront_2500 error: " + + JSON.stringify(error) + ", data: " + JSON.stringify(data)); + expect(error.code == 2097181).assertTrue(); + done(); + }) + } catch(error) { + console.log("SUB_AA_OpenHarmony_MoveMissionToFront_2500: error " + error); + } + console.log("------------end SUB_AA_OpenHarmony_MoveMissionToFront_2500-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_2600 + * @tc.name The input parameter missionid of movemissiontorfront is a number of type string + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MoveMissionToFront_2600', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_MoveMissionToFront_2600-------------"); + var missionId = "2"; + try { + missionManager.moveMissionToFront(missionId, (error, data) => { + console.log("SUB_AA_OpenHarmony_MoveMissionToFront_2600 error: " + + JSON.stringify(error) + ", data: " + JSON.stringify(data)); + expect(error.code == -1).assertTrue(); + done(); + }) + } catch(error) { + console.log("SUB_AA_OpenHarmony_MoveMissionToFront_2600: error " + error); + } + console.log("------------end SUB_AA_OpenHarmony_MoveMissionToFront_2600-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_2700 + * @tc.name The input parameter missionid of movemissiontorfront is a non numeric string + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MoveMissionToFront_2700', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_MoveMissionToFront_2700-------------"); + var missionId = "aa"; + try { + missionManager.moveMissionToFront(missionId, (error, data) => { + console.log("SUB_AA_OpenHarmony_MoveMissionToFront_2700 error: " + + JSON.stringify(error) + ", data: " + JSON.stringify(data)); + expect(error.code == -1).assertTrue(); + done(); + }) + } catch(error) { + console.log("SUB_AA_OpenHarmony_MoveMissionToFront_2700: error " + error); + } + console.log("------------end SUB_AA_OpenHarmony_MoveMissionToFront_2700-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_1900 + * @tc.name Switching the mission in the launcherlist to the foreground is not supported + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MoveMissionToFront_1900', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_MoveMissionToFront_1900-------------"); + TAG = "SUB_AA_OpenHarmony_MoveMissionToFront_1900" + var abilityMissionList = [] + var missionid = ""; + var result = missionManager.registerMissionListener({ + onMissionCreated: (missionid) => { + console.log(TAG + "onMissionCreated callback") + }, + onMissionDestroyed: (missionid) => { + console.log(TAG + "onMissionDestroyed callback") + } + }) + + setTimeout(function(){ + featureAbility.startAbility({ + want: { + bundleName: "com.example.taskswitching", + abilityName: "com.example.taskswitching.MainAbility2" + } + }, (error, data) => { + console.log(TAG + " startAbility success, error: " + + JSON.stringify(error) + ", data: " + JSON.stringify(data)); + }); + }, 2000) + + setTimeout(function(){ + missionManager.getMissionInfos("", 20, (error, data) => { + console.log(TAG + "Emtry MainAbility getMissionInfos success, error: " + + JSON.stringify(error) + ", data: " + JSON.stringify(data)); + for(var i = 0; i { + console.log(TAG + "Emtry MainAbility clearAllMissions success, error: " + + JSON.stringify(error) + ", data: " + JSON.stringify(data)); + }) + },3000) + + setTimeout(function(){ + console.log(TAG + "result is : " + result) + expect(result != "").assertTrue(); + done() + }, 4000); + console.log("------------end SUB_AA_OpenHarmony_MoveMissionToFront_1900-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_2000 + * @tc.name Switching the mission in the launcherlist to the foreground is not supported + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MoveMissionToFront_2000', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_MoveMissionToFront_2000-------------"); + TAG = "SUB_AA_OpenHarmony_MoveMissionToFront_2000" + var missionid = ""; + + var result = missionManager.registerMissionListener({ + onMissionSnapshotChanged: (missionid) => { + console.log(TAG + "onMissionSnaptShotChanged callback") + } + }) + + setTimeout(function() { + featureAbility.startAbility({ + want: { + bundleName: "com.example.taskswitching", + abilityName: "com.example.taskswitching.MainAbility2" + } + }, (error, data) => { + console.log(TAG + " startAbility success, error: " + + JSON.stringify(error) + ", data: " + JSON.stringify(data)); + }); + }, 3000) + + setTimeout(function() { + console.log(TAG + "result is : " + result) + expect(result != "").assertTrue(); + done() + }, 4000) + console.log("------------end SUB_AA_OpenHarmony_MoveMissionToFront_2000-------------"); + }); + + /* + * @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_2100 + * @tc.name Switching the mission in the launcherlist to the foreground is not supported + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MoveMissionToFront_2100', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_MoveMissionToFront_2100-------------"); + TAG = "SUB_AA_OpenHarmony_MoveMissionToFront_2100" + var abilityMissionList =[]; + var missionid = ""; + + var result = missionManager.registerMissionListener({ + onMissionMovedToFront: (missionid) => { + console.log(TAG + "onMissionMovedToFront callback") + } + }) + + setTimeout(function() { + featureAbility.startAbility({ + want: { + bundleName: "com.example.taskswitching", + abilityName: "com.example.taskswitching.MainAbility2" + } + }, (error, data) => { + console.log(TAG + " startAbility success, error: " + + JSON.stringify(error) + ", data: " + JSON.stringify(data)); + }); + }, 2000) + + + setTimeout(function(){ + missionManager.getMissionInfos("", 20, (error, data) => { + console.log(TAG + "Emtry MainAbility getMissionInfos success, error: " + + JSON.stringify(error) + ", data: " + JSON.stringify(data)); + for(var i = 0; i { + console.log(TAG + "MainAbility moveMissionToFront success, error: " + + JSON.stringify(error) + ", data: " + JSON.stringify(data)); + }); + }, 4000) + + setTimeout(function() { + console.log(TAG + "result is : " + result) + expect(result != "").assertTrue(); + done() + }, 4500) + console.log("------------end SUB_AA_OpenHarmony_MoveMissionToFront_2100-------------"); + }); + + + /* + * @tc.number SUB_AA_OpenHarmony_MoveMissionToFront_2900 + * @tc.name Switching the mission in the launcherlist to the foreground is not supported + * @tc.desc Function test + * @tc.level 0 + */ + it('SUB_AA_OpenHarmony_MoveMissionToFront_2900', 0, async function (done) { + console.log("------------start SUB_AA_OpenHarmony_MoveMissionToFront_2900-------------"); + TAG = "SUB_AA_OpenHarmony_MoveMissionToFront_2900" + var abilityMissionList = []; + setTimeout(function(){ + featureAbility.startAbility({ + want: { + bundleName : "com.example.taskswitching", + abilityName : "com.example.taskswitching.MainAbility2" + } + }, (error, data) => { + console.log(TAG + " startAbility success, error: " + + JSON.stringify(error) + ", data: " + JSON.stringify(data)); + }); + }, 1000); + + setTimeout(function(){ + missionManager.getMissionInfos("", 20, (error, data) => { + console.log(TAG + "Emtry MainAbility2 getMissionInfos success, error: " + + JSON.stringify(error) + ", data: " + JSON.stringify(data)); + + for(var i = 0; i { + console.log(TAG + "getMissionSnapShot success, err: " + + JSON.stringify(err) + ", data: " + JSON.stringify(data)) + expect(JSON.stringify(data.ability.bundleName) == "com.example.taskswitching") + done() + }) + }, 4000) + console.log("------------end SUB_AA_OpenHarmony_MoveMissionToFront_2900-------------"); + }); + + console.log("------------------ taskSwitchTest is end ------------------"); +}) diff --git a/aafwk/aafwk_standard/fa/fa_taskswiting_test/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/fa/fa_taskswiting_test/entry/src/main/resources/base/element/string.json index 10799b592..11ff0c42b 100644 --- a/aafwk/aafwk_standard/fa/fa_taskswiting_test/entry/src/main/resources/base/element/string.json +++ b/aafwk/aafwk_standard/fa/fa_taskswiting_test/entry/src/main/resources/base/element/string.json @@ -1,36 +1,36 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "description_mainability", - "value": "JS_Empty Ability" - }, - { - "name": "description_mainability2", - "value": "JS_Empty Ability" - }, - { - "name": "entry_MainAbility2", - "value": "entry_MainAbility2" - }, - { - "name": "description_mainability3", - "value": "JS_Empty Ability" - }, - { - "name": "entry_MainAbility3", - "value": "entry_MainAbility3" - }, - { - "name": "description_mainability4", - "value": "JS_Empty Ability" - }, - { - "name": "entry_MainAbility4", - "value": "entry_MainAbility4" - } - ] +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "JS_Empty Ability" + }, + { + "name": "description_mainability2", + "value": "JS_Empty Ability" + }, + { + "name": "entry_MainAbility2", + "value": "entry_MainAbility2" + }, + { + "name": "description_mainability3", + "value": "JS_Empty Ability" + }, + { + "name": "entry_MainAbility3", + "value": "entry_MainAbility3" + }, + { + "name": "description_mainability4", + "value": "JS_Empty Ability" + }, + { + "name": "entry_MainAbility4", + "value": "entry_MainAbility4" + } + ] } \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_taskswiting_test/signature/openharmony_sx.p7b b/aafwk/aafwk_standard/fa/fa_taskswiting_test/signature/openharmony_sx.p7b old mode 100644 new mode 100755 diff --git a/aafwk/aafwk_standard/stage/BUILD.gn b/aafwk/aafwk_standard/stage/BUILD.gn index b6f0b4519..74a30a86d 100644 --- a/aafwk/aafwk_standard/stage/BUILD.gn +++ b/aafwk/aafwk_standard/stage/BUILD.gn @@ -16,6 +16,9 @@ import("//test/xts/tools/build/suite.gni") group("stage") { testonly = true if (is_standard_system) { - deps = [ "actsamscontexttest:ActsAmsContextTest" ] + deps = [ + "actsamscontexttest:ActsAmsContextTest", + "stageenvchangetest:StageEnvchangeTest", + ] } } diff --git a/aafwk/aafwk_standard/stage/stageenvchangetest/BUILD.gn b/aafwk/aafwk_standard/stage/stageenvchangetest/BUILD.gn new file mode 100644 index 000000000..65e2c9031 --- /dev/null +++ b/aafwk/aafwk_standard/stage/stageenvchangetest/BUILD.gn @@ -0,0 +1,32 @@ +# 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("StageEnvchangeTest") { + hap_profile = "entry/src/main/config.json" + deps = [ + ":stageenvchangetest_js_assets", + ":stageenvchangetest_resources", + ] + ets2abc = true + certificate_profile = "./signature/openharmony_sx.p7b" + hap_name = "StageEnvchangeTest" +} +ohos_js_assets("stageenvchangetest_js_assets") { + source_dir = "entry/src/main/ets/MainAbility" +} +ohos_resources("stageenvchangetest_resources") { + sources = [ "entry/src/main/resources" ] + hap_profile = "entry/src/main/config.json" +} diff --git a/aafwk/aafwk_standard/stage/stageenvchangetest/Test.json b/aafwk/aafwk_standard/stage/stageenvchangetest/Test.json new file mode 100644 index 000000000..0bf3a5ae4 --- /dev/null +++ b/aafwk/aafwk_standard/stage/stageenvchangetest/Test.json @@ -0,0 +1,18 @@ +{ + "description": "Configuration for Ability Tests", + "driver": { + "type": "JSUnitTest", + "test-timeout": "600000", + "package": "com.example.etsmyapplication", + "shell-timeout": "60000" + }, + "kits": [ + { + "test-file-name": [ + "StageAbilityTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/config.json b/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/config.json new file mode 100644 index 000000000..70d294b76 --- /dev/null +++ b/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/config.json @@ -0,0 +1,97 @@ +{ + "app": { + "bundleName": "com.example.missionmanager", + "vendor": "example", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.missionmanager", + "name": ".MyApplication", + "mainAbility": ".MainAbility", + "srcPath": "", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index", + "pages/second" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ], + "reqPermissions": [ + { + "name": "ohos.permission.GET_BUNDLE_INFO", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.MANAGE_MISSIONS" + }, + { + "name": "ohos.permission.INSTALL_BUNDLE", + "reason": "need use ohos.permission.INSTALL_BUNDLE" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.CHANGE_ABILITY_ENABLED_STATE", + "reason": "need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" + }, + { + "name": "ohos.permission.REMOVE_CACHE_FILES", + "reason": "need use ohos.permission.REMOVE_CACHE_FILES" + }, + { + "name": "ohos.permission.LISTEN_BUNDLE_CHANGE", + "reason": "need use ohos.permission.LISTEN_BUNDLE_CHANGE" + } + ] + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/pages/second/second.js b/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/AbilityStage.ts similarity index 67% rename from aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/pages/second/second.js rename to aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/AbilityStage.ts index 55c229adf..838e5620b 100644 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility2/pages/second/second.js +++ b/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/AbilityStage.ts @@ -1,26 +1,23 @@ -/* - * 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 router from '@system.router' - -export default { - data: { - title: 'World' - }, - onclick: function () { - router.replace({ - uri: "pages/index/index" - }) - } -} +/* + * 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 AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + globalThis.stageOnCreateRun = 1; + globalThis.stageContext = this.context; + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/MainAbility/MainAbility.ts b/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 000000000..9aa883e02 --- /dev/null +++ b/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,49 @@ +/* + * 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 Ability from '@ohos.application.Ability' + +export default class MainAbility extends Ability { + + onCreate(want, launchParam) { + // Ability is creating, initialize resources for this ability + console.log("MainAbility onCreate") + globalThis.abilityWant = want; + globalThis.abilityContext = this.context + } + onDestroy() { + // Ability is destroying, release resources for this ability + console.log("MainAbility onDestroy") + } + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("MainAbility onWindowStageCreate") + windowStage.setUIContent(this.context, "pages/index", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("MainAbility onForeground") + } + + onBackground() { + // Ability has back to background + console.log("MainAbility onBackground") + } +}; diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/pages/second/second.js b/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/MainAbility/app.ets similarity index 76% rename from aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/pages/second/second.js rename to aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/MainAbility/app.ets index 55c229adf..cfb963541 100644 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility3/pages/second/second.js +++ b/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/MainAbility/app.ets @@ -12,15 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import router from '@system.router' - export default { - data: { - title: 'World' - }, - onclick: function () { - router.replace({ - uri: "pages/index/index" - }) - } -} + onCreate() { + console.info('Application onCreate') + }, + onDestroy() { + console.info('Application onDestroy') + }, +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/MainAbility/pages/index.ets b/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/MainAbility/pages/index.ets new file mode 100644 index 000000000..3710d45bf --- /dev/null +++ b/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/MainAbility/pages/index.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import file from '@system.file'; +import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index.ets" +import testsuite from "../../test/List.test.ets" + +@Entry +@Component +struct Index { + aboutToAppear() { + console.log("start run testcase!!!!1"); + const core = Core.getInstance(); + + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const reportExtend = new ReportExtend(file); + + core.addService('report', reportExtend); + core.init(); + core.subscribeEvent('task', reportExtend); + const configService = core.getDefaultService('config'); + +// console.log('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters)); + +// configService.setConfig(globalThis.abilityWant.parameters); + + testsuite(globalThis.abilityContext); + + core.execute(); + } + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('Hello World 111') + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('next page') + .fontSize(25) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/MainAbility/pages/second.ets b/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/MainAbility/pages/second.ets new file mode 100644 index 000000000..93e67fa5f --- /dev/null +++ b/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/MainAbility/pages/second.ets @@ -0,0 +1,43 @@ +/* + * 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 router from '@system.router'; + +@Entry +@Component +struct Second { + private content: string = "Second Page" + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('back to index') + .fontSize(20) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ + top: 20 + }) + .backgroundColor('#0D9FFB') + .onClick(() => { + router.back() + }) + } + .width('100%') + .height('100%') + } +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/pages/second/second.js b/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/test/List.test.ets similarity index 66% rename from aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/pages/second/second.js rename to aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/test/List.test.ets index 55c229adf..998a93af5 100644 --- a/aafwk/aafwk_standard/fa/fa_configurationconstant_test/entry/src/main/js/MainAbility4/pages/second/second.js +++ b/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/test/List.test.ets @@ -1,26 +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. - */ -import router from '@system.router' - -export default { - data: { - title: 'World' - }, - onclick: function () { - router.replace({ - uri: "pages/index/index" - }) - } -} +/* + * 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 permisrsions and + * limitations under the License. + */ +import missionManagerTest from './MissionManager_test.ets' + + +export default function testsuite(context) { + + missionManagerTest(context) + +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/test/MissionManager_test.ets b/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/test/MissionManager_test.ets new file mode 100644 index 000000000..343ed89ef --- /dev/null +++ b/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/ets/test/MissionManager_test.ets @@ -0,0 +1,155 @@ +/* + * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" +import missionManager from "@ohos.application.missionManager" +import AbilityConstant from '@ohos.application.AbilityConstant' + + +export default function missionManagerTest(abilityContext) { + describe('missionManagerTest', function () { + /* + * @tc.number SUB_AA_OpenHarmony_AbilityStart_6200 + * @tc.name Verify the enumeration values abilityContext.config.language + * @tc.desc Function test + * @tc.level 0 + */ + it("SUB_AA_OpenHarmony_EnvChange_0100", 0, async function (done) { + console.info("------------------logMessage SUB_AA_OpenHarmony_EnvChange_0100-------------------"); + console.info("SUB_AA_OpenHarmony_EnvChange_0100 abilityContext.config.language:" + abilityContext.config.language); + expect(abilityContext.config.language=="zh-Hans").assertTrue(); + done(); + }); + /* + * @tc.number SUB_AA_OpenHarmony_AbilityStart_6200 + * @tc.name Call direction to get the direction + * @tc.desc Function test + * @tc.level 0 + */ + it("SUB_AA_OpenHarmony_EnvChange_0200", 0, async function (done) { + console.info("------------------logMessage SUB_AA_OpenHarmony_EnvChange_0200-------------------"); + console.info("SUB_AA_OpenHarmony_EnvChange_0200 abilityContext.config.direction:" + abilityContext.config.direction); + expect(abilityContext.config.direction==0).assertTrue(); + done(); + }); + /* + * @tc.number SUB_AA_OpenHarmony_AbilityStart_6200 + * @tc.name Call direction to get the screenDensity + * @tc.desc Function test + * @tc.level 0 + */ + it("SUB_AA_OpenHarmony_EnvChange_0300", 0, async function (done) { + console.info("------------------logMessage SUB_AA_OpenHarmony_EnvChange_0300-------------------"); + console.info("SUB_AA_OpenHarmony_EnvChange_0300 abilityContext.config.screenDensity:" + abilityContext.config.screenDensity); + expect(abilityContext.config.screenDensity==160).assertTrue(); + done(); + }); + /* + * @tc.number SUB_AA_OpenHarmony_EnvChange_0400 + * @tc.name Call direction to get the displayId + * @tc.desc Function test + * @tc.level 0 + */ + it("SUB_AA_OpenHarmony_EnvChange_0400", 0, async function (done) { + console.info("------------------logMessage SUB_AA_OpenHarmony_EnvChange_0400-------------------"); + console.info("SUB_AA_OpenHarmony_EnvChange_0400 abilityContext.config.displayId:" + abilityContext.config.displayId); + expect(abilityContext.config.displayId==0).assertTrue(); + done(); + }); + /* + * @tc.number SUB_AA_OpenHarmony_AbilityStart_6200 + * @tc.name Verify the enumeration values LaunchReason. CONTINUATION + * @tc.desc Function test + * @tc.level 0 + */ + it("SUB_AA_OpenHarmony_AbilityStart_6200", 0, async function (done) { + console.info("------------------logMessage SUB_AA_OpenHarmony_AbilityStart_6300-------------------"); + console.info("SUB_AA_OpenHarmony_AbilityStart_6200 LaunchReason.CONTINUATION: " + AbilityConstant.LaunchReason.CONTINUATION); + expect(AbilityConstant.LaunchReason.CONTINUATION==3).assertTrue(); + done(); + }); + /* + * @tc.number SUB_AA_OpenHarmony_AbilityStart_6300 + * @tc.name Verify the enumeration value launchreason.start UNKNOWN + * @tc.desc Function test + * @tc.level 0 + */ + it("SUB_AA_OpenHarmony_AbilityStart_6300", 0, async function (done) { + console.info("------------------logMessage SUB_AA_OpenHarmony_AbilityStart_6300-------------------"); + console.info("SUB_AA_OpenHarmony_AbilityStart_6300 LaunchReason.UNKNOWN: " + AbilityConstant.LaunchReason.UNKNOWN); + expect(AbilityConstant.LaunchReason.UNKNOWN==0).assertTrue(); + done(); + }); + /* + * @tc.number SUB_AA_OpenHarmony_AbilityStart_6400 + * @tc.name Verify the enumeration value launchreason.START_ABILITY + * @tc.desc Function test + * @tc.level 0 + */ + it("SUB_AA_OpenHarmony_AbilityStart_6400", 0, async function (done) { + console.info("------------------logMessage SUB_AA_OpenHarmony_AbilityStart_6400-------------------"); + console.info("SUB_AA_OpenHarmony_AbilityStart_6400 LaunchReason.START_ABILITY: " + AbilityConstant.LaunchReason.START_ABILITY); + expect(AbilityConstant.LaunchReason.START_ABILITY==1).assertTrue(); + done(); + }); + /* + * @tc.number SUB_AA_OpenHarmony_AbilityStart_6500 + * @tc.name Verify the enumeration values LaunchReason. CALL + * @tc.desc Function test + * @tc.level 0 + */ + it("SUB_AA_OpenHarmony_AbilityStart_6500", 0, async function (done) { + console.info("------------------logMessage SUB_AA_OpenHarmony_AbilityStart_6500-------------------"); + console.info("SUB_AA_OpenHarmony_AbilityStart_6500 LaunchReason.CALL: " + AbilityConstant.LaunchReason.CALL); + expect(AbilityConstant.LaunchReason.CALL==2).assertTrue(); + done(); + }); + /* + * @tc.number SUB_AA_OpenHarmony_AbilityStart_6600 + * @tc.name Verify the enumeration values LastExitReason.UNKNOWN + * @tc.desc Function test + * @tc.level 0 + */ + it("SUB_AA_OpenHarmony_AbilityStart_6600", 0, async function (done) { + console.info("------------------logMessage SUB_AA_OpenHarmony_AbilityStart_6600-------------------"); + console.info("SUB_AA_OpenHarmony_AbilityStart_6600 LastExitReason.UNKNOWN: " + AbilityConstant.LastExitReason.UNKNOWN); + expect(AbilityConstant.LastExitReason.UNKNOWN==0).assertTrue(); + done(); + }); + /* + * @tc.number SUB_AA_OpenHarmony_AbilityStart_6700 + * @tc.name Verify the enumeration values LastExitReason.ABILITY_NOT_RESPONDING + * @tc.desc Function test + * @tc.level 0 + */ + it("SUB_AA_OpenHarmony_AbilityStart_6700", 0, async function (done) { + console.info("------------------logMessage SUB_AA_OpenHarmony_AbilityStart_6700-------------------"); + console.info("SUB_AA_OpenHarmony_AbilityStart_6700 LastExitReason.ABILITY_NOT_RESPONDING: " + AbilityConstant.LastExitReason.ABILITY_NOT_RESPONDING); + expect(AbilityConstant.LastExitReason.ABILITY_NOT_RESPONDING==1).assertTrue(); + done(); + }); + /* + * @tc.number SUB_AA_OpenHarmony_AbilityStart_6700 + * @tc.name Verify the enumeration values LastExitReason.NORMAL + * @tc.desc Function test + * @tc.level 0 + */ + it("SUB_AA_OpenHarmony_AbilityStart_6800", 0, async function (done) { + console.info("------------------logMessage SUB_AA_OpenHarmony_AbilityStart_6800-------------------"); + console.info("SUB_AA_OpenHarmony_AbilityStart_6800 LastExitReason.NORMAL: " + AbilityConstant.LastExitReason.NORMAL); + expect(AbilityConstant.LastExitReason.NORMAL==2).assertTrue(); + done(); + }); + }) +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/resources/base/element/string.json b/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/resources/base/element/string.json new file mode 100644 index 000000000..8df972c7b --- /dev/null +++ b/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "eTS_Empty Ability" + } + ] +} \ No newline at end of file diff --git a/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/resources/base/media/icon.png b/aafwk/aafwk_standard/stage/stageenvchangetest/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqRJ=obwdgLDVP5+s zy1=_DWG0Y-Jb3t^WXmkr(d9~08k-|#Ly zaNOmT(^9tIb&eb4%CzIT zAm3CUtWSr1t4?h1kk#NBi{U|pJslvME{q|_eS^3En>SOqSxyuN1x;Is@8~m?*>}** znrRFArP!K_52RpX*&JHMR<^lVdm8ypJ}0R(SD(51j;6@ni$6bQ+2XL+R^|NnSp5}(kzvMZ^(@4fD_{QVu$(&K6H|C37TG1Am9Re{<<3gd zh@`>;BqkXMW&p0T6rt|iB$)~CvFe(XC)F9WgAZn*0@t$oZo;!*}r@_`h?KKH&6A@3= zISXoQB+~`op>NP-buiA*^0n{@i{_?MRG)&k)c)k_F+-2Lud!S9pc+i`s74NpBCaGF zXN+pHkubw*msGBTY27BKHv)RRh3;nMg4&$fD_6X9Vt~;_4D+5XPH~#Kn-yjcy!$}1 zigv#FNY>TqMhtIBb@UoF!cE~Q8~;!Pek>SQQwHnHuWKoVBosAiOr}q>!>aE*Krc)V zBUMEcJ5NU0g8}-h6i1zpMY9>m4ne?=U2~`w7K7Q0gB_=p@$5K7p6}thw z-~3dMj?YNX2X$lZ+7ngQ$=s}3mizNN@kE%OtB)?c&i~2L55z8^=yz;xMHLmlY>&Q# zJj?!)M#q_SyfkQh)k?j8IfLtB)ZCp|*vf4_B zos?73yd^h-Ac+;?E4*bpf=o*^3x3-`TVjbY4n6!EN10K6o@fxdyps05Vo3PU)otB} z`3kR+2w7_C#8Z!q`J)p{Vh!+m9-UP!$STp+Hb}}#@#_u^SsUQg<}59< zTvH3%XS4G+6FF^(m6bVF&nSUIXcl;nw{=H$%fgeJ>CgDYiLdpDXr{;-AnG z8dvcrHYVMI&`R6;GWekI@Ir3!uo)oz4^{6q0m^}@f2tM9&=YHNi6-?rh0-{+k@cQm zdp`g#YdQn%MDVg2GR>wZ`n2<0l4)9nx1Wfr&!Dvz=bPwU!h2S?ez6MVc5APE4-xLB zi&W9Q8k2@0w!C53g?iAIQ}~p*3O(@zja6KQ=M3zfW*_6o5SwR-)6VBh~m7{^-=MC-owYH5-u40a}a0liho3QZZ5L{bS_xM1)4}19)zTU$$MY zq3eZML1WC{K%YFd`Be0M-rkO^l?h{kM{$2oK1*A@HVJ57*yhDkUF!2WZ&oA4Y-sK( zCY69%#`mBCi6>6uw(x4gbFaP0+FD*JKJ-q!F1E?vLJ+d35!I5d7@^eU?(CS|C^tmI5?lv@s{{*|1F zFg|OzNpZ0hxljdjaW%45O0MOttRrd(Z?h{HYbB-KFUx&9GfFL3b8NwZ$zNu)WbBD` zYkj$^UB5%3Pj1MDr>S2Ejr9pUcgA!;ZG!@{uAy12)vG=*^9-|dNQBc8&`oxBlU~#y zs!anJX&T?57Jdr^sb>e+V`MVfY>Y0ESg7MG<7W0g&bR-ZYzzZ%2H&Etcp zcd6QeXO1D!5A#zM0lx*GH}`M)2~ZFLE;sP^RSB5wVMNfiZXPd(cmO>j=OSA3`o5r& zna(|^jGXbdN7PK)U8b7^zYtYkkeb%<%F~=OqB~kXMQkq}ii|skh@WSRt>5za;cjP0 zZ~nD%6)wzedqE}BMLt~qKwlvTr33))#uP~xyw#*Eaa|DbMQ_%mG0U8numf8)0DX`r zRoG2bM;#g|p-8gWnwRV5SCW0tLjLO&9Z?K>FImeIxlGUgo0Zk`9Qzhj1eco~7XZy+hXc@YF&ZQ=? zn*^1O56yK^x{y}q`j7}blGCx%dydV!c7)g~tJzmHhV=W~jbWRRR{1<^oDK+1clprm zz$eCy7y9+?{E|YgkW~}}iB#I4XoJ*xr8R?i_Hv$=Cof5bo-Nj~f`-DLebH}&0% zfQj9@WGd4;N~Y?mzQsHJTJq6!Qzl^-vwol(+fMt#Pl=Wh#lI5Vmu@QM0=_r+1wHt` z+8WZ~c2}KQQ+q)~2Ki77QvV&`xb|xVcTms99&cD$Zz4+-^R4kvUBxG8gDk7Y`K*)JZ^2rL(+ZWV~%W(@6 z)0bPArG#BROa_PHs~&WplQ_UIrpd)1N1QGPfv!J(Z9jNT#i%H?CE6|pPZb9hJ1JW4 z^q;ft#!HRNV0YgPojzIYT`8LuET2rUe-J|c!9l4`^*;4WtY@Ew@pL>wkjmMgGfN7 ze}}GtmU0@<_#08~I-Suk=^*9GLW=H4xhsml;vAV{%hy5Eegl@!6qKqbG024%n2HHw zCc@ivW_$@5ZoHP70(7D+(`PvgjW1Pd`wsiuv-aCukMrafwDm)B!xXVy*j2opohhoU zcJz%ADmj>i3`-3-$7nQKBQQuGY;2Qt&+(L~C>vSGFj5{Mlv?T_^dql;{zkpe4R1}R z%XfZyQ}wr*sr>jrKgm*PWLjuVc%6&&`Kbf1SuFpHPN&>W)$GmqC;pIoBC`=4-hPY8 zT*>%I2fP}vGW;R=^!1be?ta2UQd2>alOFFbVl;(SQJ4Jk#)4Z0^wpWEVvY4=vyDk@ zqlModi@iVPMC+{?rm=4(n+<;|lmUO@UKYA>EPTS~AndtK^Wy^%#3<;(dQdk3WaUkRtzSMC9}7x2||CNpF#(3T4C)@ z$~RWs`BNABKX|{cmBt>Q=&gkXl&x!!NK_%5hW0LS)Z4PB>%sV?F-{Wyj#s7W%$F{D zXdK^Fp3wvy+48+GP6F_|^PCRx=ddcTO3sG;B23A49~Qaw31SZ0Rc~`r4qqt%#OGW{ zCA_(LG5^N>yzUn&kAgVmxb=EA8s&tBXC}S1CZ(KoW)(%^JjLTPo^fs`Va;`=YlVPgmB$!yB}<(4ym6OeZ3xAJJ#;)2+B%p3P1Wt+d$eo`vz`T zXfUP2))kBDPoscH;Jc7I3NU<({|@wM$&GaDt`n7WLgIY3IA7A6-_R?z8N3mz|}*i z(zl5ot--Oq@f2-nv{X(ujT2T(k1vY_qh93pK@>H-qc%2Xta)IP0Q%zt%bqYgI`o!wv!0QerB`nCN^1n|@$sVOQ!V0teVG!I z_fD%JvfDeT1cK#-{o6Gv7}& zY0#NWin~kVaf$aufV&;63Hbs|`QVZWpDX6IMk1Hj2G}fiH9e-^6u2zf^FIr^BwD<6zjw63+{yUe8PUFvk8v{sJ=R{d#`O!sz`Q13~< zPT$JS(w=yQfU2`zPCNfSw=&zup@DXc(98afjhv@1w_f!m2Z>rMJ19AB&dB%P#Ls3b z=lK7OILM+SQ&VEd=1GN6o&>YVVtIzoZ%=Z_SdqJN2}E43{bE`>w+A;=y->@^k{oCC z$F*WTY&?34;kfyFV?b*Xb1Pq`Z=%OgwEg)Rz)tx=`f%5#w_INP=x&z5!jI;#;N$ma zhO)+MDm;SxOEVL15; zGq(v2pL3&P1Sl)8P*;G-fd{l1QJsv@e@d8)1PK4w2m*M%V3j-V~L^$i|&C@b?D?9tfwE{B^}Z$k8e5FmQ>v7Xz)sG32g9t}YBt zyR$+*_00RmPx+0mW+vVG4mxd(n$(eQf3-w>JPl2UJpafrPaL5@2j}%{VE-) zBI%6Qpj*dsdH<;g!S!avA~bv^0E+ zfyJbSjPb+j;J52U)<|cIcntQBI2T#>2;tOxu{%D?kML476AErF(qN9hPva5Nkc@BF zC-tLF@3ZFb%Kpj)M<{)x*l|*Ia@ECeXo2E4h2f!aV=cHAhi_E_mfUth(sM4^hJq7B zQsGWqdZUm9S%F`$nQ*_#NcuD`&)Ek%_s{&^78{9Hm ztri&rYLOxgFdG>O@+XHy z9#;|&vBCPXH5Mon^I`jSuR$&~ZWtyB67ujzFSj!51>#C}C17~TffQ{c-!QFQkTQ%! zIR^b1`zHx|*1GU?tbBx23weFLz5H?y_Q%N&t$}k?w+``2A=aotj0;2v$~AL z{scF-cL{wsdrmPvf#a9OHyYLcwQD4Kcm)`LLwMh4WT~p29f7M!iafJSU`IV}QY5Wa z(n44-9oA}?J{a+ah*@31WTs#&J#o1`H98#6IQf;Wv0N_!);f&9g7o-k(lW5rWnDUR zQBFIRG+X=6NnsI@mxnwm;tf5;_Uxg?jZ8m-m0}&6+DA!qam(p$mN5R})yA_7m$q@| zFEd|dpS595rxQr-n#GjI5i-AhnUE>Cr;jpCqSrD~EwK_DqI^7%3#p5)%T_od!t3SOmH9MyXeeGO2(UQL;ax|x?Ncixmeo1=$ z{-);Au{*tfzOG?KQ~K|ak8-HQ?`Pekhe2WM(8s{xv-p>Zmu_6{G!-oE$7$mY`MOJorI=+mMx?H;`pr!;fVYz?5~yXBACruWB`Ph zZM}90_<^OBxIhyZ9BW$`>6JvO;%VFpqVr8|7t3~AmxYak6?`Pp#c;**_SYmi`&z23 z`p6_~ePvH)C6x-G9$hgL=eVALq`-AiamN>!3~Lxw&{H(b{B(7xSRm6<3<{%{yXiH# zos5Rv1L+8fUKJLo%P>4I&$}yb$g8MY4FF(5FQyMT=#m||qU)nQ9cId-MBB-<-lvSdq&snM}IENNF>t+bK| zgowuF2vC|SxSZxNN5eHhV%(WPpbeB9Fc3;JDMtzMBv1-XAc2N~c2_tCXW&OCGw6qQ z-s9VS-tT?h=bI0tMS+~WDXqHJyCPmLzdbE-fV8Nd&*MRZfG8(#POFZG3xs@Lb{0ry z=R8j3wWo!5g=yjKx#BoZMFS)uA)H}cTp@-^K`9VV?RC3J59@}eik*>n|pRKOLZ zxdn7G!Yv@9O#y<&eUy{)vMXb;fQR)ffVAADQsEMXm;IBMDLfLD0w^U;6%HVo-0Q_5 zCHEa?DBuauNpZzoF+tK27w#n~?u%toS-DhR4k@Q*{7x^8Q=D6&kd^_~J#VVG2LXkL zaAy=}U*?Jto)9hx5MGjdp9hcQAu@tfk_;l!PeyxPY<8b&+&D!CyaBh9=8BSVKLpk4 z4Ml3yY|&Th)vyK4cpC{!uU8v2YBlVV`d~(nz&<@{G1oe*DHub1z7~J5*;s2bX<)_* zV_GbsPQg`(&rpxRb_*Od7}++3+liSw-$!1 zs5*g}EHWhI3i|!-FcfzYL0`SL-rq>LENC;PMl)G(0(1U2%Va|smp0UFx0xd@soZA* zD5LYc4OlbE7@ARt#h}rr3>K@bf%B#^-c+xz8Hr)0D5ExIFltezN@Hn8>o5d~bSfYtkc+_Z&kI#-N5_GhCg*V-^TSO=!G~ z(fXy{n2XV+k}6w_W`dTOP2a4u0ly;ANZ>4OxSKAzFB!yBzdo`gX zO?o|H@WiAw$y6l?=^3jA_Hy0S)nTYs12;4hKE&ekQ|>?|ZLJ}#F`2BczC7kdE4@xV zZBD_)Otwjhz+NSaz?d45!;FsGSu-#qh#hStD%B}f!mCT!KqzSo>I`NGH_9Dea$1Qi zg29Ydt!~lQVR99_T7#Hije~(12drl-P)SV?QR*9sus`8th-8^OQ7@xI$(Yp|^;bL1 zR50O$mDXw6P>i7B(TJ)ciPzTE>XY%X6HAa)b#OBRXv&~%Bw|J#Y><i4=e%95bjtw|cJp=#P#Pf#*luqI_wR;fISDCJhAqSG6R%xItn%~QtZ@m%&u zjGGLX;t6Ls62eQvNmf@v+}J%54^CygxRZ`?8X#r|wkev7(s;Ou4T#y1XNNf)h;o7z z8a^Lfq<1uH`E{G9E z*(=)Css_LSk=>E9jr)s5^2-!+MN=Ds}>1hRma4`uCIz9%p3O77839E{xf z4c_I?**|1`K2tg4!Hvyrou4BsJQuv*UfF)<%CelYIS>D^o?X)3+MK%la6kooW8&G@BU)Y0hT`+mOm$Z_%rB=a%o>I z!2c6lHyKQN)VjiFwa!eE^p8jc$sy$vB+8i25lI~6KPFFh$!o$avA~rj#L6xvR|Z83 z*WD6T9e+5Pyy=F+)pNTf{ny3cy>7Rkd3o*TS?TZJ`NS^NF2%HMkyS{?uJ$`!P4_L^ z1`NFDUbNyg_qREifgktnp1_v{Jbb`7m}2PTyUdOmtJj~m z9bB=ecw4_^rw1IW=of+>nrW5=d3k`3qHCxsIN_F{T1A545};;+fsyC&qChi+YV zr~M63H8ZLCPYmsjY>ls9cL%I)F|JIW-#+48$+lD4k*(P*kDM%zx_fvu4u5ZYUnI}5 zdrycFq>xFU)&X3p@pP2u%$o}}YcRn(MhJ&B2o?KS@cIVz>Ye%o^xV?CB{_Qhu z;}_q1bvO^g{8<3!gYbo4Di{8qzV+(9 zdlmksohQmRTs@qB;(Wo?dER_ux6XQb@q$tQPW?CMu6GVQd;R=iR;-S{Kr%Zks7>b1 zNs{|-+jhObYE}NR&`TGGr^h^4bjh%c>R#@=8nM&Md>_a+zVulsl;){flFekV1t9ob z+SqfV_Pv3$2f)bQ8%Ul2>fdYR^1zs0BQF~olsOj5AodC&Q_7SMFzsz2 z9newxE&jodk~tNHwl%LBMMDbrk=(^b literal 0 HcmV?d00001 -- GitLab