Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
925753ff
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
925753ff
编写于
7月 04, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 04, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4038 EDM xts 变更为Stage 模型
Merge pull request !4038 from 蔡明港/master
上级
d43070b9
1b00520e
变更
48
展开全部
隐藏空白更改
内联
并排
Showing
48 changed file
with
1430 addition
and
313 deletion
+1430
-313
customization/BUILD.gn
customization/BUILD.gn
+11
-1
customization/TestExtensionAbility_001/AppScope/app.json
customization/TestExtensionAbility_001/AppScope/app.json
+21
-0
customization/TestExtensionAbility_001/AppScope/resources/base/element/string.json
...onAbility_001/AppScope/resources/base/element/string.json
+8
-0
customization/TestExtensionAbility_001/AppScope/resources/base/media/app_icon.png
...ionAbility_001/AppScope/resources/base/media/app_icon.png
+0
-0
customization/TestExtensionAbility_001/BUILD.gn
customization/TestExtensionAbility_001/BUILD.gn
+41
-0
customization/TestExtensionAbility_001/Test.json
customization/TestExtensionAbility_001/Test.json
+1
-0
customization/TestExtensionAbility_001/entry/src/main/ets/Application/AbilityStage.ts
...bility_001/entry/src/main/ets/Application/AbilityStage.ts
+8
-7
customization/TestExtensionAbility_001/entry/src/main/ets/EnterpriseAdminAbility/EnterpriseAdminAbility.ts
...main/ets/EnterpriseAdminAbility/EnterpriseAdminAbility.ts
+12
-11
customization/TestExtensionAbility_001/entry/src/main/ets/MainAbility/MainAbility.ts
...Ability_001/entry/src/main/ets/MainAbility/MainAbility.ts
+50
-0
customization/TestExtensionAbility_001/entry/src/main/ets/pages/index/index.ets
...nsionAbility_001/entry/src/main/ets/pages/index/index.ets
+47
-0
customization/TestExtensionAbility_001/entry/src/main/ets/pages/second/second.ets
...ionAbility_001/entry/src/main/ets/pages/second/second.ets
+43
-0
customization/TestExtensionAbility_001/entry/src/main/module.json
...ation/TestExtensionAbility_001/entry/src/main/module.json
+102
-0
customization/TestExtensionAbility_001/entry/src/main/resources/base/element/string.json
...ity_001/entry/src/main/resources/base/element/string.json
+32
-0
customization/TestExtensionAbility_001/entry/src/main/resources/base/media/icon.png
...nAbility_001/entry/src/main/resources/base/media/icon.png
+0
-0
customization/TestExtensionAbility_001/entry/src/main/resources/base/profile/main_pages.json
...001/entry/src/main/resources/base/profile/main_pages.json
+6
-0
customization/TestExtensionAbility_001/signature/openharmony_sx.p7b
...ion/TestExtensionAbility_001/signature/openharmony_sx.p7b
+0
-0
customization/edm_xts_stage/AppScope/app.json
customization/edm_xts_stage/AppScope/app.json
+21
-0
customization/edm_xts_stage/AppScope/resources/base/element/string.json
...edm_xts_stage/AppScope/resources/base/element/string.json
+8
-0
customization/edm_xts_stage/AppScope/resources/base/media/app_icon.png
.../edm_xts_stage/AppScope/resources/base/media/app_icon.png
+0
-0
customization/edm_xts_stage/BUILD.gn
customization/edm_xts_stage/BUILD.gn
+20
-19
customization/edm_xts_stage/Test.json
customization/edm_xts_stage/Test.json
+28
-0
customization/edm_xts_stage/entry/src/main/ets/Application/AbilityStage.ts
..._xts_stage/entry/src/main/ets/Application/AbilityStage.ts
+9
-0
customization/edm_xts_stage/entry/src/main/ets/EnterpriseAdminAbility/EnterpriseAdminAbility.ts
...main/ets/EnterpriseAdminAbility/EnterpriseAdminAbility.ts
+26
-0
customization/edm_xts_stage/entry/src/main/ets/MainAbility/MainAbility.ts
...m_xts_stage/entry/src/main/ets/MainAbility/MainAbility.ts
+38
-0
customization/edm_xts_stage/entry/src/main/ets/pages/index/index.ets
...on/edm_xts_stage/entry/src/main/ets/pages/index/index.ets
+67
-0
customization/edm_xts_stage/entry/src/main/ets/pages/second/second.ets
.../edm_xts_stage/entry/src/main/ets/pages/second/second.ets
+43
-0
customization/edm_xts_stage/entry/src/main/ets/test/List.test.ets
...ation/edm_xts_stage/entry/src/main/ets/test/List.test.ets
+7
-9
customization/edm_xts_stage/entry/src/main/ets/test/commom.ets
...mization/edm_xts_stage/entry/src/main/ets/test/commom.ets
+45
-0
customization/edm_xts_stage/entry/src/main/ets/test/edmCallback.test.ets
...dm_xts_stage/entry/src/main/ets/test/edmCallback.test.ets
+294
-0
customization/edm_xts_stage/entry/src/main/ets/test/edmPromise.test.ets
...edm_xts_stage/entry/src/main/ets/test/edmPromise.test.ets
+334
-0
customization/edm_xts_stage/entry/src/main/module.json
customization/edm_xts_stage/entry/src/main/module.json
+70
-0
customization/edm_xts_stage/entry/src/main/resources/base/element/string.json
...s_stage/entry/src/main/resources/base/element/string.json
+32
-0
customization/edm_xts_stage/entry/src/main/resources/base/media/icon.png
...dm_xts_stage/entry/src/main/resources/base/media/icon.png
+0
-0
customization/edm_xts_stage/entry/src/main/resources/base/profile/main_pages.json
...age/entry/src/main/resources/base/profile/main_pages.json
+6
-0
customization/edm_xts_stage/signature/openharmony_sx.p7b
customization/edm_xts_stage/signature/openharmony_sx.p7b
+0
-0
customization/enterprise_device_management/edmsceneone/src/main/config.json
...rprise_device_management/edmsceneone/src/main/config.json
+0
-70
customization/enterprise_device_management/edmsceneone/src/main/js/default/i18n/en-US.json
...anagement/edmsceneone/src/main/js/default/i18n/en-US.json
+0
-6
customization/enterprise_device_management/edmsceneone/src/main/js/default/i18n/zh-CN.json
...anagement/edmsceneone/src/main/js/default/i18n/zh-CN.json
+0
-6
customization/enterprise_device_management/edmsceneone/src/main/js/default/pages/index/index.css
...ent/edmsceneone/src/main/js/default/pages/index/index.css
+0
-9
customization/enterprise_device_management/edmsceneone/src/main/js/default/pages/index/index.hml
...ent/edmsceneone/src/main/js/default/pages/index/index.hml
+0
-5
customization/enterprise_device_management/edmsceneone/src/main/js/resources/base/element/string.json
...dmsceneone/src/main/js/resources/base/element/string.json
+0
-12
customization/enterprise_device_management/src/main/config.json
...ization/enterprise_device_management/src/main/config.json
+0
-78
customization/enterprise_device_management/src/main/js/default/i18n/en-US.json
...ise_device_management/src/main/js/default/i18n/en-US.json
+0
-6
customization/enterprise_device_management/src/main/js/default/i18n/zh-CN.json
...ise_device_management/src/main/js/default/i18n/zh-CN.json
+0
-6
customization/enterprise_device_management/src/main/js/default/pages/index/index.css
...vice_management/src/main/js/default/pages/index/index.css
+0
-9
customization/enterprise_device_management/src/main/js/default/pages/index/index.hml
...vice_management/src/main/js/default/pages/index/index.hml
+0
-5
customization/enterprise_device_management/src/main/resources/base/element/plural.json
...ce_management/src/main/resources/base/element/plural.json
+0
-33
customization/enterprise_device_management/src/main/resources/base/element/strarray.json
..._management/src/main/resources/base/element/strarray.json
+0
-21
未找到文件。
customization/BUILD.gn
浏览文件 @
925753ff
...
...
@@ -13,9 +13,19 @@
import("//build/ohos_var.gni")
group("edm_test_grop") {
testonly = true
if (is_standard_system) {
deps = [
"TestExtensionAbility_001:ExtensionZeroTest",
"edm_xts_stage:ActsEdmTest",
]
}
}
group("customization") {
testonly = true
if (is_standard_system) {
deps = [ "
enterprise_device_management
:edm_test_grop" ]
deps = [ ":edm_test_grop" ]
}
}
customization/TestExtensionAbility_001/AppScope/app.json
0 → 100644
浏览文件 @
925753ff
{
"app"
:
{
"bundleName"
:
"com.example.extensionzerotest"
,
"vendor"
:
"huawei"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"debug"
:
false
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:app_name"
,
"description"
:
"$string:description_application"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
8
,
"targetAPIVersion"
:
8
,
"car"
:
{
"apiCompatibleVersion"
:
8
,
"singleUser"
:
false
}
}
}
\ No newline at end of file
customization/
enterprise_device_management/src/main
/resources/base/element/string.json
→
customization/
TestExtensionAbility_001/AppScope
/resources/base/element/string.json
浏览文件 @
925753ff
...
...
@@ -2,11 +2,7 @@
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"L2Test"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Phone_Empty Feature Ability"
"value"
:
"ohosProject"
}
]
}
\ No newline at end of file
}
customization/
enterprise_device_management/edmsceneone/src/main/js/resources/base/media/
icon.png
→
customization/
TestExtensionAbility_001/AppScope/resources/base/media/app_
icon.png
浏览文件 @
925753ff
文件已移动
customization/
enterprise_device_management/edmsceneone
/BUILD.gn
→
customization/
TestExtensionAbility_001
/BUILD.gn
浏览文件 @
925753ff
...
...
@@ -10,25 +10,32 @@
# 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
ohos_js_hap_suite("ExtensionZeroTest") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":
hjs_demo
_js_assets",
":
hjs_demo
_resources",
":
extensionZeroTest
_js_assets",
":
extensionZeroTest
_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ExtensionZeroTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./src/main/js/default"
ohos_app_scope("extensionZeroTest_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_resources("hjs_demo_resources") {
sources = [ "./src/main/js/resources" ]
hap_profile = "./src/main/config.json"
ohos_js_assets("extensionZeroTest_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("extensionZeroTest_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":extensionZeroTest_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
customization/
enterprise_device_management/edmsceneone
/Test.json
→
customization/
TestExtensionAbility_001
/Test.json
浏览文件 @
925753ff
{
"description"
:
"Configuration for hjunit demo Tests"
,
}
customization/
enterprise_device_management/edmsceneone/src/main/js/default/app.j
s
→
customization/
TestExtensionAbility_001/entry/src/main/ets/Application/AbilityStage.t
s
浏览文件 @
925753ff
...
...
@@ -4,7 +4,7 @@
* 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
* 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,
...
...
@@ -12,11 +12,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export
default
{
import
AbilityStage
from
"
@ohos.application.AbilityStage
"
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
info
(
'
AceApplication onCreate
'
);
},
onDestroy
()
{
console
.
info
(
'
AceApplication onDestroy
'
);
console
.
log
(
"
MyAbilityStage onCreate
"
)
globalThis
.
stageContext
=
this
.
context
;
console
.
log
(
"
MyAbilityStage finish
"
)
}
}
;
}
\ No newline at end of file
customization/
enterprise_device_management/edmsceneone/src/main/js/default/pages/index/index.j
s
→
customization/
TestExtensionAbility_001/entry/src/main/ets/EnterpriseAdminAbility/EnterpriseAdminAbility.t
s
浏览文件 @
925753ff
...
...
@@ -4,7 +4,7 @@
* 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
* 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,
...
...
@@ -12,14 +12,15 @@
* 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
'
);
}
}
import
EnterpriseAdminExtensionAbility
from
'
@ohos.EnterpriseAdminExtensionAbility
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
"
deccjsunit/index
"
export
default
class
EnterpriseAdminAbility
extends
EnterpriseAdminExtensionAbility
{
onAdminEnabled
()
{
console
.
log
(
'
EnterpriseAdminExtensionAbility onAdminEnabled
'
);
}
onAdminDisabled
(){
console
.
log
(
'
EnterpriseAdminExtensionAbility onAdminDisabled
'
);
}
}
\ No newline at end of file
customization/TestExtensionAbility_001/entry/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
925753ff
/*
* 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
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/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
"
);
}
};
customization/TestExtensionAbility_001/entry/src/main/ets/pages/index/index.ets
0 → 100644
浏览文件 @
925753ff
/*
* 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 file from '@system.file';
import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index"
@Entry
@Component
struct Index {
aboutToAppear() {
console.info("start run testcase!!!!")
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)
console.info("subscribeEvent run !!!!")
const configService = core.getDefaultService('config')
console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters))
configService.setConfig(globalThis.abilityWant.parameters)
core.execute()
}
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('MainAbility')
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
customization/TestExtensionAbility_001/entry/src/main/ets/pages/second/second.ets
0 → 100644
浏览文件 @
925753ff
/*
* 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 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
customization/TestExtensionAbility_001/entry/src/main/module.json
0 → 100644
浏览文件 @
925753ff
{
"module"
:
{
"name"
:
"phone"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/AbilityStage.ts"
,
"description"
:
"$string:phone_entry_dsc"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"phone"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"uiSyntax"
:
"ets"
,
"pages"
:
"$profile:main_pages"
,
"abilities"
:
[
{
"name"
:
"com.example.extensionzerotest.MainAbility"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:phone_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"orientation"
:
"portrait"
,
"skills"
:
[
{
"actions"
:
[
"action.system.home"
],
"entities"
:
[
"entity.system.home"
]
}
]
}
],
"extensionAbilities"
:
[
{
"srcEntrance"
:
"./ets/EnterpriseAdminAbility/EnterpriseAdminAbility.ts"
,
"name"
:
"com.example.extensionzerotest.EnterpriseAdminAbility"
,
"icon"
:
"$media:icon"
,
"srcLanguage"
:
"ets"
,
"description"
:
"$string:phone_entry_main"
,
"type"
:
"enterpriseAdmin"
,
"visible"
:
true
}
],
"requestPermissions"
:
[
{
"name"
:
"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
,
"reason"
:
"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name"
:
"ohos.permission.GET_BUNDLE_INFO"
,
"reason"
:
"need use ohos.permission.GET_BUNDLE_INFO"
},
{
"name"
:
"ohos.permission.CHANGE_ABILITY_ENABLED_STATE"
,
"reason"
:
"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE"
},
{
"name"
:
"ohos.permission.MANAGE_LOCAL_ACCOUNTS"
,
"reason"
:
"ceshi"
},
{
"name"
:
"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION"
,
"reason"
:
"ceshi"
},
{
"name"
:
"ohos.permission.REMOVE_CACHE_FILES"
,
"reason"
:
"need use ohos.permission.REMOVE_CACHE_FILES"
},
{
"name"
:
"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS"
,
"reason"
:
"need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS"
},
{
"name"
:
"ohos.permission.LISTEN_BUNDLE_CHANGE"
,
"reason"
:
"need use ohos.permission.LISTEN_BUNDLE_CHANGE"
},
{
"name"
:
"ohos.permission.INSTALL_BUNDLE"
,
"reason"
:
"need use ohos.permission.INSTALL_BUNDLE"
},
{
"name"
:
"ohos.permission.MANAGE_MISSIONS"
,
"reason"
:
"need use ohos.permission.MANAGE_MISSIONS"
},
{
"name"
:
"ohos.permission.GET_RUNNING_INFO"
,
"reason"
:
"need use ohos.permission.GET_RUNNING_INFO"
},
{
"name"
:
"ohos.permission.CLEAN_BACKGROUND_PROCESSES"
,
"reason"
:
"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES"
},
{
"name"
:
"ohos.permission.CLEAN_APPLICATION_DATA"
,
"reason"
:
"need use ohos.permission.CLEAN_APPLICATION_DATA"
}
]
}
}
customization/TestExtensionAbility_001/entry/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
925753ff
{
"string"
:
[
{
"name"
:
"phone_entry_dsc"
,
"value"
:
"i am an entry for phone"
},
{
"name"
:
"phone_entry_main"
,
"value"
:
"the phone entry ability"
},
{
"name"
:
"entry_label"
,
"value"
:
"ActsContextTest"
},
{
"name"
:
"form_description"
,
"value"
:
"my form"
},
{
"name"
:
"serviceability_description"
,
"value"
:
"my whether"
},
{
"name"
:
"description_application"
,
"value"
:
"demo for test"
},
{
"name"
:
"app_name"
,
"value"
:
"Demo"
}
]
}
\ No newline at end of file
customization/
enterprise_device_management
/src/main/resources/base/media/icon.png
→
customization/
TestExtensionAbility_001/entry
/src/main/resources/base/media/icon.png
浏览文件 @
925753ff
文件已移动
customization/TestExtensionAbility_001/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
925753ff
{
"src"
:
[
"pages/index/index"
,
"pages/second/second"
]
}
\ No newline at end of file
customization/
enterprise_device_management
/signature/openharmony_sx.p7b
→
customization/
TestExtensionAbility_001
/signature/openharmony_sx.p7b
浏览文件 @
925753ff
无法预览此类型文件
customization/edm_xts_stage/AppScope/app.json
0 → 100644
浏览文件 @
925753ff
{
"app"
:
{
"bundleName"
:
"com.example.myapplication"
,
"vendor"
:
"huawei"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"debug"
:
false
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:app_name"
,
"description"
:
"$string:description_application"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
9
,
"targetAPIVersion"
:
9
,
"car"
:
{
"apiCompatibleVersion"
:
9
,
"singleUser"
:
false
}
}
}
\ No newline at end of file
customization/edm_xts_stage/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
925753ff
{
"string"
:[
{
"name"
:
"app_name"
,
"value"
:
"ohosProject"
}
]
}
\ No newline at end of file
customization/edm_xts_stage/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
925753ff
15.1 KB
customization/e
nterprise_device_management
/BUILD.gn
→
customization/e
dm_xts_stage
/BUILD.gn
浏览文件 @
925753ff
# Copyright (
C) 2022
Huawei Device Co., Ltd.
# 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
...
...
@@ -13,28 +13,29 @@
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"
ohos_js_hap_suite("ActsEdmTest") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":edm_assets",
":edm_
js_
assets",
":edm_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsEdmJsTest"
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsEdmTest"
}
ohos_js_assets("edm_assets") {
source_dir = "./src/main/js/default"
ohos_app_scope("edm_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("edm_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("edm_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
sources = [ "entry/src/main/resources" ]
deps = [ ":edm_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
customization/e
nterprise_device_management
/Test.json
→
customization/e
dm_xts_stage
/Test.json
浏览文件 @
925753ff
{
"description"
:
"Configuration for
enterprise device management
Tests"
,
"description"
:
"Configuration for
hjunit demo
Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"
30
0000"
,
"package"
:
"
ohos.edm.test
"
,
"shell-timeout"
:
"60000"
"test-timeout"
:
"
18
0000"
,
"package"
:
"
com.example.myapplication
"
,
"shell-timeout"
:
"60000
0
"
},
"kits"
:
[
{
...
...
@@ -17,12 +17,12 @@
]
},
{
"test-file-name"
:
[
"ActsEdmJs
Test.hap"
,
"edmJstest1
.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
"test-file-name"
:
[
"ActsEdm
Test.hap"
,
"ExtensionZeroTest
.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
}
\ No newline at end of file
customization/edm_xts_stage/entry/src/main/ets/Application/AbilityStage.ts
0 → 100644
浏览文件 @
925753ff
import
AbilityStage
from
"
@ohos.application.AbilityStage
"
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
"
[Demo] MyAbilityStage onCreate
"
)
globalThis
.
stageOnCreateRun
=
1
;
globalThis
.
stageContext
=
this
.
context
;
}
}
customization/e
nterprise_device_management/src/main/js/default/test/List.test.j
s
→
customization/e
dm_xts_stage/entry/src/main/ets/EnterpriseAdminAbility/EnterpriseAdminAbility.t
s
浏览文件 @
925753ff
/*
* Copyright (
C
) 2022 Huawei Device Co., Ltd.
* 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
* 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,
...
...
@@ -12,4 +12,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require
(
'
./EnterpriseDeviceManager.test.js
'
)
import
EnterpriseAdminExtensionAbility
from
'
@ohos.EnterpriseAdminExtensionAbility
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
"
deccjsunit/index
"
export
default
class
EnterpriseAdminAbility
extends
EnterpriseAdminExtensionAbility
{
onAdminEnabled
()
{
console
.
log
(
'
EnterpriseAdminExtensionAbility onAdminEnabled
'
);
}
onAdminDisabled
(){
console
.
log
(
'
EnterpriseAdminExtensionAbility onAdminDisabled
'
);
}
}
\ No newline at end of file
customization/edm_xts_stage/entry/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
925753ff
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
(
"
[Demo] MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
}
onDestroy
()
{
// Ability is destroying, release resources for this ability
console
.
log
(
"
[Demo] MainAbility onDestroy
"
)
}
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
log
(
"
[Demo] MainAbility onWindowStageCreate windowStage=
"
+
windowStage
)
globalThis
.
windowStage
=
windowStage
globalThis
.
abilityStorage
=
this
.
storage
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
pages/index/index
"
,
null
)
}
onWindowStageDestroy
()
{
//Main window is destroyed, release UI related resources
console
.
log
(
"
[Demo] MainAbility onWindowStageDestroy
"
)
}
onForeground
()
{
// Ability has brought to foreground
console
.
log
(
"
[Demo] MainAbility onForeground
"
)
}
onBackground
()
{
// Ability has back to background
console
.
log
(
"
[Demo] MainAbility onBackground
"
)
}
};
\ No newline at end of file
customization/edm_xts_stage/entry/src/main/ets/pages/index/index.ets
0 → 100644
浏览文件 @
925753ff
/*
* 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.info("start run testcase!!!!")
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.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters))
globalThis.abilityWant.parameters.timeout = 70000;
configService.setConfig(globalThis.abilityWant.parameters)
// testsuite(globalThis.abilityContext,globalThis.windowStage,globalThis.abilityStorage)
testsuite()
core.execute()
}
build() {
Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World')
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
customization/edm_xts_stage/entry/src/main/ets/pages/second/second.ets
0 → 100644
浏览文件 @
925753ff
/*
* 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
customization/e
nterprise_device_management/src/main/js/default/app.j
s
→
customization/e
dm_xts_stage/entry/src/main/ets/test/List.test.et
s
浏览文件 @
925753ff
/*
* Copyright (
C) 2022
Huawei Device Co., Ltd.
* 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
...
...
@@ -12,12 +12,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import edmPromiseTest from './edmPromise.test.ets'
import edmCallbackTest from './edmCallback.test.ets'
export
default
{
onCreate
()
{
console
.
info
(
'
TestApplication onCreate
'
);
},
onDestroy
()
{
console
.
info
(
'
TestApplication onDestroy
'
);
}
};
export default function testsuite() {
edmCallbackTest()
edmPromiseTest()
}
\ No newline at end of file
customization/e
nterprise_device_management/src/main/js/default/pages/index/index.j
s
→
customization/e
dm_xts_stage/entry/src/main/ets/test/commom.et
s
浏览文件 @
925753ff
/*
* Copyright (
C
) 2022 Huawei Device Co., Ltd.
* 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
...
...
@@ -13,33 +13,33 @@
* limitations under the License.
*/
import
{
Core
,
ExpectExtend
}
from
'
deccjsunit/index
'
const WANT1 = {
bundleName: "com.example.extensionzerotest",
abilityName: "com.example.extensionzerotest.EnterpriseAdminAbility"
};
const ENTINFO1 = {
name: "company",
description: "edm demo"
};
const
injectRef
=
Object
.
getPrototypeOf
(
global
)
||
global
injectRef
.
regeneratorRuntime
=
require
(
'
@babel/runtime/regenerator
'
)
const SELFWANT = {
bundleName: "com.example.myapplication",
abilityName: "com.example.myapplication.EnterpriseAdminAbility"
};
const SELFHAPNAME = "com.example.myapplication"
const COMPANYNAME2 = "company2"
const DESCRIPTION2 = "edm demo2"
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 ENTINFO2 = {
name: "company2",
description: "edm demo2"
};
const
configService
=
core
.
getDefaultService
(
'
config
'
)
configService
.
setConfig
(
this
)
const DEFAULT_USER_ID = 100;
const TEST_USER_ID = 101;
const ERR_USER_ID = 102;
require
(
'
../../test/List.test
'
)
core
.
execute
()
},
onReady
()
{
},
}
export {
WANT1, ENTINFO1, SELFWANT, SELFHAPNAME, COMPANYNAME2, DESCRIPTION2, ENTINFO2,
DEFAULT_USER_ID, TEST_USER_ID, ERR_USER_ID
}
\ No newline at end of file
customization/edm_xts_stage/entry/src/main/ets/test/edmCallback.test.ets
0 → 100644
浏览文件 @
925753ff
/*
* 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
"hypium/index"
import
{
WANT1
,
ENTINFO1
,
SELFWANT
,
SELFHAPNAME
,
COMPANYNAME2
,
DESCRIPTION2
,
ENTINFO2
,
DEFAULT_USER_ID
,
TEST_USER_ID
,
ERR_USER_ID
}
from
"./commom.ets"
;
import
enterpriseDeviceManager
from
'@ohos.enterpriseDeviceManager'
export
default
function
edmCallbackTest
()
{
describe
(
'edmCallback_test'
,
function
()
{
/**
* @tc.number SUB_CUSTOMIZATION_ENTERPRISE_DEVICE_MANAGER_JS_0001
* @tc.name test enableAdmin method in callback mode without user id
* @tc.desc enable admin in callback mode
*/
it
(
'enableAdmin_test_002'
,
0
,
async
function
(
done
)
{
var
retValue
=
await
enterpriseDeviceManager
.
enableAdmin
(
WANT1
,
ENTINFO1
,
enterpriseDeviceManager
.
AdminType
.
ADMIN_TYPE_NORMAL
,
OnReceiveEvent
);
async
function
OnReceiveEvent
(
err
,
datainfo
)
{
console
.
log
(
'enterpriseDeviceManager.enableAdmin ADMIN_TYPE_NORMAL :'
+
datainfo
);
expect
(
datainfo
)
.
assertTrue
();
var
isEnabled
=
await
enterpriseDeviceManager
.
isAdminEnabled
(
WANT1
);
console
.
log
(
'enterpriseDeviceManager.isAdminEnabled :'
+
isEnabled
);
expect
(
isEnabled
)
.
assertTrue
();
retValue
=
await
enterpriseDeviceManager
.
disableAdmin
(
WANT1
);
console
.
log
(
'enterpriseDeviceManager.disableAdmin : '
+
retValue
);
expect
(
retValue
)
.
assertTrue
();
isEnabled
=
await
enterpriseDeviceManager
.
isAdminEnabled
(
WANT1
);
console
.
log
(
'enterpriseDeviceManager.isAdminEnabled : '
+
isEnabled
);
expect
(
isEnabled
)
.
assertFalse
();
done
();
}
})
/**
* @tc.number SUB_CUSTOMIZATION_ENTERPRISE_DEVICE_MANAGER_JS_0004
* @tc.name test enableAdmin method in callback mode with ADMIN_TYPE_SUPER param without user id
* @tc.desc enable super admin in callback mode
*/
it
(
'enableAdmin_test_004'
,
0
,
async
function
(
done
)
{
var
retValue
=
await
enterpriseDeviceManager
.
enableAdmin
(
SELFWANT
,
ENTINFO1
,
enterpriseDeviceManager
.
AdminType
.
ADMIN_TYPE_SUPER
,
OnReceiveEvent
);
async
function
OnReceiveEvent
(
err
,
datainfo
)
{
console
.
log
(
'enterpriseDeviceManager.enableAdmin : '
+
retValue
);
expect
(
datainfo
)
.
assertTrue
();
var
isEnabled
=
await
enterpriseDeviceManager
.
isSuperAdmin
(
SELFHAPNAME
);
console
.
log
(
'enterpriseDeviceManager.isSuperAdmin :'
+
isEnabled
);
expect
(
isEnabled
)
.
assertTrue
();
retValue
=
await
enterpriseDeviceManager
.
disableSuperAdmin
(
SELFHAPNAME
);
console
.
log
(
'enterpriseDeviceManager.disableSuperAdmin : '
+
retValue
);
expect
(
retValue
)
.
assertTrue
();
isEnabled
=
await
enterpriseDeviceManager
.
isSuperAdmin
(
SELFHAPNAME
);
console
.
log
(
'enterpriseDeviceManager.isSuperAdmin : '
+
isEnabled
);
expect
(
isEnabled
)
.
assertFalse
();
done
();
}
})
/**
* @tc.number SUB_CUSTOMIZATION_ENTERPRISE_DEVICE_MANAGER_JS_0006
* @tc.name test enableAdmin method in callback mode without user id
* @tc.desc enable admin in callback mode
*/
it
(
'enableAdmin_test_006'
,
0
,
async
function
(
done
)
{
console
.
log
(
' enableAdmin()'
);
var
retValue
=
await
enterpriseDeviceManager
.
enableAdmin
(
WANT1
,
ENTINFO1
,
enterpriseDeviceManager
.
AdminType
.
ADMIN_TYPE_NORMAL
,
OnReceiveEvent
);
async
function
OnReceiveEvent
(
err
,
datainfo
)
{
console
.
log
(
'enterpriseDeviceManager.enableAdmin ADMIN_TYPE_NORMAL :'
+
datainfo
);
expect
(
datainfo
)
.
assertTrue
();
var
isEnabled
=
await
enterpriseDeviceManager
.
isAdminEnabled
(
WANT1
);
console
.
log
(
'enterpriseDeviceManager.isAdminEnabled :'
+
isEnabled
);
expect
(
isEnabled
)
.
assertTrue
();
retValue
=
await
enterpriseDeviceManager
.
disableAdmin
(
WANT1
);
console
.
log
(
'enterpriseDeviceManager.disableAdmin : '
+
retValue
);
expect
(
retValue
)
.
assertTrue
();
isEnabled
=
await
enterpriseDeviceManager
.
isAdminEnabled
(
WANT1
);
console
.
log
(
'enterpriseDeviceManager.isAdminEnabled : '
+
isEnabled
);
expect
(
isEnabled
)
.
assertFalse
();
done
();
}
})
/**
* @tc.number SUB_CUSTOMIZATION_ENTERPRISE_DEVICE_MANAGER_JS_0008
* @tc.name test enableAdmin method with user id in callback mode with default user id
* @tc.desc enable admin in multi-user
*/
it
(
'enableAdmin_test_008'
,
0
,
async
function
(
done
)
{
var
retValue
=
await
enterpriseDeviceManager
.
enableAdmin
(
WANT1
,
ENTINFO1
,
enterpriseDeviceManager
.
AdminType
.
ADMIN_TYPE_NORMAL
,
DEFAULT_USER_ID
,
OnReceiveEvent
);
async
function
OnReceiveEvent
(
err
,
datainfo
)
{
console
.
log
(
'enterpriseDeviceManager.enableAdmin ADMIN_TYPE_NORMAL :'
+
datainfo
);
expect
(
datainfo
)
.
assertTrue
();
var
isEnabled
=
await
enterpriseDeviceManager
.
isAdminEnabled
(
WANT1
,
DEFAULT_USER_ID
);
console
.
log
(
'enterpriseDeviceManager.isAdminEnabled :'
+
isEnabled
);
expect
(
isEnabled
)
.
assertTrue
();
retValue
=
await
enterpriseDeviceManager
.
disableAdmin
(
WANT1
,
DEFAULT_USER_ID
);
console
.
log
(
'enterpriseDeviceManager.disableAdmin : '
+
retValue
);
expect
(
retValue
)
.
assertTrue
();
isEnabled
=
await
enterpriseDeviceManager
.
isAdminEnabled
(
WANT1
,
DEFAULT_USER_ID
);
console
.
log
(
'enterpriseDeviceManager.isAdminEnabled : '
+
isEnabled
);
expect
(
isEnabled
)
.
assertFalse
();
done
();
}
})
/**
* @tc.number SUB_CUSTOMIZATION_ENTERPRISE_DEVICE_MANAGER_JS_0012
* @tc.name test enableAdmin method in callback mode with test user id
* @tc.desc enable admin in multi-user
*/
it
(
'enableAdmin_test_012'
,
0
,
async
function
(
done
)
{
var
retValue
=
await
enterpriseDeviceManager
.
enableAdmin
(
WANT1
,
ENTINFO1
,
enterpriseDeviceManager
.
AdminType
.
ADMIN_TYPE_NORMAL
,
TEST_USER_ID
,
OnReceiveEvent
);
async
function
OnReceiveEvent
(
err
,
datainfo
)
{
console
.
log
(
'enterpriseDeviceManager.enableAdmin ADMIN_TYPE_NORMAL :'
+
datainfo
);
expect
(
datainfo
)
.
assertTrue
();
var
isEnabled
=
await
enterpriseDeviceManager
.
isAdminEnabled
(
WANT1
,
TEST_USER_ID
);
console
.
log
(
'enterpriseDeviceManager.isAdminEnabled :'
+
isEnabled
);
expect
(
isEnabled
)
.
assertTrue
();
retValue
=
await
enterpriseDeviceManager
.
disableAdmin
(
WANT1
,
TEST_USER_ID
);
console
.
log
(
'enterpriseDeviceManager.disableAdmin : '
+
retValue
);
expect
(
retValue
)
.
assertTrue
();
isEnabled
=
await
enterpriseDeviceManager
.
isAdminEnabled
(
WANT1
,
TEST_USER_ID
);
console
.
log
(
'enterpriseDeviceManager.isAdminEnabled : '
+
isEnabled
);
expect
(
isEnabled
)
.
assertFalse
();
done
();
}
})
/**
* @tc.number SUB_CUSTOMIZATION_ENTERPRISE_DEVICE_MANAGER_JS_0013
* @tc.name test enableAdmin method in promise mode and query with error user id
* @tc.desc enable admin in multi-user
*/
it
(
'enableAdmin_test_013'
,
0
,
async
function
(
done
)
{
var
retValue
=
await
enterpriseDeviceManager
.
enableAdmin
(
WANT1
,
ENTINFO1
,
enterpriseDeviceManager
.
AdminType
.
ADMIN_TYPE_NORMAL
,
DEFAULT_USER_ID
,
OnReceiveEvent
);
async
function
OnReceiveEvent
(
err
,
datainfo
)
{
console
.
log
(
'enterpriseDeviceManager.enableAdmin ADMIN_TYPE_NORMAL :'
+
datainfo
);
expect
(
datainfo
)
.
assertTrue
();
var
isEnabled
=
await
enterpriseDeviceManager
.
isAdminEnabled
(
WANT1
,
TEST_USER_ID
);
console
.
log
(
'enterpriseDeviceManager.isAdminEnabled :'
+
isEnabled
);
expect
(
isEnabled
)
.
assertFalse
();
retValue
=
await
enterpriseDeviceManager
.
disableAdmin
(
WANT1
,
DEFAULT_USER_ID
);
console
.
log
(
'enterpriseDeviceManager.disableAdmin : '
+
retValue
);
expect
(
retValue
)
.
assertTrue
();
isEnabled
=
await
enterpriseDeviceManager
.
isAdminEnabled
(
WANT1
,
DEFAULT_USER_ID
);
console
.
log
(
'enterpriseDeviceManager.isAdminEnabled : '
+
isEnabled
);
expect
(
isEnabled
)
.
assertFalse
();
done
();
}
})
/**
* @tc.number SUB_CUSTOMIZATION_ENTERPRISE_DEVICE_MANAGER_JS_0014
* @tc.name test enableAdmin method in callback mode and disable with error user id
* @tc.desc enable and disable admin in multi-user
*/
it
(
'enableAdmin_test_014'
,
0
,
async
function
(
done
)
{
var
retValue
=
await
enterpriseDeviceManager
.
enableAdmin
(
WANT1
,
ENTINFO1
,
enterpriseDeviceManager
.
AdminType
.
ADMIN_TYPE_NORMAL
,
TEST_USER_ID
,
OnReceiveEvent
);
async
function
OnReceiveEvent
(
err
,
datainfo
)
{
console
.
log
(
'enterpriseDeviceManager.enableAdmin ADMIN_TYPE_NORMAL :'
+
datainfo
);
expect
(
datainfo
)
.
assertTrue
();
var
isEnabled
=
await
enterpriseDeviceManager
.
isAdminEnabled
(
WANT1
,
TEST_USER_ID
);
console
.
log
(
'enterpriseDeviceManager.isAdminEnabled :'
+
isEnabled
);
expect
(
isEnabled
)
.
assertTrue
();
try
{
retValue
=
await
enterpriseDeviceManager
.
disableAdmin
(
WANT1
,
DEFAULT_USER_ID
);
console
.
log
(
'enterpriseDeviceManager.disableAdmin over'
);
}
catch
(
error
)
{
expect
(
error
!=
null
)
.
assertTrue
();
console
.
log
(
"enableAdmin_test_014 throw error code : "
+
error
.
code
+
"message :"
+
error
.
message
);
}
isEnabled
=
await
enterpriseDeviceManager
.
isAdminEnabled
(
WANT1
,
TEST_USER_ID
);
console
.
log
(
'enterpriseDeviceManager.isAdminEnabled : '
+
isEnabled
);
expect
(
isEnabled
)
.
assertTrue
();
retValue
=
await
enterpriseDeviceManager
.
disableAdmin
(
WANT1
,
TEST_USER_ID
);
console
.
log
(
'enterpriseDeviceManager.disableAdmin : '
+
retValue
);
expect
(
retValue
)
.
assertTrue
();
isEnabled
=
await
enterpriseDeviceManager
.
isAdminEnabled
(
WANT1
,
TEST_USER_ID
);
console
.
log
(
'enterpriseDeviceManager.isAdminEnabled : '
+
isEnabled
);
expect
(
isEnabled
)
.
assertFalse
();
done
();
}
})
/**
* @tc.number SUB_CUSTOMIZATION_ENTERPRISE_DEVICE_MANAGER_JS_0017
* @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
.
enableAdmin
(
SELFWANT
,
ENTINFO1
,
enterpriseDeviceManager
.
AdminType
.
ADMIN_TYPE_NORMAL
);
console
.
log
(
'enterpriseDeviceManager.enableAdmin ADMIN_TYPE_NORMAL : '
+
retValue
);
expect
(
retValue
)
.
assertTrue
();
var
isEnabled
=
await
enterpriseDeviceManager
.
isAdminEnabled
(
SELFWANT
);
expect
(
isEnabled
)
.
assertTrue
();
console
.
log
(
'enterpriseDeviceManager.isAdminEnabled : '
+
isEnabled
);
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
.
disableAdmin
(
SELFWANT
);
console
.
log
(
'enterpriseDeviceManager.disableAdmin : '
+
retValue
);
expect
(
retValue
)
.
assertTrue
();
isEnabled
=
await
enterpriseDeviceManager
.
isAdminEnabled
(
SELFWANT
);
console
.
log
(
'enterpriseDeviceManager.isAdminEnabled : '
+
isEnabled
);
expect
(
isEnabled
)
.
assertFalse
();
done
();
}
})
/**
* @tc.number SUB_CUSTOMIZATION_ENTERPRISE_DEVICE_MANAGER_JS_0018
* @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_0021
* @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
.
enableAdmin
(
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
.
disableSuperAdmin
(
SELFHAPNAME
);
done
();
})
})
}
customization/e
nterprise_device_management/src/main/js/default/test/EnterpriseDeviceManager.test.j
s
→
customization/e
dm_xts_stage/entry/src/main/ets/test/edmPromise.test.et
s
浏览文件 @
925753ff
此差异已折叠。
点击以展开。
customization/edm_xts_stage/entry/src/main/module.json
0 → 100644
浏览文件 @
925753ff
{
"module"
:
{
"name"
:
"phone"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/AbilityStage.ts"
,
"description"
:
"$string:phone_entry_dsc"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"phone"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"uiSyntax"
:
"ets"
,
"pages"
:
"$profile:main_pages"
,
"abilities"
:
[{
"name"
:
"com.example.myapplication.MainAbility"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:phone_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"orientation"
:
"portrait"
,
"skills"
:
[{
"actions"
:
[
"action.system.home"
],
"entities"
:
[
"entity.system.home"
]
}]
}],
"extensionAbilities"
:
[
{
"srcEntrance"
:
"./ets/EnterpriseAdminAbility/EnterpriseAdminAbility.ts"
,
"name"
:
"com.example.myapplication.EnterpriseAdminAbility"
,
"icon"
:
"$media:icon"
,
"srcLanguage"
:
"ets"
,
"description"
:
"$string:phone_entry_main"
,
"type"
:
"enterpriseAdmin"
,
"visible"
:
true
}
],
"requestPermissions"
:
[
{
"name"
:
"ohos.permission.SYSTEM_FLOAT_WINDOW"
,
"reason"
:
"need use ohos.permission.SYSTEM_FLOAT_WINDOW"
},
{
"name"
:
"ohos.permission.CAPTURE_SCREEN"
,
"reason"
:
"need use ohos.permission.SYSTEM_FLOAT_WINDOW"
},
{
"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"
}
]
}
}
\ No newline at end of file
customization/edm_xts_stage/entry/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
925753ff
{
"string"
:
[
{
"name"
:
"phone_entry_dsc"
,
"value"
:
"i am an entry for phone"
},
{
"name"
:
"phone_entry_main"
,
"value"
:
"the phone entry ability"
},
{
"name"
:
"entry_label"
,
"value"
:
"ActsContextTest"
},
{
"name"
:
"form_description"
,
"value"
:
"my form"
},
{
"name"
:
"serviceability_description"
,
"value"
:
"my whether"
},
{
"name"
:
"description_application"
,
"value"
:
"demo for test"
},
{
"name"
:
"app_name"
,
"value"
:
"Demo"
}
]
}
customization/edm_xts_stage/entry/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
925753ff
15.1 KB
customization/edm_xts_stage/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
925753ff
{
"src"
:
[
"pages/index/index"
,
"pages/second/second"
]
}
\ No newline at end of file
customization/e
nterprise_device_management/edmsceneon
e/signature/openharmony_sx.p7b
→
customization/e
dm_xts_stag
e/signature/openharmony_sx.p7b
浏览文件 @
925753ff
无法预览此类型文件
customization/enterprise_device_management/edmsceneone/src/main/config.json
已删除
100644 → 0
浏览文件 @
d43070b9
{
"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
customization/enterprise_device_management/edmsceneone/src/main/js/default/i18n/en-US.json
已删除
100644 → 0
浏览文件 @
d43070b9
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
customization/enterprise_device_management/edmsceneone/src/main/js/default/i18n/zh-CN.json
已删除
100644 → 0
浏览文件 @
d43070b9
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
customization/enterprise_device_management/edmsceneone/src/main/js/default/pages/index/index.css
已删除
100644 → 0
浏览文件 @
d43070b9
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
100px
;
}
customization/enterprise_device_management/edmsceneone/src/main/js/default/pages/index/index.hml
已删除
100644 → 0
浏览文件 @
d43070b9
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
customization/enterprise_device_management/edmsceneone/src/main/js/resources/base/element/string.json
已删除
100644 → 0
浏览文件 @
d43070b9
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"bmssceneone"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
customization/enterprise_device_management/src/main/config.json
已删除
100644 → 0
浏览文件 @
d43070b9
{
"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
}
}
]
}
}
customization/enterprise_device_management/src/main/js/default/i18n/en-US.json
已删除
100644 → 0
浏览文件 @
d43070b9
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
customization/enterprise_device_management/src/main/js/default/i18n/zh-CN.json
已删除
100644 → 0
浏览文件 @
d43070b9
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
customization/enterprise_device_management/src/main/js/default/pages/index/index.css
已删除
100644 → 0
浏览文件 @
d43070b9
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
100px
;
}
customization/enterprise_device_management/src/main/js/default/pages/index/index.hml
已删除
100644 → 0
浏览文件 @
d43070b9
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{title}}
</text>
</div>
customization/enterprise_device_management/src/main/resources/base/element/plural.json
已删除
100644 → 0
浏览文件 @
d43070b9
{
"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
customization/enterprise_device_management/src/main/resources/base/element/strarray.json
已删除
100644 → 0
浏览文件 @
d43070b9
{
"strarray"
:
[
{
"name"
:
"sizeList"
,
"value"
:[
{
"value"
:
"small"
},
{
"value"
:
"middle"
},
{
"value"
:
"large"
},
{
"value"
:
"extra large"
}
]
}
]
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录