diff --git a/services/dtbabilitymgr/test/BUILD.gn b/services/dtbabilitymgr/test/BUILD.gn index a0762556..3493d01c 100644 --- a/services/dtbabilitymgr/test/BUILD.gn +++ b/services/dtbabilitymgr/test/BUILD.gn @@ -61,11 +61,8 @@ if (os_account_part) { dtbabilitymgr_external_deps += [ "os_account:os_account_innerkits" ] } -dtbabilitymgr_public_deps = [ - "//foundation/ability/dmsfwk/services/dtbschedmgr:distributedschedsvr", - "//third_party/googletest:gmock_main", - "//third_party/googletest:gtest_main", -] +dtbabilitymgr_public_deps = + [ "${distributed_service}/dtbschedmgr:distributedschedsvr" ] dtbabilitymgr_sources = [ "${distributed_service}/dtbabilitymgr/src/continuation_manager/app_connection_stub.cpp", diff --git a/services/dtbschedmgr/test/BUILD.gn b/services/dtbschedmgr/test/BUILD.gn index 77474c4f..d426e9f0 100644 --- a/services/dtbschedmgr/test/BUILD.gn +++ b/services/dtbschedmgr/test/BUILD.gn @@ -115,8 +115,6 @@ if (dmsfwk_mmi_listener) { dsched_public_deps = [ "${distributed_service}/dtbschedmgr:distributedschedsvr", "${dms_path}/common:distributed_sched_utils", - "//third_party/googletest:gmock_main", - "//third_party/googletest:gtest_main", ] dtbschedmgr_sources = [ "unittest/distributed_sched_test_util.cpp" ] @@ -131,11 +129,6 @@ distributed_event_sources = [ ohos_unittest("distributedschedsvrtest") { module_out_path = module_output_path - deps = [ - "${dms_path}/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle:bmsThirdBundle", - "${dms_path}/test/sceneProject/unittest/ohos_test:copy_ohos_test", - ] - sources = [ "unittest/continue_scene_session_handler_test.cpp", "unittest/distributed_sched_adapter_test.cpp", @@ -244,11 +237,6 @@ ohos_unittest("dschedcontinuetest") { public_deps = dsched_public_deps } - deps = [ - "${dms_path}/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle:bmsThirdBundle", - "${dms_path}/test/sceneProject/unittest/ohos_test:copy_ohos_test", - ] - if (dmsfwk_mission_manager) { defines = [ "SUPPORT_DISTRIBUTED_MISSION_MANAGER" ] } @@ -366,10 +354,7 @@ ohos_unittest("bundlemanagerinternaltest") { "${distributed_service}/dtbschedmgr/test/resource:coverage_flags", ] configs += dsched_configs - deps = [ - "${dms_path}/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle:bmsThirdBundle", - "${dms_path}/test/sceneProject/unittest/ohos_test:copy_ohos_test", - ] + if (is_standard_system) { external_deps = dsched_external_deps public_deps = dsched_public_deps @@ -397,14 +382,12 @@ ohos_unittest("softbusadaptertest") { "${dms_path}/services/dtbschedmgr/test/resource:coverage_flags", ] configs += dsched_configs - deps = [ - "${dms_path}/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle:bmsThirdBundle", - "${dms_path}/test/sceneProject/unittest/ohos_test:copy_ohos_test", - ] + if (is_standard_system) { external_deps = dsched_external_deps public_deps = dsched_public_deps } + external_deps += [ "googletest:gmock" ] part_name = "dmsfwk" subsystem_name = "ability" } @@ -639,6 +622,7 @@ group("unittest") { ":dschedcontinuestatetest", ":dschedcontinuetest", ":dschedswitchstatustest", + ":hisyseventreporttest", ":softbusadaptertest", "${dms_path}/common/test/unittest:distributed_sched_utils_test", ] diff --git a/services/dtbschedmgr/test/unittest/bundle_manager_internal_test.cpp b/services/dtbschedmgr/test/unittest/bundle_manager_internal_test.cpp index a0266536..5dbfe792 100644 --- a/services/dtbschedmgr/test/unittest/bundle_manager_internal_test.cpp +++ b/services/dtbschedmgr/test/unittest/bundle_manager_internal_test.cpp @@ -39,7 +39,6 @@ constexpr int32_t SLEEP_TIME = 1000; void BundleManagerInternalTest::SetUpTestCase() { DTEST_LOG << "BundleManagerInternalTest::SetUpTestCase" << std::endl; - DistributedSchedUtil::InstallThirdPartyHap(); std::this_thread::sleep_for(std::chrono::milliseconds(SLEEP_TIME)); } diff --git a/services/dtbschedmgr/test/unittest/distributed_sched_continuation_test.cpp b/services/dtbschedmgr/test/unittest/distributed_sched_continuation_test.cpp index 1f0d7e4c..af6ce12c 100644 --- a/services/dtbschedmgr/test/unittest/distributed_sched_continuation_test.cpp +++ b/services/dtbschedmgr/test/unittest/distributed_sched_continuation_test.cpp @@ -51,7 +51,6 @@ void DSchedContinuationTest::SetUpTestCase() const std::string pkgName = "DBinderBus_" + std::to_string(getprocpid()); std::shared_ptr initCallback_ = std::make_shared(); DeviceManager::GetInstance().InitDeviceManager(pkgName, initCallback_); - DistributedSchedUtil::InstallThirdPartyHap(); std::this_thread::sleep_for(std::chrono::milliseconds(SLEEP_TIME)); } diff --git a/services/dtbschedmgr/test/unittest/distributed_sched_service_first_test.cpp b/services/dtbschedmgr/test/unittest/distributed_sched_service_first_test.cpp index 391b6a8e..50d356d0 100644 --- a/services/dtbschedmgr/test/unittest/distributed_sched_service_first_test.cpp +++ b/services/dtbschedmgr/test/unittest/distributed_sched_service_first_test.cpp @@ -100,7 +100,6 @@ void DistributedSchedServiceFirstTest::SetUpTestCase() const std::string pkgName = "DBinderBus_" + std::to_string(getprocpid()); std::shared_ptr initCallback_ = std::make_shared(); DeviceManager::GetInstance().InitDeviceManager(pkgName, initCallback_); - DistributedSchedUtil::InstallThirdPartyHap(); std::this_thread::sleep_for(std::chrono::milliseconds(SLEEP_TIME)); } diff --git a/services/dtbschedmgr/test/unittest/distributed_sched_service_second_test.cpp b/services/dtbschedmgr/test/unittest/distributed_sched_service_second_test.cpp index 16e62798..95fe9ca8 100644 --- a/services/dtbschedmgr/test/unittest/distributed_sched_service_second_test.cpp +++ b/services/dtbschedmgr/test/unittest/distributed_sched_service_second_test.cpp @@ -99,7 +99,6 @@ void DistributedSchedServiceSecondTest::SetUpTestCase() const std::string pkgName = "DBinderBus_" + std::to_string(getprocpid()); std::shared_ptr initCallback_ = std::make_shared(); DeviceManager::GetInstance().InitDeviceManager(pkgName, initCallback_); - DistributedSchedUtil::InstallThirdPartyHap(); std::this_thread::sleep_for(std::chrono::milliseconds(SLEEP_TIME)); } diff --git a/services/dtbschedmgr/test/unittest/distributed_sched_test_util.cpp b/services/dtbschedmgr/test/unittest/distributed_sched_test_util.cpp index e2a89500..04aa38cb 100644 --- a/services/dtbschedmgr/test/unittest/distributed_sched_test_util.cpp +++ b/services/dtbschedmgr/test/unittest/distributed_sched_test_util.cpp @@ -35,7 +35,6 @@ namespace DistributedSchedule { using namespace AppExecFwk; namespace { const std::string TAG = "DistributedSchedUtil"; -const std::string HAP_FILE_PATH = "/data/test/resource/dmsfwk/resource/bmsThirdBundle.hap"; const char* DISTSCHED_PROCESS_NAME = "distributedsched"; constexpr int32_t DMS_LOAD_SA_TIMEOUT_MS = 10000; constexpr int32_t USER_ID = 100; @@ -130,32 +129,6 @@ sptr DistributedSchedUtil::GetBundleManager() return iface_cast(bmsProxy); } -int32_t DistributedSchedUtil::InstallThirdPartyHap() -{ - auto bms = GetBundleManager(); - if (bms == nullptr) { - HILOGE("bms is null"); - return FAILED_RETURN; - } - auto installer = bms->GetBundleInstaller(); - if (!installer) { - HILOGE("installer is null"); - return FAILED_RETURN; - } - InstallParam installParam; - installParam.installFlag = InstallFlag::NORMAL; - installParam.userId = USER_ID; - sptr statusReceiver(new (std::nothrow) StatusReceiverImpl()); - if (!statusReceiver) { - return FAILED_RETURN; - } - bool result = installer->Install(HAP_FILE_PATH, installParam, statusReceiver); - if (!result) { - return FAILED_RETURN; - } - return 0; -} - void DistributedSchedUtil::MockProcessAndPermission(const char* processName, const char *perms[], int32_t permsNum) { uint64_t tokenId; diff --git a/services/dtbschedmgr/test/unittest/distributed_sched_test_util.h b/services/dtbschedmgr/test/unittest/distributed_sched_test_util.h index 53dd1fe8..e08c7825 100644 --- a/services/dtbschedmgr/test/unittest/distributed_sched_test_util.h +++ b/services/dtbschedmgr/test/unittest/distributed_sched_test_util.h @@ -37,7 +37,6 @@ public: static void LoadSystemAbilitySuccessNotify(const sptr& remoteObject); static void LoadSystemAbilityFailNotify(); static sptr GetBundleManager(); - static int32_t InstallThirdPartyHap(); static std::mutex remoteMutex_; static sptr remote_; diff --git a/services/dtbschedmgr/test/unittest/mission/dms_continue_manager_test.cpp b/services/dtbschedmgr/test/unittest/mission/dms_continue_manager_test.cpp index 88493be7..de3c61e3 100644 --- a/services/dtbschedmgr/test/unittest/mission/dms_continue_manager_test.cpp +++ b/services/dtbschedmgr/test/unittest/mission/dms_continue_manager_test.cpp @@ -720,9 +720,6 @@ HWTEST_F(DMSContinueManagerTest, testGetAbilityNameByMissionId_001, TestSize.Lev int32_t ret = DMSContinueSendMgr::GetInstance().GetAbilityNameByMissionId(MISSIONID_01, abilityName); EXPECT_EQ(abilityName, ABILITY_NAME_01); EXPECT_EQ(ret, ERR_OK); - - ret = DMSContinueSendMgr::GetInstance().GetBundleNameByMissionId(MISSIONID_02, abilityName); - EXPECT_EQ(ret, INVALID_PARAMETERS_ERR); DTEST_LOG << "DMSContinueManagerTest testGetAbilityNameByMissionId_001 end" << std::endl; } diff --git a/test/sceneProject/unittest/bundle_dependencies/BUILD.gn b/test/sceneProject/unittest/bundle_dependencies/BUILD.gn deleted file mode 100644 index ae6479d4..00000000 --- a/test/sceneProject/unittest/bundle_dependencies/BUILD.gn +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2023 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. - -group("bundle_dependencies") { - testonly = true - deps = [] - - deps += [ - # deps file - "dependencies_entry:dependencies_entry", - ] -} diff --git a/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/BUILD.gn b/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/BUILD.gn deleted file mode 100644 index 8a133121..00000000 --- a/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/BUILD.gn +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (c) 2023 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("//build/ohos/app/app.gni") -import("../../../../../dmsfwk.gni") - -ohos_hap("bmsThirdBundle") { - hap_profile = "./src/main/config.json" - hap_name = "bmsThirdBundle" - subsystem_name = "bundlemanager" - final_hap_path = "$root_out_dir/tests/unittest/dmsfwk/distributedschedsvrtest/resource/${hap_name}.hap" - testonly = true - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = - "${dms_path}/test/sceneProject/signature/com.third.hiworld.example.p7b" -} - -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./src/main/js/default" -} - -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/js/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/config.json b/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/config.json deleted file mode 100644 index 9c6a42ef..00000000 --- a/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/config.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "app": { - "bundleName": "com.third.hiworld.example", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 3, - "target": 3 - } - }, - "deviceConfig": { - "default": {} - }, - "module": { - "package": "com.third.hiworld.example.hap", - "name": "bmsThirdBundle", - "deviceType": [ - "tablet", - "default", - "tv", - "car", - "2in1" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "testability", - "moduleType": "entry" - }, - "abilities": [ - { - "name": "bmsThirdBundle", - "icon": "$media:snowball", - "label": "bmsThirdBundle Ability", - "launchType": "singleton", - "orientation": "unspecified", - "type": "page", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": true - } - } - ] - } -} \ No newline at end of file diff --git a/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/js/default/app.js b/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/js/default/app.js deleted file mode 100644 index d053b4a3..00000000 --- a/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/js/default/i18n/en-US.json b/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d9..00000000 --- a/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/js/default/i18n/zh-CN.json b/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee574..00000000 --- a/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/js/default/pages/index/index.css b/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/js/default/pages/index/index.css deleted file mode 100644 index ed1feff4..00000000 --- a/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* -* Copyright (c) 2023 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 { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/js/default/pages/index/index.hml b/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 9e66dfc2..00000000 --- a/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ - - -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/js/default/pages/index/index.js b/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/js/default/pages/index/index.js deleted file mode 100644 index 1148deb8..00000000 --- a/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2023 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. - */ -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} diff --git a/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/js/resources/base/element/string.json b/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/js/resources/base/element/string.json deleted file mode 100644 index ba50b57d..00000000 --- a/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "bmsfirstright" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/js/resources/base/media/snowball.png b/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/js/resources/base/media/snowball.png deleted file mode 100644 index 8966a1e3..00000000 Binary files a/test/sceneProject/unittest/bundle_dependencies/bmsThirdBundle/src/main/js/resources/base/media/snowball.png and /dev/null differ diff --git a/test/sceneProject/unittest/ohos_test/BUILD.gn b/test/sceneProject/unittest/ohos_test/BUILD.gn deleted file mode 100644 index 823dfbeb..00000000 --- a/test/sceneProject/unittest/ohos_test/BUILD.gn +++ /dev/null @@ -1,21 +0,0 @@ -# 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("//build/ohos.gni") - -ohos_copy("copy_ohos_test") { - sources = [ "./ohos_test.xml" ] - outputs = [ "$root_out_dir/tests/unittest/dmsfwk/distributedschedsvrtest/resource/ohos_test.xml" ] - part_name = "dmsfwk" - subsystem_name = "ability" -} diff --git a/test/sceneProject/unittest/ohos_test/ohos_test.xml b/test/sceneProject/unittest/ohos_test/ohos_test.xml deleted file mode 100644 index 996113b4..00000000 --- a/test/sceneProject/unittest/ohos_test/ohos_test.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file