diff --git a/customization/BUILD.gn b/customization/BUILD.gn deleted file mode 100755 index 1650a93888bd0c396a5cd807479b5a158afb4001..0000000000000000000000000000000000000000 --- a/customization/BUILD.gn +++ /dev/null @@ -1,23 +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_var.gni") - -group("customization") { - testonly = true - if (is_standard_system) { - deps = [ - "enterprise_device_management:edm_test_grop", - ] - } -} diff --git a/customization/enterprise_device_management/BUILD.gn b/customization/enterprise_device_management/BUILD.gn deleted file mode 100644 index 4f95ba3d5854bcf62e9761174ea969adf102de93..0000000000000000000000000000000000000000 --- a/customization/enterprise_device_management/BUILD.gn +++ /dev/null @@ -1,40 +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("//test/xts/tools/build/suite.gni") - -group("edm_test_grop") { - testonly = true - if (is_standard_system) { - deps = [ - ":edm_test", - "edmsceneone:edmJstest1", - ] - } -} -ohos_js_hap_suite("edm_test") { - hap_profile = "./src/main/config.json" - deps = [ - ":edm_assets", - ":edm_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsEdmJsTest" -} -ohos_js_assets("edm_assets") { - source_dir = "./src/main/js/default" -} -ohos_resources("edm_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/customization/enterprise_device_management/Test.json b/customization/enterprise_device_management/Test.json deleted file mode 100644 index 5e86cfd7e8945b8469ab99557f0aef2edc12fc0d..0000000000000000000000000000000000000000 --- a/customization/enterprise_device_management/Test.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "description": "Configuration for enterprise device management Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "300000", - "package": "ohos.edm.test", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsEdmJsTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "PushKit", - "push": [ - "edmJstest1.hap->/data/edmJstest1.hap" - ] - - }, - { - "type": "ShellKit", - "run-command": [ - "chmod 644 /data/*.hap", - "param set ro.config.pass_edm_permission true" - ] - } - ] -} diff --git a/customization/enterprise_device_management/edmsceneone/BUILD.gn b/customization/enterprise_device_management/edmsceneone/BUILD.gn deleted file mode 100644 index 285ca9c48e90647bc5874e0eb8066470b6b0b8bb..0000000000000000000000000000000000000000 --- a/customization/enterprise_device_management/edmsceneone/BUILD.gn +++ /dev/null @@ -1,34 +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("//test/xts/tools/build/suite.gni") - -ohos_hap("edmJstest1") { - hap_profile = "./src/main/config.json" - hap_name = "edmJstest1" - subsystem_name = XTS_SUITENAME - final_hap_path = - "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" - testonly = true - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.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/customization/enterprise_device_management/edmsceneone/Test.json b/customization/enterprise_device_management/edmsceneone/Test.json deleted file mode 100644 index 7a88763ed8d2ac31dd30211b9574f47273e84549..0000000000000000000000000000000000000000 --- a/customization/enterprise_device_management/edmsceneone/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", -} diff --git a/customization/enterprise_device_management/edmsceneone/signature/openharmony_sx.p7b b/customization/enterprise_device_management/edmsceneone/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/customization/enterprise_device_management/edmsceneone/signature/openharmony_sx.p7b and /dev/null differ diff --git a/customization/enterprise_device_management/edmsceneone/src/main/config.json b/customization/enterprise_device_management/edmsceneone/src/main/config.json deleted file mode 100644 index c1c32d47cc53efd2668e3f263a97b420a384e3a3..0000000000000000000000000000000000000000 --- a/customization/enterprise_device_management/edmsceneone/src/main/config.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "app": { - "bundleName": "com.example.myapplication1", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.myapplication1", - "name": ".MyApplication1", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": ".MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "language": "C++", - "metaData": { - "customizeData": [ - { - "name": "originWidgetName", - "value": "com.weather.testWidget" - } - ] - } - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/customization/enterprise_device_management/edmsceneone/src/main/js/default/app.js b/customization/enterprise_device_management/edmsceneone/src/main/js/default/app.js deleted file mode 100644 index 2d316a0a089b332c5c28729be9ff937aa46618c5..0000000000000000000000000000000000000000 --- a/customization/enterprise_device_management/edmsceneone/src/main/js/default/app.js +++ /dev/null @@ -1,22 +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. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/customization/enterprise_device_management/edmsceneone/src/main/js/default/i18n/en-US.json b/customization/enterprise_device_management/edmsceneone/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/customization/enterprise_device_management/edmsceneone/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/customization/enterprise_device_management/edmsceneone/src/main/js/default/i18n/zh-CN.json b/customization/enterprise_device_management/edmsceneone/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/customization/enterprise_device_management/edmsceneone/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/customization/enterprise_device_management/edmsceneone/src/main/js/default/pages/index/index.css b/customization/enterprise_device_management/edmsceneone/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/customization/enterprise_device_management/edmsceneone/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/customization/enterprise_device_management/edmsceneone/src/main/js/default/pages/index/index.hml b/customization/enterprise_device_management/edmsceneone/src/main/js/default/pages/index/index.hml deleted file mode 100644 index f64b040a5ae394dbaa5e185e1ecd4f4556b92184..0000000000000000000000000000000000000000 --- a/customization/enterprise_device_management/edmsceneone/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/customization/enterprise_device_management/edmsceneone/src/main/js/default/pages/index/index.js b/customization/enterprise_device_management/edmsceneone/src/main/js/default/pages/index/index.js deleted file mode 100644 index eb5be916aa414adb35cf8541635725d702a893dc..0000000000000000000000000000000000000000 --- a/customization/enterprise_device_management/edmsceneone/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,25 +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. - */ -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/customization/enterprise_device_management/edmsceneone/src/main/js/resources/base/element/string.json b/customization/enterprise_device_management/edmsceneone/src/main/js/resources/base/element/string.json deleted file mode 100644 index 21f88982736302157aad1cc00a3735adf299eccb..0000000000000000000000000000000000000000 --- a/customization/enterprise_device_management/edmsceneone/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "bmssceneone" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/customization/enterprise_device_management/edmsceneone/src/main/js/resources/base/media/icon.png b/customization/enterprise_device_management/edmsceneone/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/customization/enterprise_device_management/edmsceneone/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/customization/enterprise_device_management/signature/openharmony_sx.p7b b/customization/enterprise_device_management/signature/openharmony_sx.p7b deleted file mode 100644 index 66b4457a8a81fb8d3356cf46d67226c850944858..0000000000000000000000000000000000000000 Binary files a/customization/enterprise_device_management/signature/openharmony_sx.p7b and /dev/null differ diff --git a/customization/enterprise_device_management/src/main/config.json b/customization/enterprise_device_management/src/main/config.json deleted file mode 100644 index 0aad02f50a05ab9ef2fc1e10b19b28d9d1e42a6a..0000000000000000000000000000000000000000 --- a/customization/enterprise_device_management/src/main/config.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "app": { - "bundleName": "ohos.edm.test", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5 - } - }, - "deviceConfig": {}, - "module": { - "package": "ohos.edm.test", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "visible": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "ohos.edm.test.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "MyApplication", - "type": "page", - "launchType": "standard" - } - ], - "reqPermissions": [ - { - "name":"ohos.permission.GET_BUNDLE_INFO", - "reason":"need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name":"ohos.permission.INSTALL_BUNDLE", - "reason":"need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name":"ohos.permission.EDM_MANAGE_DATETIME", - "reason":"need use EDM_MANAGE_DATETIME" - }, - { - "name":"ohos.permission.MANAGE_ADMIN", - "reason":"need use MANAGE_ADMIN" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/customization/enterprise_device_management/src/main/js/default/app.js b/customization/enterprise_device_management/src/main/js/default/app.js deleted file mode 100644 index c1a2274b034140503e7ef5347935c10c69a96d59..0000000000000000000000000000000000000000 --- a/customization/enterprise_device_management/src/main/js/default/app.js +++ /dev/null @@ -1,23 +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. - */ - -export default { - onCreate() { - console.info('TestApplication onCreate'); - }, - onDestroy() { - console.info('TestApplication onDestroy'); - } -}; diff --git a/customization/enterprise_device_management/src/main/js/default/i18n/en-US.json b/customization/enterprise_device_management/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/customization/enterprise_device_management/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/customization/enterprise_device_management/src/main/js/default/i18n/zh-CN.json b/customization/enterprise_device_management/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/customization/enterprise_device_management/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/customization/enterprise_device_management/src/main/js/default/pages/index/index.css b/customization/enterprise_device_management/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/customization/enterprise_device_management/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/customization/enterprise_device_management/src/main/js/default/pages/index/index.hml b/customization/enterprise_device_management/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 1c26cf73deab18390844a53a103458b10ed11e93..0000000000000000000000000000000000000000 --- a/customization/enterprise_device_management/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{title}} - -
diff --git a/customization/enterprise_device_management/src/main/js/default/pages/index/index.js b/customization/enterprise_device_management/src/main/js/default/pages/index/index.js deleted file mode 100644 index fc9eda0c61a0529da9627bc4bb29fd34f6ce81a7..0000000000000000000000000000000000000000 --- a/customization/enterprise_device_management/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,45 +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 {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../test/List.test') - core.execute() - }, - onReady() { - }, -} diff --git a/customization/enterprise_device_management/src/main/js/default/test/EnterpriseDeviceManager.test.js b/customization/enterprise_device_management/src/main/js/default/test/EnterpriseDeviceManager.test.js deleted file mode 100644 index 64e0554d6293845645ec913205bb9829efc0c5e3..0000000000000000000000000000000000000000 --- a/customization/enterprise_device_management/src/main/js/default/test/EnterpriseDeviceManager.test.js +++ /dev/null @@ -1,397 +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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' -import bundle from '@ohos.bundle' -import enterpriseDeviceManager from '@ohos.enterpriseDeviceManager' - -const PATH = "/data/" -const EDMJSTEST1 = "edmJstest1.hap" -const WANT1 = { - bundleName: "com.example.myapplication1", - abilityName: "com.example.myapplication1.MainAbility" -}; - -const SELFWANT = { - bundleName: "ohos.edm.test", - abilityName: "ohos.edm.test.MainAbility" -}; -const HAPNAME1 = "com.example.myapplication1" -const SELFHAPNAME = "ohos.edm.test" -const COMPANYNAME2 = "company2" -const DESCRIPTION2 = "edm demo2" -const ENTINFO1 = { - name: "company", - description: "edm demo" -}; - -const ENTINFO2 = { - name: "company2", - description: "edm demo2" -}; - -describe('EnterpriseDeviceManagerTest', function () { - console.log('*************start EnterpriseDeviceManagerTest*************'); - - /** - * @tc.number SUB_CUSTOMIZATION_ENTERPRISE_DEVICE_MANAGER_JS_0100 - * @tc.name test activateAdmin method in promise mode - * @tc.desc activate admin in promise mode - */ - it('activateAdmin_test_001', 0, async function (done) { - let installData = await bundle.getBundleInstaller() - installData.install([PATH + EDMJSTEST1], { - userId: 100, - installFlag: 0, - isKeepData: false - }, async (err, data) => { - expect(err.code).assertEqual(0); - expect(data.status).assertEqual(0); - expect(data.statusMessage).assertEqual('SUCCESS'); - await bundle.getBundleInfo(HAPNAME1, - bundle.BundleFlag.GET_BUNDLE_WITH_REQUESTED_PERMISSION).then(datainfo => { - console.info("getBundleInfo success:" + JSON.stringify(datainfo)); - }); - activateAdmin(); - }); - async function activateAdmin() { - var retValue = await enterpriseDeviceManager.activateAdmin(WANT1, ENTINFO1, - enterpriseDeviceManager.AdminType.ADMIN_TYPE_NORMAL); - console.log('enterpriseDeviceManager.activateAdmin ADMIN_TYPE_NORMAL : ' + retValue); - expect(retValue).assertTrue(); - - var isActive = await enterpriseDeviceManager.isAdminAppActive(WANT1); - console.log('enterpriseDeviceManager.isAdminAppActive : ' + isActive); - expect(isActive).assertTrue(); - - retValue = await enterpriseDeviceManager.deactivateAdmin(WANT1); - console.log('enterpriseDeviceManager.deactivateAdmin : ' + retValue); - expect(retValue).assertTrue(); - - isActive = await enterpriseDeviceManager.isAdminAppActive(WANT1); - console.log('enterpriseDeviceManager.isAdminAppActive : ' + isActive); - expect(isActive).assertFalse(); - - installData.uninstall(HAPNAME1, { - userId: 100, - installFlag: 0, - isKeepData: false - }, (err, data) => { - expect(err.code).assertEqual(0); - expect(data.status).assertEqual(0); - expect(data.statusMessage).assertEqual('SUCCESS'); - done(); - }); - } - }) - - /** - * @tc.number SUB_CUSTOMIZATION_ENTERPRISE_DEVICE_MANAGER_JS_0200 - * @tc.name test activateAdmin method in callback mode - * @tc.desc activate admin in callback mode - */ - it('activateAdmin_test_002', 0, async function (done) { - let installData = await bundle.getBundleInstaller() - installData.install([PATH + EDMJSTEST1], { - userId: 100, - installFlag: 0, - isKeepData: false - }, async (err, data) => { - expect(err.code).assertEqual(0); - expect(data.status).assertEqual(0); - expect(data.statusMessage).assertEqual('SUCCESS'); - activateAdmin(); - }); - async function activateAdmin() { - console.log('activateAdmin()'); - var retValue = await enterpriseDeviceManager.activateAdmin(WANT1, ENTINFO1, - enterpriseDeviceManager.AdminType.ADMIN_TYPE_NORMAL, OnReceiveEvent); - async function OnReceiveEvent(err, datainfo) { - console.log('enterpriseDeviceManager.activateAdmin ADMIN_TYPE_NORMAL :' + datainfo); - expect(datainfo).assertTrue(); - - var isActive = await enterpriseDeviceManager.isAdminAppActive(WANT1); - console.log('enterpriseDeviceManager.isAdminAppActive :' + isActive); - expect(isActive).assertTrue(); - - retValue = await enterpriseDeviceManager.deactivateAdmin(WANT1); - console.log('enterpriseDeviceManager.deactivateAdmin : ' + retValue); - expect(retValue).assertTrue(); - - isActive = await enterpriseDeviceManager.isAdminAppActive(WANT1); - console.log('enterpriseDeviceManager.isAdminAppActive : ' + isActive); - expect(isActive).assertFalse(); - - installData.uninstall(HAPNAME1, { - userId: 100, - installFlag: 0, - isKeepData: false - }, (err, data) => { - expect(err.code).assertEqual(0); - expect(data.status).assertEqual(0); - expect(data.statusMessage).assertEqual('SUCCESS'); - done(); - }); - } - } - }) - - - /** - * @tc.number SUB_CUSTOMIZATION_ENTERPRISE_DEVICE_MANAGER_JS_0300 - * @tc.name test activateAdmin method in promise mode with ADMIN_TYPE_SUPER param - * @tc.desc activate super admin in promise mode - */ - it('activateAdmin_test_003', 0, async function (done) { - await bundle.getBundleInfo(SELFHAPNAME, - bundle.BundleFlag.GET_BUNDLE_WITH_REQUESTED_PERMISSION).then(datainfo => { - console.info("getBundleInfo success:" + JSON.stringify(datainfo)); - }); - - console.log('enterpriseDeviceManager.activateAdmin ADMIN_TYPE_SUPER'); - var retValue = await enterpriseDeviceManager.activateAdmin(SELFWANT, ENTINFO1, - enterpriseDeviceManager.AdminType.ADMIN_TYPE_SUPER); - console.log('enterpriseDeviceManager.activateAdmin ADMIN_TYPE_SUPER : ' + retValue); - expect(retValue).assertTrue(); - - var isActive = await enterpriseDeviceManager.isSuperAdmin(SELFHAPNAME); - console.log('enterpriseDeviceManager.isSuperAdmin :' + isActive); - expect(isActive).assertTrue(); - - retValue = await enterpriseDeviceManager.deactivateSuperAdmin(SELFHAPNAME); - console.log('enterpriseDeviceManager.deactivateSuperAdmin : ' + retValue); - expect(retValue).assertTrue(); - - isActive = await enterpriseDeviceManager.isSuperAdmin(SELFHAPNAME); - console.log('enterpriseDeviceManager.isSuperAdmin : ' + isActive); - expect(isActive).assertFalse(); - done(); - }) - - /** - * @tc.number SUB_CUSTOMIZATION_ENTERPRISE_DEVICE_MANAGER_JS_0400 - * @tc.name test activateAdmin method in callback mode with ADMIN_TYPE_SUPER param - * @tc.desc activate super admin in callback mode - */ - it('activateAdmin_test_004', 0, async function (done) { - var retValue = await enterpriseDeviceManager.activateAdmin(SELFWANT, ENTINFO1, - enterpriseDeviceManager.AdminType.ADMIN_TYPE_SUPER, OnReceiveEvent); - async function OnReceiveEvent(err, datainfo) { - console.log('enterpriseDeviceManager.activateAdmin : ' + retValue); - expect(datainfo).assertTrue(); - - var isActive = await enterpriseDeviceManager.isSuperAdmin(SELFHAPNAME); - console.log('enterpriseDeviceManager.isSuperAdmin :' + isActive); - expect(isActive).assertTrue(); - - retValue = await enterpriseDeviceManager.deactivateSuperAdmin(SELFHAPNAME); - console.log('enterpriseDeviceManager.deactivateSuperAdmin : ' + retValue); - expect(retValue).assertTrue(); - - isActive = await enterpriseDeviceManager.isSuperAdmin(SELFHAPNAME); - console.log('enterpriseDeviceManager.isSuperAdmin : ' + isActive); - expect(isActive).assertFalse(); - done(); - } - }) - - /** - * @tc.number SUB_CUSTOMIZATION_ENTERPRISE_DEVICE_MANAGER_JS_0500 - * @tc.name test activateAdmin method in promise mode - * @tc.desc activate admin in promise mode - */ - it('activateAdmin_test_005', 0, async function (done) { - - var retValue = await enterpriseDeviceManager.activateAdmin(SELFWANT, ENTINFO1, - enterpriseDeviceManager.AdminType.ADMIN_TYPE_NORMAL); - console.log('enterpriseDeviceManager.activateAdmin ADMIN_TYPE_NORMAL : ' + retValue); - expect(retValue).assertTrue(); - - var isActive = await enterpriseDeviceManager.isAdminAppActive(SELFWANT); - console.log('enterpriseDeviceManager.isAdminAppActive : ' + isActive); - expect(isActive).assertTrue(); - - retValue = await enterpriseDeviceManager.deactivateAdmin(SELFWANT); - console.log('enterpriseDeviceManager.deactivateAdmin : ' + retValue); - expect(retValue).assertTrue(); - - isActive = await enterpriseDeviceManager.isAdminAppActive(SELFWANT); - console.log('enterpriseDeviceManager.isAdminAppActive : ' + isActive); - expect(isActive).assertFalse(); - - done(); - }) - - /** - * @tc.number SUB_CUSTOMIZATION_ENTERPRISE_DEVICE_MANAGER_JS_0600 - * @tc.name test activateAdmin method in callback mode - * @tc.desc activate admin in callback mode - */ - it('activateAdmin_test_006', 0, async function (done) { - - console.log(' activateAdmin()'); - var retValue = await enterpriseDeviceManager.activateAdmin(SELFWANT, ENTINFO1, - enterpriseDeviceManager.AdminType.ADMIN_TYPE_NORMAL, OnReceiveEvent); - async function OnReceiveEvent(err, datainfo) { - console.log('enterpriseDeviceManager.activateAdmin ADMIN_TYPE_NORMAL :' + datainfo); - expect(datainfo).assertTrue(); - - var isActive = await enterpriseDeviceManager.isAdminAppActive(SELFWANT); - console.log('enterpriseDeviceManager.isAdminAppActive :' + isActive); - expect(isActive).assertTrue(); - - retValue = await enterpriseDeviceManager.deactivateAdmin(SELFWANT); - console.log('enterpriseDeviceManager.deactivateAdmin : ' + retValue); - expect(retValue).assertTrue(); - - isActive = await enterpriseDeviceManager.isAdminAppActive(SELFWANT); - console.log('enterpriseDeviceManager.isAdminAppActive : ' + isActive); - expect(isActive).assertFalse(); - done(); - } - }) - - - /** - * @tc.number SUB_CUSTOMIZATION_ENTERPRISE_DEVICE_MANAGER_JS_0700 - * @tc.name test setEnterpriseInfo method in promise mode - * @tc.desc set enterprise info in promise mode - */ - it('setEnterpriseInfo_test_001', 0, async function (done) { - var retValue = await enterpriseDeviceManager.activateAdmin(SELFWANT, ENTINFO1, - enterpriseDeviceManager.AdminType.ADMIN_TYPE_NORMAL); - console.log('enterpriseDeviceManager.activateAdmin ADMIN_TYPE_NORMAL : ' + retValue); - expect(retValue).assertTrue(); - - var isActive = await enterpriseDeviceManager.isAdminAppActive(SELFWANT); - expect(isActive).assertTrue(); - console.log('enterpriseDeviceManager.isAdminAppActive : ' + isActive); - - retValue = await enterpriseDeviceManager.setEnterpriseInfo(SELFWANT, ENTINFO2); - console.log('enterpriseDeviceManager.setEnterpriseInfo : ' + retValue); - expect(retValue).assertTrue(); - - var entInfo = await enterpriseDeviceManager.getEnterpriseInfo(SELFWANT); - expect(entInfo.name).assertEqual(COMPANYNAME2); - expect(entInfo.description).assertEqual(DESCRIPTION2); - - retValue = await enterpriseDeviceManager.deactivateAdmin(SELFWANT); - console.log('enterpriseDeviceManager.deactivateAdmin : ' + retValue); - expect(retValue).assertTrue(); - - isActive = await enterpriseDeviceManager.isAdminAppActive(SELFWANT); - console.log('enterpriseDeviceManager.isAdminAppActive : ' + isActive); - expect(isActive).assertFalse(); - done(); - - }) - - /** - * @tc.number SUB_CUSTOMIZATION_ENTERPRISE_DEVICE_MANAGER_JS_0800 - * @tc.name test setEnterpriseInfo method in callback mode - * @tc.desc set enterprise info in callback mode - */ - it('setEnterpriseInfo_test_002', 0, async function (done) { - var retValue = await enterpriseDeviceManager.activateAdmin(SELFWANT, ENTINFO1, - enterpriseDeviceManager.AdminType.ADMIN_TYPE_NORMAL); - console.log('enterpriseDeviceManager.activateAdmin ADMIN_TYPE_NORMAL : ' + retValue); - expect(retValue).assertTrue(); - var isActive = await enterpriseDeviceManager.isAdminAppActive(SELFWANT); - expect(isActive).assertTrue(); - console.log('enterpriseDeviceManager.isAdminAppActive : ' + isActive); - - retValue = await enterpriseDeviceManager.setEnterpriseInfo(SELFWANT, ENTINFO2, OnReceiveEvent); - async function OnReceiveEvent(err, datainfo) { - console.log('enterpriseDeviceManager.setEnterpriseInfo : ' + datainfo); - expect(datainfo).assertTrue(); - - var entInfo = await enterpriseDeviceManager.getEnterpriseInfo(SELFWANT); - expect(entInfo.name).assertEqual(COMPANYNAME2); - expect(entInfo.description).assertEqual(DESCRIPTION2); - - retValue = await enterpriseDeviceManager.deactivateAdmin(SELFWANT); - console.log('enterpriseDeviceManager.deactivateAdmin : ' + retValue); - expect(retValue).assertTrue(); - - isActive = await enterpriseDeviceManager.isAdminAppActive(SELFWANT); - console.log('enterpriseDeviceManager.isAdminAppActive : ' + isActive); - expect(isActive).assertFalse(); - done(); - } - }) - - /** - * @tc.number SUB_CUSTOMIZATION_ENTERPRISE_DEVICE_MANAGER_JS_0900 - * @tc.name test getDeviceSettingsManager method in callback mode - * @tc.desc get the device settings manager in callback mode - */ - it('getDeviceSettingsManager_test_001', 0, async function (done) { - enterpriseDeviceManager.getDeviceSettingsManager((error, mgr) => { - expect(mgr !== null).assertTrue(); - }) - console.log('getDeviceSettingsManager_test_001 done'); - done(); - }) - - /** - * @tc.number SUB_CUSTOMIZATION_ENTERPRISE_DEVICE_MANAGER_JS_1000 - * @tc.name test getDeviceSettingsManager method in promise mode - * @tc.desc get the device settings manager in promise mode - */ - it('getDeviceSettingsManager_test_002', 0, async function (done) { - enterpriseDeviceManager.getDeviceSettingsManager().then(mgr => { - expect(mgr !== null).assertTrue(); - }) - console.log('getDeviceSettingsManager_test_002 done'); - done(); - }) - - /** - * @tc.number SUB_CUSTOMIZATION_ENTERPRISE_DEVICE_MANAGER_JS_1100 - * @tc.name test setDateTime method in promise mode - * @tc.desc set system date time in promise mode - */ - it('setDateTime_test_001', 0, async function (done) { - await enterpriseDeviceManager.activateAdmin(SELFWANT, ENTINFO1, - enterpriseDeviceManager.AdminType.ADMIN_TYPE_SUPER); - let dsmgr = await enterpriseDeviceManager.getDeviceSettingsManager(); - expect(dsmgr !== null).assertTrue(); - console.log('before setDateTime'); - var setSuccess = await dsmgr.setDateTime(SELFWANT, 1526003846000); - expect(setSuccess).assertTrue(); - await enterpriseDeviceManager.deactivateSuperAdmin(SELFHAPNAME); - done(); - }) - - /** - * @tc.number SUB_CUSTOMIZATION_ENTERPRISE_DEVICE_MANAGER_JS_1200 - * @tc.name test setDateTime method in callback mode - * @tc.desc set system date time in callback mode - */ - it('setDateTime_test_002', 0, async function (done) { - await enterpriseDeviceManager.activateAdmin(SELFWANT, ENTINFO1, - enterpriseDeviceManager.AdminType.ADMIN_TYPE_SUPER); - let dsmgr = await enterpriseDeviceManager.getDeviceSettingsManager(); - expect(dsmgr !== null).assertTrue(); - console.log('before setDateTime'); - await dsmgr.setDateTime(SELFWANT, 1526003846000, (error, data) => { - console.log("setDateTime ===data: " + data); - console.log("setDateTime ===error: " + error); - }); - await enterpriseDeviceManager.deactivateSuperAdmin(SELFHAPNAME); - done(); - }) - - console.log('*************end EnterpriseDeviceManagerTest*************'); -}) \ No newline at end of file diff --git a/customization/enterprise_device_management/src/main/js/default/test/List.test.js b/customization/enterprise_device_management/src/main/js/default/test/List.test.js deleted file mode 100644 index e6206c4fbdd44c3d0580457372120b98ce1edade..0000000000000000000000000000000000000000 --- a/customization/enterprise_device_management/src/main/js/default/test/List.test.js +++ /dev/null @@ -1,15 +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. - */ -require('./EnterpriseDeviceManager.test.js') diff --git a/customization/enterprise_device_management/src/main/resources/base/element/plural.json b/customization/enterprise_device_management/src/main/resources/base/element/plural.json deleted file mode 100644 index 5df662491e2cba0cc4ca28cb1547351bea8a78f3..0000000000000000000000000000000000000000 --- a/customization/enterprise_device_management/src/main/resources/base/element/plural.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "plural":[ - { - "name":"plural_name", - "value":[ - { - "quantity":"zero", - "value":"%d test zero" - }, - { - "quantity":"one", - "value":"%d test one" - }, - { - "quantity":"two", - "value":"%d test two" - }, - { - "quantity":"few", - "value":"%d test few" - }, - { - "quantity":"many", - "value":"%d test many" - }, - { - "quantity":"other", - "value":"%d test other" - } - ] - } - ] -} \ No newline at end of file diff --git a/customization/enterprise_device_management/src/main/resources/base/element/strarray.json b/customization/enterprise_device_management/src/main/resources/base/element/strarray.json deleted file mode 100644 index 643b3ced65e64d0a4555e9b3c091f5809526da9b..0000000000000000000000000000000000000000 --- a/customization/enterprise_device_management/src/main/resources/base/element/strarray.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "strarray": [ - { - "name": "sizeList", - "value":[ - { - "value":"small" - }, - { - "value":"middle" - }, - { - "value":"large" - }, - { - "value":"extra large" - } - ] - } - ] -} \ No newline at end of file diff --git a/customization/enterprise_device_management/src/main/resources/base/element/string.json b/customization/enterprise_device_management/src/main/resources/base/element/string.json deleted file mode 100644 index 26ee728d01904a59b0af7ca29262f6d921eadfb4..0000000000000000000000000000000000000000 --- a/customization/enterprise_device_management/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "L2Test" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/customization/enterprise_device_management/src/main/resources/base/media/icon.png b/customization/enterprise_device_management/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/customization/enterprise_device_management/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/test_packages.gni b/test_packages.gni index d86bae0f49901d9e004c8d989b5800fa396914bb..0b05ee195a3c7fbb2034a3794c68a568277707d4 100644 --- a/test_packages.gni +++ b/test_packages.gni @@ -41,7 +41,6 @@ _all_test_packages = [ "${ACTS_ROOT}/location:location", "${ACTS_ROOT}/settingsdata:settingsdata", "${ACTS_ROOT}/barrierfree:barrierfree", - "${ACTS_ROOT}/customization:customization", ] _all_test_packages_ivi = [