Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
ddc51328
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看板
提交
ddc51328
编写于
11月 08, 2021
作者:
O
openharmony_ci
提交者:
Gitee
11月 08, 2021
浏览文件
操作
浏览文件
下载
差异文件
!1050 Modify test code
Merge pull request !1050 from blackleon/update_code_1107
上级
7c16dc50
a6e6b03f
变更
38
展开全部
显示空白变更内容
内联
并排
Showing
38 changed file
with
2471 addition
and
8 deletion
+2471
-8
aafwk/aafwk_standard/BUILD.gn
aafwk/aafwk_standard/BUILD.gn
+2
-0
aafwk/aafwk_standard/abilitymanager/sceneProject/clearmissionscallback/src/main/js/test/MangerAbilityJsunit.test.js
...ionscallback/src/main/js/test/MangerAbilityJsunit.test.js
+6
-0
aafwk/aafwk_standard/abilitymanager/sceneProject/clearmissionspromise/src/main/js/test/MangerAbilityJsunit.test.js
...sionspromise/src/main/js/test/MangerAbilityJsunit.test.js
+1
-3
aafwk/aafwk_standard/verifypermission/AmsJsStMain/BUILD.gn
aafwk/aafwk_standard/verifypermission/AmsJsStMain/BUILD.gn
+31
-0
aafwk/aafwk_standard/verifypermission/AmsJsStMain/Test.json
aafwk/aafwk_standard/verifypermission/AmsJsStMain/Test.json
+4
-0
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/config.json
...d/verifypermission/AmsJsStMain/entry/src/main/config.json
+276
-0
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/app.js
...fypermission/AmsJsStMain/entry/src/main/js/default/app.js
+23
-0
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/i18n/en-US.json
...ion/AmsJsStMain/entry/src/main/js/default/i18n/en-US.json
+6
-0
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/i18n/zh-CN.json
...ion/AmsJsStMain/entry/src/main/js/default/i18n/zh-CN.json
+6
-0
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/index/index.css
...sJsStMain/entry/src/main/js/default/pages/index/index.css
+56
-0
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/index/index.hml
...sJsStMain/entry/src/main/js/default/pages/index/index.hml
+11
-0
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/index/index.js
...msJsStMain/entry/src/main/js/default/pages/index/index.js
+52
-0
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/permissionPage/permissionPage.css
...c/main/js/default/pages/permissionPage/permissionPage.css
+50
-0
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/permissionPage/permissionPage.hml
...c/main/js/default/pages/permissionPage/permissionPage.hml
+26
-0
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/permissionPage/permissionPage.js
...rc/main/js/default/pages/permissionPage/permissionPage.js
+122
-0
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/permissionPage/permissioncase.js
...rc/main/js/default/pages/permissionPage/permissioncase.js
+1052
-0
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/test/AmsJsunit.test.js
...sion/AmsJsStMain/entry/src/main/js/test/AmsJsunit.test.js
+201
-0
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/test/List.test.js
...ermission/AmsJsStMain/entry/src/main/js/test/List.test.js
+16
-0
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/resources/base/element/string.json
...sStMain/entry/src/main/resources/base/element/string.json
+32
-0
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/resources/base/media/icon.png
.../AmsJsStMain/entry/src/main/resources/base/media/icon.png
+0
-0
aafwk/aafwk_standard/verifypermission/AmsJsStMain/signature/openharmony_sx.p7b
...verifypermission/AmsJsStMain/signature/openharmony_sx.p7b
+0
-0
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/BUILD.gn
...k_standard/verifypermission/AmsJsStSubPermission/BUILD.gn
+31
-0
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/Test.json
..._standard/verifypermission/AmsJsStSubPermission/Test.json
+4
-0
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/config.json
...ermission/AmsJsStSubPermission/entry/src/main/config.json
+82
-0
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/app.js
...ion/AmsJsStSubPermission/entry/src/main/js/default/app.js
+23
-0
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/i18n/en-US.json
...StSubPermission/entry/src/main/js/default/i18n/en-US.json
+6
-0
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/i18n/zh-CN.json
...StSubPermission/entry/src/main/js/default/i18n/zh-CN.json
+6
-0
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/pages/index/index.css
...ermission/entry/src/main/js/default/pages/index/index.css
+51
-0
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/pages/index/index.hml
...ermission/entry/src/main/js/default/pages/index/index.hml
+16
-0
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/pages/index/index.js
...Permission/entry/src/main/js/default/pages/index/index.js
+68
-0
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/pages/index/permissioncase.js
...n/entry/src/main/js/default/pages/index/permissioncase.js
+166
-0
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/resources/base/element/string.json
...mission/entry/src/main/resources/base/element/string.json
+12
-0
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/resources/base/media/icon.png
...ubPermission/entry/src/main/resources/base/media/icon.png
+0
-0
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/signature/openharmony_sx.p7b
...mission/AmsJsStSubPermission/signature/openharmony_sx.p7b
+0
-0
aafwk/aafwk_standard/verifypermission/BUILD.gn
aafwk/aafwk_standard/verifypermission/BUILD.gn
+24
-0
appexecfwk/bundle_standard/bundlemanager/actsbmskittest/entry/src/main/js/test/ActsBmsKitTest.test.js
...sbmskittest/entry/src/main/js/test/ActsBmsKitTest.test.js
+1
-0
appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js
...try/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js
+7
-4
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/entry/src/main/js/test/ExampleJsunit.test.js
...geruninstall/entry/src/main/js/test/ExampleJsunit.test.js
+1
-1
未找到文件。
aafwk/aafwk_standard/BUILD.gn
浏览文件 @
ddc51328
...
...
@@ -22,6 +22,8 @@ group("aafwk_standard") {
"featureability:featureability",
"formmanager:formmanager",
"want:want",
#"verifypermission:verifypermission"
]
}
}
aafwk/aafwk_standard/abilitymanager/sceneProject/clearmissionscallback/src/main/js/test/MangerAbilityJsunit.test.js
浏览文件 @
ddc51328
...
...
@@ -39,6 +39,12 @@ describe('ActsAmsCallBackSixth Scene', function () {
);
sleep
(
5000
)
});
function
sleep
(
delay
)
{
var
start
=
(
new
Date
()).
getTime
();
while
((
new
Date
()).
getTime
()
-
start
<
delay
)
{}
}
/*
* @tc.number : Acts_Ams_test_12200
* @tc.name : clearMissions : Clear Missions
...
...
aafwk/aafwk_standard/abilitymanager/sceneProject/clearmissionspromise/src/main/js/test/MangerAbilityJsunit.test.js
浏览文件 @
ddc51328
...
...
@@ -42,9 +42,7 @@ describe('ActsAmsCallBackSixth Scene', function () {
function
sleep
(
delay
)
{
var
start
=
(
new
Date
()).
getTime
();
while
((
new
Date
()).
getTime
()
-
start
<
delay
)
{
continue
;
}
while
((
new
Date
()).
getTime
()
-
start
<
delay
)
{}
}
/*
...
...
aafwk/aafwk_standard/verifypermission/AmsJsStMain/BUILD.gn
0 → 100644
浏览文件 @
ddc51328
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("AmsJsStMain") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "AmsJsStMain"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
}
aafwk/aafwk_standard/verifypermission/AmsJsStMain/Test.json
0 → 100644
浏览文件 @
ddc51328
{
"description"
:
"Configuration for hjunit demo Tests"
,
}
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/config.json
0 → 100644
浏览文件 @
ddc51328
{
"app"
:
{
"bundleName"
:
"com.amsst.amsjsstmain"
,
"vendor"
:
"amsst"
,
"version"
:
{
"code"
:
1
,
"name"
:
"1.0"
},
"apiVersion"
:
{
"compatible"
:
4
,
"target"
:
5
,
"releaseType"
:
"Beta1"
}
},
"deviceConfig"
:
{},
"module"
:
{
"defPermissions"
:
[
{
"name"
:
"com.amsst.permission.SYSPERMISSION"
,
"grantMode"
:
"system_grant"
,
"availableScope"
:
[]
},
{
"name"
:
"ohos.permission.GET_NETWORK_INFO"
,
"grantMode"
:
"system_grant"
,
"availableScope"
:
[]
},
{
"name"
:
"ohos.permission.GET_WIFI_INFO"
,
"grantMode"
:
"system_grant"
,
"availableScope"
:
[]
},
{
"name"
:
"ohos.permission.SET_NETWORK_INFO"
,
"grantMode"
:
"system_grant"
,
"availableScope"
:
[]
},
{
"name"
:
"ohos.permission.SET_WIFI_INFO"
,
"grantMode"
:
"system_grant"
,
"availableScope"
:
[]
},
{
"name"
:
"ohos.permission.CAMERA"
,
"grantMode"
:
"user_grant"
,
"availableScope"
:
[]
},
{
"name"
:
"ohos.permission.PERMISSIONA"
,
"grantMode"
:
"user_grant"
,
"availableScope"
:
[]
},
{
"name"
:
"ohos.permission.PERMISSIONB"
,
"grantMode"
:
"user_grant"
,
"availableScope"
:
[]
},
{
"name"
:
"ohos.permission.PERMISSIONC"
,
"grantMode"
:
"user_grant"
,
"availableScope"
:
[]
},
{
"name"
:
"ohos.permission.PERMISSIOND"
,
"grantMode"
:
"user_grant"
,
"availableScope"
:
[]
}
],
"reqPermissions"
:
[
{
"name"
:
"ohos.permission.CAMERA"
,
"reason"
:
"$string:permreason_camera"
,
"usedScene"
:
{
"ability"
:
[
"com.amsst.amsjsstmain.MainAbility"
],
"when"
:
"always"
}
},
{
"name"
:
"com.amsst.permission.SYSPERMISSION"
,
"reason"
:
"$string:permreason_sys"
,
"usedScene"
:
{
"ability"
:
[
"com.amsst.amsjsstmain.MainAbility"
],
"when"
:
"always"
}
},
{
"name"
:
"ohos.permission.PERMISSIONA"
,
"reason"
:
"NEED ohos.permission.PERMISSIONA"
,
"usedScene"
:
{
"ability"
:
[
"com.amsst.amsjsstmain.MainAbility"
],
"when"
:
"always"
}
},
{
"name"
:
"ohos.permission.PERMISSIONB"
,
"reason"
:
"NEED ohos.permission.PERMISSIONB"
,
"usedScene"
:
{
"ability"
:
[
"com.amsst.amsjsstmain.MainAbility"
],
"when"
:
"always"
}
},
{
"name"
:
"ohos.permission.PERMISSIONC"
,
"reason"
:
"NEED ohos.permission.PERMISSIONC"
,
"usedScene"
:
{
"ability"
:
[
"com.amsst.amsjsstmain.MainAbility"
],
"when"
:
"always"
}
},
{
"name"
:
"ohos.permission.PERMISSIOND"
,
"reason"
:
"NEED ohos.permission.PERMISSIOND"
,
"usedScene"
:
{
"ability"
:
[
"com.amsst.amsjsstmain.MainAbility"
],
"when"
:
"always"
}
},
{
"name"
:
"ohos.permission.GET_NETWORK_INFO"
,
"reason"
:
"$string:permreason_getnetworkinfo"
,
"usedScene"
:
{
"ability"
:
[
"com.amsst.amsjsstmain.MainAbility"
],
"when"
:
"always"
}
},
{
"name"
:
"ohos.permission.USE_BLUETOOTH"
},
{
"name"
:
"ohos.permission.DISCOVER_BLUETOOTH"
},
{
"name"
:
"ohos.permission.SET_NETWORK_INFO"
},
{
"name"
:
"ohos.permission.SET_WIFI_INFO"
},
{
"name"
:
"ohos.permission.SPREAD_STATUS_BAR"
},
{
"name"
:
"ohos.permission.INTERNET"
},
{
"name"
:
"ohos.permission.MODIFY_AUDIO_SETTINGS"
},
{
"name"
:
"ohos.permission.RECEIVER_STARTUP_COMPLETED"
},
{
"name"
:
"ohos.permission.RUNNING_LOCK"
},
{
"name"
:
"ohos.permission.ACCESS_BIOMETRIC"
},
{
"name"
:
"ohos.permission.RCV_NFC_TRANSACTION_EVENT"
},
{
"name"
:
"ohos.permission.COMMONEVENT_STICKY"
},
{
"name"
:
"ohos.permission.SYSTEM_FLOAT_WINDOW"
},
{
"name"
:
"ohos.permission.VIBRATE"
},
{
"name"
:
"ohos.permission.USE_TRUSTCIRCLE_MANAGER"
},
{
"name"
:
"ohos.permission.USE_WHOLE_SCREEN"
},
{
"name"
:
"ohos.permission.SET_WALLPAPER"
},
{
"name"
:
"ohos.permission.SET_WALLPAPER_DIMENSION"
},
{
"name"
:
"ohos.permission.REARRANGE_MISSIONS"
},
{
"name"
:
"ohos.permission.CLEAN_BACKGROUND_PROCESSES"
},
{
"name"
:
"ohos.permission.KEEP_BACKGROUND_RUNNING"
},
{
"name"
:
"ohos.permission.GET_BUNDLE_INFO"
},
{
"name"
:
"ohos.permission.ACCELEROMETER"
},
{
"name"
:
"ohos.permission.GYROSCOPE"
},
{
"name"
:
"ohos.permission.MULTIMODAL_INTERACTIVE"
},
{
"name"
:
"ohos.permission.radio.ACCESS_FM_AM"
},
{
"name"
:
"ohos.permission.NFC_TAG"
},
{
"name"
:
"ohos.permission.NFC_CARD_EMULATION"
},
{
"name"
:
"ohos.permission.DISTRIBUTED_DEVICE_STATE_CHANGE"
},
{
"name"
:
"ohos.permission.GET_DISTRIBUTED_DEVICE_INFO"
}
],
"package"
:
"com.amsst.amsjsstmain"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"com.amsst.amsjsstmain.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:app_name"
,
"type"
:
"page"
,
"launchType"
:
"standard"
,
"visible"
:
true
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
,
"pages/permissionPage/permissionPage"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
true
}
}
]
}
}
\ No newline at end of file
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/app.js
0 → 100644
浏览文件 @
ddc51328
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export
default
{
onCreate
()
{
console
.
info
(
'
AceApplication onCreate
'
);
},
onDestroy
()
{
console
.
info
(
'
AceApplication onDestroy
'
);
}
};
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/i18n/en-US.json
0 → 100644
浏览文件 @
ddc51328
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/i18n/zh-CN.json
0 → 100644
浏览文件 @
ddc51328
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/index/index.css
0 → 100644
浏览文件 @
ddc51328
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
32px
;
color
:
#000000
;
opacity
:
0.9
;
}
@media
screen
and
(
device-type
:
tablet
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
100px
;
}
}
@media
screen
and
(
device-type
:
wearable
)
{
.title
{
font-size
:
28px
;
color
:
#FFFFFF
;
}
}
@media
screen
and
(
device-type
:
tv
)
{
.container
{
background-image
:
url("../../common/images/Wallpaper.png")
;
background-size
:
cover
;
background-repeat
:
no-repeat
;
background-position
:
center
;
}
.title
{
font-size
:
100px
;
color
:
#FFFFFF
;
}
}
@media
screen
and
(
device-type
:
phone
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
60px
;
}
}
div
>
div
{
width
:
100%
;
height
:
200px
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
}
.btn
{
margin-bottom
:
20px
;
}
\ No newline at end of file
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/index/index.hml
0 → 100644
浏览文件 @
ddc51328
<div class="container">
<div>
<text class="title">
{{ title }}
</text>
</div>
<div>
<input class="btn" type="button" value="permissionTest" on:click="clickAction"></input>
<input class="btn" type="button" value="changeTitle" on:click="titleAction"></input>
</div>
</div>
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/index/index.js
0 → 100644
浏览文件 @
ddc51328
/*
* 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
app
from
'
@system.app
'
import
router
from
'
@system.router
'
;
import
featureAbility
from
'
@ohos.ability.featureability
'
export
default
{
data
:
{
title
:
"
AmsJsStMain
"
},
onInit
()
{
console
.
debug
(
'
====onInit()====<
'
)
this
.
title
=
"
AmsJsStMain
"
;
},
onShow
()
{
console
.
debug
(
'
====onShow()====<
'
)
},
onReady
()
{
console
.
debug
(
'
====onReady finish====<
'
)
},
onBackPress
(){
console
.
debug
(
'
====onBackPress()====<
'
)
},
async
stopAbility
(){
console
.
debug
(
'
====close====<
'
)
await
featureAbility
.
terminateAbility
();
},
clickAction
(){
console
.
debug
(
'
====clickAction====<
'
)
router
.
replace
({
uri
:
'
pages/permissionPage/permissionPage
'
})
},
titleAction
(){
console
.
debug
(
'
====titleAction()====<
'
)
this
.
title
+=
"
\n
MyTest
"
},
}
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/permissionPage/permissionPage.css
0 → 100644
浏览文件 @
ddc51328
.container
{
justify-content
:
center
;
align-items
:
center
;
left
:
0px
;
top
:
0px
;
width
:
100%
;
height
:
100%
;
}
.title
{
font-size
:
30px
;
text-align
:
center
;
width
:
100%
;
height
:
80px
;
}
div
{
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
}
.btn
{
margin-bottom
:
10px
;
width
:
200px
;
height
:
50px
;
}
.log
{
font-size
:
20px
;
text-align
:
center
;
width
:
100%
;
height
:
400px
;
}
.todo-wraper
{
width
:
450px
;
height
:
450px
;
justify-content
:
center
;
}
.todo-item
{
width
:
450px
;
flex-direction
:
column
;
justify-content
:
center
;
}
.text
{
margin
:
20%
;
}
.menu-wraper
{
width
:
450px
;
height
:
100px
;
justify-content
:
center
;
}
\ No newline at end of file
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/permissionPage/permissionPage.hml
0 → 100644
浏览文件 @
ddc51328
<div class="container">
<div>
<text class="title">
{{ title }}
</text>
</div>
<div class="log">
<textarea class="log">
{{logmessage}}
</textarea>
</div>
<div>
<!-- <input class="btn" type="button" onclick="ShowMenu" class="text">Select Case</input>-->
<select class="menu-wraper" id="menu-wraper" onchange="CaseChange">
<option for="{{testcase}}" value="{{$item}}">abc</option>
</select>
<button type="capsule" class="btn" value="RunSelectCase" on:click="RunSelectCase"></button>
<list class="todo-wraper">
<list-item for="{{testcase}}" class="todo-item">
<input class="btn" type="button" value="{{$item}}" on:click="runCase({{$item}})"></input>
</list-item>
</list>
<button type="capsule" class="btn" value="RunTest" on:click="testAction"></button>
<input class="btn" type="button" value="Back" on:click="clickAction"></input>
</div>
</div>
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/permissionPage/permissionPage.js
0 → 100644
浏览文件 @
ddc51328
/*
* 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
app
from
'
@system.app
'
import
router
from
'
@system.router
'
;
import
featureAbility
from
'
@ohos.ability.featureability
'
import
abilityManager
from
'
@ohos.app.abilitymanager
'
import
{
Core
,
ExpectExtend
,
ReportExtend
}
from
'
deccjsunit/index
'
export
default
{
currentCase
:
""
,
data
:
{
title
:
"
AbilityA1
"
,
logmessage
:
"
this is log message
"
,
testcase
:
[
"
AppPermission_0100
"
,
"
AppPermission_0200
"
,
"
AppPermission_0300
"
,
"
AppPermission_0400
"
,
"
AppPermission_0500
"
,
"
AppPermission_0600
"
,
"
AppPermission_0700
"
,
"
AppPermission_0800
"
,
"
AppPermission_0900
"
,
"
AppPermission_1000
"
,
"
AppPermission_1100
"
,
"
AppPermission_1200
"
,
"
AppPermission_1300
"
,
"
AppPermission_1400
"
,
"
AppPermission_1500
"
,
"
AppPermission_1600
"
,
"
AppPermission_1700
"
,
"
AppPermission_1800
"
,
"
AppPermission_1900
"
,
"
AppPermission_2000
"
,
"
AppPermission_2100
"
,
"
AppPermission_2200
"
,
"
AppPermission_2300
"
,
"
AppPermission_2400
"
,
"
AppPermission_2500
"
,
"
AppPermission_2600_ResPermission
"
,
"
AppPermission_2600
"
,
"
AppPermission_2700_ResPermission
"
,
"
AppPermission_2700
"
,
"
AppPermission_2800_ResPermission
"
,
"
AppPermission_2800
"
,
],
},
onInit
()
{
this
.
title
=
"
AbilityA1
"
;
this
.
logmessage
=
"
this is log message
"
;
},
onShow
()
{
},
onReady
()
{
console
.
info
(
'
====per onReady finish====>
'
)
},
onBackPress
()
{
},
async
stopAbility
()
{
console
.
info
(
'
===========per close===========>
'
)
await
featureAbility
.
terminateAbility
();
await
app
.
killProcessesByBundleName
();
},
clickAction
()
{
router
.
replace
({
uri
:
'
pages/index/index
'
})
},
testAction
()
{
console
.
info
(
'
===========per testAction===========>
'
)
const
core
=
Core
.
getInstance
()
const
expectExtend
=
new
ExpectExtend
({
'
id
'
:
'
extend
'
})
const
reportExtend
=
new
ReportExtend
(
file
)
core
.
addService
(
'
expect
'
,
expectExtend
)
core
.
addService
(
'
report
'
,
reportExtend
)
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
configService
.
setConfig
(
this
)
require
(
'
../../../test/List.test
'
)
core
.
execute
()
},
runCase
(
caseName
)
{
console
.
debug
(
"
======per runCase======>:
"
+
JSON
.
stringify
(
caseName
))
this
.
logmessage
+=
caseName
+
"
\n
"
console
.
debug
(
"
======per runallcase======<:
"
)
let
{
runAllCase
}
=
require
(
'
./permissioncase.js
'
)
runAllCase
(
caseName
,
this
)
},
CaseChange
(
newValue
)
{
let
{
GetCaseInfo
}
=
require
(
'
./permissioncase.js
'
)
this
.
logmessage
=
newValue
.
value
this
.
logmessage
+=
GetCaseInfo
(
newValue
.
value
)
this
.
currentCase
=
newValue
.
value
},
RunSelectCase
()
{
let
{
runAllCase
}
=
require
(
'
./permissioncase.js
'
)
runAllCase
(
this
.
currentCase
,
this
)
},
ShowMenu
()
{
this
.
logmessage
=
"
show
"
this
.
$element
(
"
menu-wraper
"
).
show
({
x
:
200
,
y
:
200
})
}
}
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/default/pages/permissionPage/permissioncase.js
0 → 100644
浏览文件 @
ddc51328
此差异已折叠。
点击以展开。
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/test/AmsJsunit.test.js
0 → 100644
浏览文件 @
ddc51328
/*
* 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
bundle
from
'
@ohos.bundle
'
import
featureAbility
from
'
@ohos.ability.featureability
'
import
abilityManager
from
'
@ohos.app.abilitymanager
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
describe
(
'
AmsSystemTest_AppPermission
'
,
function
()
{
it
(
'
AppPermission_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================AppPermission_0100==================<
'
);
var
dataInfo
=
await
bundle
.
getBundleInfo
(
'
com.amsst.amsjsstmain
'
,
1
);
console
.
debug
(
"
======dataInfo======>:
"
+
JSON
.
stringify
(
dataInfo
));
var
processInfoArray
=
await
abilityManager
.
getAllRunningProcesses
();
console
.
debug
(
"
======processInfoArray======>:
"
+
JSON
.
stringify
(
processInfoArray
));
var
thisProcessInfo
=
processInfoArray
[
0
];
for
(
let
i
=
0
;
i
<
processInfoArray
.
length
;
i
++
)
{
if
(
processInfoArray
[
i
].
processName
==
"
com.amsst.amsjsstmain
"
)
{
thisProcessInfo
=
processInfoArray
[
i
]
break
}
}
console
.
debug
(
"
======thisProcessInfo======>:
"
+
JSON
.
stringify
(
thisProcessInfo
));
var
context
=
await
featureAbility
.
getContext
();
await
context
.
verifyPermission
(
"
ohos.permission.GET_NETWORK_INFO
"
,
thisProcessInfo
.
pid
,
thisProcessInfo
.
uid
,
(
err
,
data
)
=>
{
console
.
debug
(
"
======verifyPermission:data======>:
"
+
JSON
.
stringify
(
data
));
expect
(
err
.
code
).
assertEqual
(
0
)
expect
(
data
).
assertEqual
(
0
)
done
()
})
done
()
})
it
(
'
AppPermission_0200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================AppPermission_0200==================<
'
);
var
processInfoArray
=
await
abilityManager
.
getAllRunningProcesses
();
console
.
debug
(
"
======processInfoArray======>:
"
+
JSON
.
stringify
(
processInfoArray
));
var
thisProcessInfo
=
processInfoArray
[
0
];
for
(
let
i
=
0
;
i
<
processInfoArray
.
length
;
i
++
)
{
if
(
processInfoArray
[
i
].
processName
==
"
com.amsst.amsjsstmain
"
)
{
thisProcessInfo
=
processInfoArray
[
i
]
break
}
}
console
.
debug
(
"
======thisProcessInfo======>:
"
+
JSON
.
stringify
(
thisProcessInfo
));
var
context
=
await
featureAbility
.
getContext
();
var
result
=
await
context
.
verifyPermission
(
"
ohos.permission.GET_NETWORK_INFO
"
,
thisProcessInfo
.
pid
,
thisProcessInfo
.
uid
)
console
.
debug
(
"
======result======>:
"
+
JSON
.
stringify
(
result
));
expect
(
result
).
assertEqual
(
0
);
done
()
})
it
(
'
AppPermission_0300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================AppPermission_0300==================<
'
);
var
processInfoArray
=
await
abilityManager
.
getAllRunningProcesses
();
console
.
debug
(
"
======processInfoArray======>:
"
+
JSON
.
stringify
(
processInfoArray
));
var
thisProcessInfo
=
processInfoArray
[
0
];
for
(
let
i
=
0
;
i
<
processInfoArray
.
length
;
i
++
)
{
if
(
processInfoArray
[
i
].
processName
==
"
com.amsst.amsjsstmain
"
)
{
thisProcessInfo
=
processInfoArray
[
i
]
break
}
}
console
.
debug
(
"
======thisProcessInfo======>:
"
+
JSON
.
stringify
(
thisProcessInfo
));
var
context
=
await
featureAbility
.
getContext
();
await
context
.
verifyPermission
(
"
ohos.permission.GET_NETWORK_INFO
"
,
thisProcessInfo
.
pid
,
thisProcessInfo
.
uid
,
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
)
expect
(
data
).
assertEqual
(
0
)
done
()
})
done
()
})
it
(
'
AppPermission_0400
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================AppPermission_0400==================<
'
);
var
processInfoArray
=
await
abilityManager
.
getAllRunningProcesses
();
console
.
debug
(
"
======processInfoArray======>:
"
+
JSON
.
stringify
(
processInfoArray
));
var
thisProcessInfo
=
processInfoArray
[
0
];
for
(
let
i
=
0
;
i
<
processInfoArray
.
length
;
i
++
)
{
if
(
processInfoArray
[
i
].
processName
==
"
com.amsst.amsjsstmain
"
)
{
thisProcessInfo
=
processInfoArray
[
i
]
break
}
}
console
.
debug
(
"
======thisProcessInfo======>:
"
+
JSON
.
stringify
(
thisProcessInfo
));
var
context
=
await
featureAbility
.
getContext
();
var
result
=
await
context
.
verifyPermission
(
"
com.amsst.permission.SYSPERMISSION
"
,
thisProcessInfo
.
pid
,
thisProcessInfo
.
uid
)
console
.
debug
(
"
======result======>:
"
+
JSON
.
stringify
(
result
));
expect
(
result
).
assertEqual
(
0
);
done
()
})
it
(
'
AppPermission_0500
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================AppPermission_0500==================<
'
);
var
processInfoArray
=
await
abilityManager
.
getAllRunningProcesses
();
console
.
debug
(
"
======processInfoArray======>:
"
+
JSON
.
stringify
(
processInfoArray
));
var
thisProcessInfo
=
processInfoArray
[
0
];
for
(
let
i
=
0
;
i
<
processInfoArray
.
length
;
i
++
)
{
if
(
processInfoArray
[
i
].
processName
==
"
com.amsst.amsjsstmain
"
)
{
thisProcessInfo
=
processInfoArray
[
i
]
break
}
}
console
.
debug
(
"
======thisProcessInfo======>:
"
+
JSON
.
stringify
(
thisProcessInfo
));
var
context
=
await
featureAbility
.
getContext
();
var
result
=
await
context
.
verifySelfPermission
(
"
com.amsst.permission.SYSPERMISSION
"
)
console
.
debug
(
"
======com.amsst.permission.SYSPERMISSION:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.GET_NETWORK_INFO
"
)
console
.
debug
(
"
======ohos.permission.GET_NETWORK_INFO======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.GET_WIFI_INFO
"
)
console
.
debug
(
"
======ohos.permission.GET_WIFI_INFO:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.USE_BLUETOOTH
"
)
console
.
debug
(
"
======ohos.permission.USE_BLUETOOTH:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.DISCOVER_BLUETOOTH
"
)
console
.
debug
(
"
======ohos.permission.DISCOVER_BLUETOOTH:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.SET_NETWORK_INFO
"
)
console
.
debug
(
"
======ohos.permission.SET_NETWORK_INFO:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.SET_WIFI_INFO
"
)
console
.
debug
(
"
======ohos.permission.SET_WIFI_INFO:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.SPREAD_STATUS_BAR
"
)
console
.
debug
(
"
======ohos.permission.SPREAD_STATUS_BAR:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.INTERNET
"
)
console
.
debug
(
"
======ohos.permission.INTERNET:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.MODIFY_AUDIO_SETTINGS
"
)
console
.
debug
(
"
======ohos.permission.MODIFY_AUDIO_SETTINGS:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.RECEIVER_STARTUP_COMPLETED
"
)
console
.
debug
(
"
======ohos.permission.RECEIVER_STARTUP_COMPLETED:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.RUNNING_LOCK
"
)
console
.
debug
(
"
======ohos.permission.RUNNING_LOCK:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.ACCESS_BIOMETRIC
"
)
console
.
debug
(
"
======ohos.permission.ACCESS_BIOMETRIC:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.RCV_NFC_TRANSACTION_EVENT
"
)
console
.
debug
(
"
======ohos.permission.RCV_NFC_TRANSACTION_EVENT:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.COMMONEVENT_STICKY
"
)
console
.
debug
(
"
======ohos.permission.COMMONEVENT_STICKY:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.SYSTEM_FLOAT_WINDOW
"
)
console
.
debug
(
"
======ohos.permission.SYSTEM_FLOAT_WINDOW:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.VIBRATE
"
)
console
.
debug
(
"
======ohos.permission.VIBRATE:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.USE_TRUSTCIRCLE_MANAGER
"
)
console
.
debug
(
"
======ohos.permission.USE_TRUSTCIRCLE_MANAGER:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.USE_WHOLE_SCREEN
"
)
console
.
debug
(
"
======ohos.permission.USE_WHOLE_SCREEN:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.SET_WALLPAPER
"
)
console
.
debug
(
"
======ohos.permission.SET_WALLPAPER:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.SET_WALLPAPER_DIMENSION
"
)
console
.
debug
(
"
======ohos.permission.SET_WALLPAPER_DIMENSION:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.REARRANGE_MISSIONS
"
)
console
.
debug
(
"
======ohos.permission.REARRANGE_MISSIONS:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.CLEAN_BACKGROUND_PROCESSES
"
)
console
.
debug
(
"
======ohos.permission.CLEAN_BACKGROUND_PROCESSES:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.KEEP_BACKGROUND_RUNNING
"
)
console
.
debug
(
"
======ohos.permission.KEEP_BACKGROUND_RUNNING:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.GET_BUNDLE_INFO
"
)
console
.
debug
(
"
======ohos.permission.GET_BUNDLE_INFO:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.ACCELEROMETER
"
)
console
.
debug
(
"
======ohos.permission.ACCELEROMETER:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.GYROSCOPE
"
)
console
.
debug
(
"
======ohos.permission.GYROSCOPE:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.MULTIMODAL_INTERACTIVE
"
)
console
.
debug
(
"
======ohos.permission.MULTIMODAL_INTERACTIVE:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.radio.ACCESS_FM_AM
"
)
console
.
debug
(
"
======ohos.permission.radio.ACCESS_FM_AM:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.NFC_TAG
"
)
console
.
debug
(
"
======ohos.permission.NFC_TAG:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.NFC_CARD_EMULATION
"
)
console
.
debug
(
"
======ohos.permission.NFC_CARD_EMULATION:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.DISTRIBUTED_DEVICE_STATE_CHANGE
"
)
console
.
debug
(
"
======ohos.permission.DISTRIBUTED_DEVICE_STATE_CHANGE:result======>:
"
+
JSON
.
stringify
(
result
));
result
=
await
context
.
verifySelfPermission
(
"
ohos.permission.GET_DISTRIBUTED_DEVICE_INFO
"
)
console
.
debug
(
"
======ohos.permission.GET_DISTRIBUTED_DEVICE_INFO:result======>:
"
+
JSON
.
stringify
(
result
));
expect
(
result
).
assertEqual
(
0
);
done
()
})
it
(
'
AppPermission_5000
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
=====================AppPermission_5000==================<
'
);
var
dataInfo
=
await
bundle
.
getBundleInfo
(
'
com.amsst.amsjsstmain
'
,
1
);
var
context
=
await
featureAbility
.
getContext
();
await
context
.
requestPermissionsFromUser
([
"
ohos.permission.CAMERA
"
],
580
).
then
(
data
=>
console
.
log
(
"
then :
"
+
data
))
.
catch
(
error
=>
console
.
log
(
"
catch :
"
+
error
));
await
context
.
verifyPermission
(
"
ohos.permission.CAMERA
"
,
0
,
dataInfo
.
uid
,
(
err
,
data
)
=>
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
).
assertEqual
(
0
);
done
();
});
done
();
})
})
\ No newline at end of file
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/js/test/List.test.js
0 → 100644
浏览文件 @
ddc51328
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require
(
'
./AmsJsunit.test.js
'
)
\ No newline at end of file
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
ddc51328
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"AmsStMain"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Phone_Empty Feature Ability"
},
{
"name"
:
"permreason_camera"
,
"value"
:
"请求使用摄像头"
},
{
"name"
:
"permreason_sys"
,
"value"
:
"自定义system_grand权限"
},
{
"name"
:
"permreason_getnetworkinfo"
,
"value"
:
"请求访问网络信息"
},
{
"name"
:
"secondability_description"
,
"value"
:
"JS_Empty Ability"
},
{
"name"
:
"entry_SecondAbility"
,
"value"
:
"entry_SecondAbility"
}
]
}
\ No newline at end of file
aafwk/aafwk_standard/verifypermission/AmsJsStMain/entry/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
ddc51328
6.6 KB
aafwk/aafwk_standard/verifypermission/AmsJsStMain/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
ddc51328
文件已添加
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/BUILD.gn
0 → 100644
浏览文件 @
ddc51328
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("AmsJsStSubPermission") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "AmsJsStSubPermission"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
}
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/Test.json
0 → 100644
浏览文件 @
ddc51328
{
"description"
:
"Configuration for hjunit demo Tests"
,
}
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/config.json
0 → 100644
浏览文件 @
ddc51328
{
"app"
:
{
"bundleName"
:
"com.amsst.amsjsstsubpermission"
,
"vendor"
:
"amsst"
,
"version"
:
{
"code"
:
1
,
"name"
:
"1.0"
},
"apiVersion"
:
{
"compatible"
:
4
,
"target"
:
5
,
"releaseType"
:
"Beta1"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.amsst.amsjsstsubpermission"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"com.amsst.amsjsstsubpermission.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:app_name"
,
"type"
:
"page"
,
"launchType"
:
"standard"
,
"visible"
:
true
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
true
}
}
],
"reqPermissions"
:
[
{
"name"
:
"com.amsst.permission.SYSPERMISSION"
,
"reason"
:
"$string:permreason_sys"
,
"usedScene"
:
{
"ability"
:
[
"com.amsst.amsjsstmain.MainAbility"
],
"when"
:
"always"
}
},
{
"name"
:
"ohos.permission.GET_NETWORK_INFO"
,
"reason"
:
"$string:permreason_getnetworkinfo"
,
"usedScene"
:
{
"ability"
:
[
"com.amsst.amsjsstmain.MainAbility"
],
"when"
:
"always"
}
}]
}
}
\ No newline at end of file
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/app.js
0 → 100644
浏览文件 @
ddc51328
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export
default
{
onCreate
()
{
console
.
info
(
'
AceApplication onCreate
'
);
},
onDestroy
()
{
console
.
info
(
'
AceApplication onDestroy
'
);
}
};
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/i18n/en-US.json
0 → 100644
浏览文件 @
ddc51328
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/i18n/zh-CN.json
0 → 100644
浏览文件 @
ddc51328
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/pages/index/index.css
0 → 100644
浏览文件 @
ddc51328
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
40px
;
color
:
#000000
;
opacity
:
0.9
;
}
@media
screen
and
(
device-type
:
tablet
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
100px
;
}
}
@media
screen
and
(
device-type
:
wearable
)
{
.title
{
font-size
:
28px
;
color
:
#FFFFFF
;
}
}
@media
screen
and
(
device-type
:
tv
)
{
.container
{
background-image
:
url("../../common/images/Wallpaper.png")
;
background-size
:
cover
;
background-repeat
:
no-repeat
;
background-position
:
center
;
}
.title
{
font-size
:
100px
;
color
:
#FFFFFF
;
}
}
@media
screen
and
(
device-type
:
phone
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
60px
;
}
}
.log
{
font-size
:
20px
;
text-align
:
center
;
width
:
100%
;
height
:
400px
;
}
\ No newline at end of file
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/pages/index/index.hml
0 → 100644
浏览文件 @
ddc51328
<div class="container">
<text>{{title}}</text>
<div class="log">
<textarea class="log">
{{logmessage}}
</textarea>
</div>
<div>
<list class="todo-wraper">
<list-item for="{{testcase}}" class="todo-item">
<input class="btn" type="button" value="{{$item}}" on:click="runCase({{$item}})"></input>
</list-item>
</list>
<button type="capsule" class="btn" value="back" on:click="stopAbility"></button>
</div>
</div>
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/pages/index/index.js
0 → 100644
浏览文件 @
ddc51328
/*
* 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
app
from
'
@system.app
'
import
router
from
'
@system.router
'
;
import
featureAbility
from
'
@ohos.ability.featureability
'
import
{
Core
,
ExpectExtend
,
ReportExtend
}
from
'
deccjsunit/index
'
export
default
{
currentCase
:
""
,
data
:
{
title
:
"
AbilityA1
"
,
logmessage
:
"
this is log message
"
,
testcase
:
[
"
AppPermission_1300
"
,
"
AppPermission_1400
"
,
"
AppPermission_1500
"
,
"
AppPermission_1600
"
,
"
AppPermission_1700
"
,
"
AppPermission_1800
"
,
],
},
onInit
()
{
this
.
title
=
"
AbilityA1
"
;
this
.
logmessage
=
"
this is log message
"
;
},
onShow
()
{
},
onReady
()
{
console
.
info
(
'
onReady finish
'
)
},
onBackPress
()
{
},
async
stopAbility
()
{
console
.
info
(
'
===========AmsJsStSubPermission close===========<
'
)
await
featureAbility
.
terminateAbility
();
await
app
.
killProcessesByBundleName
();
},
runCase
(
caseName
)
{
console
.
debug
(
"
======runCase======>:
"
+
JSON
.
stringify
(
caseName
))
this
.
logmessage
+=
caseName
+
"
\n
"
console
.
debug
(
"
======runallcase======<:
"
)
let
{
runAllCase
}
=
require
(
'
./permissioncase.js
'
)
runAllCase
(
caseName
,
this
)
},
CaseChange
(
newValue
)
{
let
{
GetCaseInfo
}
=
require
(
'
./permissioncase.js
'
)
this
.
logmessage
=
newValue
.
value
this
.
logmessage
+=
GetCaseInfo
(
newValue
.
value
)
this
.
currentCase
=
newValue
.
value
},
}
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/js/default/pages/index/permissioncase.js
0 → 100644
浏览文件 @
ddc51328
/*
* 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
bundle
from
'
@ohos.bundle
'
import
featureAbility
from
'
@ohos.ability.featureability
'
import
abilityManager
from
'
@ohos.app.abilitymanager
'
export
function
runAllCase
(
caseName
,
obj
)
{
console
.
debug
(
"
======runAllCase1======>:
"
+
JSON
.
stringify
(
caseName
))
console
.
debug
(
"
======runAllCase2======>:
"
+
JSON
.
stringify
(
allCase
))
allCase
[
caseName
].
func
(
obj
)
}
export
function
GetCaseInfo
(
caseName
)
{
console
.
debug
(
"
======GetCaseInfo======>:
"
+
JSON
.
stringify
(
caseName
))
return
allCase
[
caseName
].
info
;
}
var
allCase
=
{
AppPermission_1300
:
{
func
:
AppPermission_1300
,
info
:
"
Verify that a system_grand system`s permission(ohos.permission.GET_NETWORK_INFO) is automatically requested during installation.
"
},
AppPermission_1400
:
{
func
:
AppPermission_1400
,
info
:
""
},
AppPermission_1500
:
{
func
:
AppPermission_1500
,
info
:
""
},
AppPermission_1600
:
{
func
:
AppPermission_1600
,
info
:
""
},
AppPermission_1700
:
{
func
:
AppPermission_1700
,
info
:
""
},
AppPermission_1800
:
{
func
:
AppPermission_1800
,
info
:
""
},
}
async
function
AppPermission_1300
(
thisobj
)
{
var
thisFunctionName
=
AppPermission_1300
.
name
thisobj
.
logmessage
=
""
thisobj
.
logmessage
+=
"
run test case
"
+
thisFunctionName
+
"
\n
"
var
context
=
await
featureAbility
.
getContext
()
await
context
.
verifyPermission
(
"
ohos.permission.GET_NETWORK_INFO
"
,
(
err
,
data
)
=>
{
console
.
debug
(
"
======verifyCallingPermission:data======>:
"
+
JSON
.
stringify
(
data
));
thisobj
.
logmessage
+=
JSON
.
stringify
(
data
)
+
"
\n
"
if
(
data
==
0
)
{
thisobj
.
logmessage
+=
"
case
"
+
thisFunctionName
+
"
successed
\n
"
}
else
{
thisobj
.
logmessage
+=
"
case
"
+
thisFunctionName
+
"
failed
\n
"
}
})
}
async
function
AppPermission_1400
(
thisobj
)
{
var
thisFunctionName
=
AppPermission_1400
.
name
thisobj
.
logmessage
=
""
thisobj
.
logmessage
+=
"
run test case
"
+
thisFunctionName
+
"
\n
"
var
context
=
await
featureAbility
.
getContext
()
console
.
log
(
"
<======verfyPermissiom pass=====>
"
)
var
result
=
await
context
.
verifyPermission
(
"
ohos.permission.GET_NETWORK_INFO
"
)
console
.
debug
(
"
======verifyCallingPermission:result======>:
"
+
JSON
.
stringify
(
result
))
thisobj
.
logmessage
+=
JSON
.
stringify
(
result
)
+
"
\n
"
if
(
result
==
0
)
{
thisobj
.
logmessage
+=
"
case
"
+
thisFunctionName
+
"
successed
\n
"
}
else
{
thisobj
.
logmessage
+=
"
case
"
+
thisFunctionName
+
"
failed
\n
"
}
}
async
function
AppPermission_1500
(
thisobj
)
{
var
thisFunctionName
=
AppPermission_1500
.
name
thisobj
.
logmessage
=
""
thisobj
.
logmessage
+=
"
run test case
"
+
thisFunctionName
+
"
\n
"
var
context
=
await
featureAbility
.
getContext
()
await
context
.
verifyPermission
(
"
ohos.permission.CAMERA
"
,
(
err
,
data
)
=>
{
console
.
debug
(
"
======verifyCallingPermission:data======>:
"
+
JSON
.
stringify
(
data
));
thisobj
.
logmessage
+=
JSON
.
stringify
(
data
)
+
"
\n
"
if
(
data
==
-
1
)
{
thisobj
.
logmessage
+=
"
case
"
+
thisFunctionName
+
"
successed
\n
"
}
else
{
thisobj
.
logmessage
+=
"
case
"
+
thisFunctionName
+
"
failed
\n
"
}
})
}
async
function
AppPermission_1600
(
thisobj
)
{
var
thisFunctionName
=
AppPermission_1600
.
name
thisobj
.
logmessage
=
""
thisobj
.
logmessage
+=
"
run test case
"
+
thisFunctionName
+
"
\n
"
var
context
=
await
featureAbility
.
getContext
()
var
result
=
await
context
.
verifyPermission
(
"
ohos.permission.CAMERA
"
)
console
.
debug
(
"
======verifyCallingPermission:result======>:
"
+
JSON
.
stringify
(
result
))
thisobj
.
logmessage
+=
JSON
.
stringify
(
result
)
+
"
\n
"
if
(
result
==
-
1
)
{
thisobj
.
logmessage
+=
"
case
"
+
thisFunctionName
+
"
successed
\n
"
}
else
{
thisobj
.
logmessage
+=
"
case
"
+
thisFunctionName
+
"
failed
\n
"
}
}
async
function
AppPermission_1700
(
thisobj
)
{
var
thisFunctionName
=
AppPermission_1700
.
name
thisobj
.
logmessage
=
""
thisobj
.
logmessage
+=
"
run test case
"
+
thisFunctionName
+
"
\n
"
var
context
=
await
featureAbility
.
getContext
()
await
context
.
verifyPermission
(
"
com.amsst.permission.SYSPERMISSION
"
,
(
err
,
data
)
=>
{
console
.
debug
(
"
======verifyCallingPermission:data======>:
"
+
JSON
.
stringify
(
data
));
thisobj
.
logmessage
+=
JSON
.
stringify
(
data
)
+
"
\n
"
if
(
data
==
0
)
{
thisobj
.
logmessage
+=
"
case
"
+
thisFunctionName
+
"
successed
\n
"
}
else
{
thisobj
.
logmessage
+=
"
case
"
+
thisFunctionName
+
"
failed
\n
"
}
})
}
async
function
AppPermission_1800
(
thisobj
)
{
var
thisFunctionName
=
AppPermission_1800
.
name
thisobj
.
logmessage
=
""
thisobj
.
logmessage
+=
"
run test case
"
+
thisFunctionName
+
"
\n
"
var
context
=
await
featureAbility
.
getContext
()
var
result
=
await
context
.
verifyPermission
(
"
com.amsst.permission.SYSPERMISSION
"
)
console
.
debug
(
"
======verifyCallingPermission:result======>:
"
+
JSON
.
stringify
(
result
))
thisobj
.
logmessage
+=
JSON
.
stringify
(
result
)
+
"
\n
"
if
(
result
==
0
)
{
thisobj
.
logmessage
+=
"
case
"
+
thisFunctionName
+
"
successed
\n
"
}
else
{
thisobj
.
logmessage
+=
"
case
"
+
thisFunctionName
+
"
failed
\n
"
}
}
\ No newline at end of file
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
ddc51328
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"Permission"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/entry/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
ddc51328
6.6 KB
aafwk/aafwk_standard/verifypermission/AmsJsStSubPermission/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
ddc51328
文件已添加
aafwk/aafwk_standard/verifypermission/BUILD.gn
0 → 100644
浏览文件 @
ddc51328
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
group("verifypermission") {
testonly = true
if (is_standard_system) {
deps = [
"AmsJsStMain:AmsJsStMain",
"AmsJsStSubPermission:AmsJsStSubPermission",
]
}
}
appexecfwk/bundle_standard/bundlemanager/actsbmskittest/entry/src/main/js/test/ActsBmsKitTest.test.js
浏览文件 @
ddc51328
...
...
@@ -63,6 +63,7 @@ describe('ActsBmsKitTest', function () {
}
)
})
/*
* @tc.number: ActsBmsKit_getAllShortcutInfo_0100
* @tc.name: Pressure test interface getAllShortcutInfo by promise
...
...
appexecfwk/bundle_standard/bundlemanager/actsbmsmoduleusagerecordtest/entry/src/main/js/test/ActsBmsModuleUsageRecordTest.test.js
浏览文件 @
ddc51328
...
...
@@ -104,6 +104,7 @@ describe('ActsBmsModuleUsageRecordTest', function () {
}
});
})
/*
* @tc.number: bms_getModuleUsageRecordTest_0100
* @tc.name: getModuleUsageRecord(maxNum)
...
...
@@ -414,6 +415,7 @@ describe('ActsBmsModuleUsageRecordTest', function () {
});
});
})
/*
* @tc.number: bms_getModuleUsageRecordTest_1300
* @tc.name: getModuleUsageRecord(maxNum, callback: AsyncCallback<Array<ModuleUsageRecord>>)
...
...
@@ -483,6 +485,7 @@ describe('ActsBmsModuleUsageRecordTest', function () {
});
});
})
/*
* @tc.number: bms_getModuleUsageRecordTest_1400
* @tc.name: getModuleUsageRecord(maxNum, callback: AsyncCallback<Array<ModuleUsageRecord>>)
...
...
appexecfwk/bundle_standard/bundlemanager/actsbundlemanageruninstall/entry/src/main/js/test/ExampleJsunit.test.js
浏览文件 @
ddc51328
...
...
@@ -305,7 +305,7 @@ describe('ActsBundleManagerTest', function () {
done
();
}
let
installData
=
await
demo
.
getBundleInstaller
();
installData
.
install
([
PATH
+
BMSJSTEST
1
],
{
installData
.
install
([
PATH
+
BMSJSTEST
8
],
{
param
:
{
userId
:
0
,
installFlag
:
1
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录