Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
66e2ec29
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
66e2ec29
编写于
11月 21, 2022
作者:
O
openharmony_ci
提交者:
Gitee
11月 21, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6572 【OpenHarmony 3.2monthly】useriam代码修改
Merge pull request !6572 from yuanyuhang/monthly1118_1
上级
8fd9328b
9b9090cf
变更
23
展开全部
隐藏空白更改
内联
并排
Showing
23 changed file
with
1406 addition
and
458 deletion
+1406
-458
useriam/BUILD.gn
useriam/BUILD.gn
+1
-0
useriam/face_auth/js_api_test/function_test/userauthnopermission/BUILD.gn
...h/js_api_test/function_test/userauthnopermission/BUILD.gn
+35
-0
useriam/face_auth/js_api_test/function_test/userauthnopermission/Test.json
.../js_api_test/function_test/userauthnopermission/Test.json
+39
-0
useriam/face_auth/js_api_test/function_test/userauthnopermission/signature/openharmony_sx.p7b
...on_test/userauthnopermission/signature/openharmony_sx.p7b
+0
-0
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/config.json
...t/function_test/userauthnopermission/src/main/config.json
+101
-0
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/MainAbility/app.js
..._test/userauthnopermission/src/main/js/MainAbility/app.js
+31
-0
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/MainAbility/i18n/en-US.json
...rauthnopermission/src/main/js/MainAbility/i18n/en-US.json
+6
-0
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/MainAbility/i18n/zh-CN.json
...rauthnopermission/src/main/js/MainAbility/i18n/zh-CN.json
+6
-0
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/MainAbility/pages/index/index.css
...opermission/src/main/js/MainAbility/pages/index/index.css
+60
-0
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/MainAbility/pages/index/index.hml
...opermission/src/main/js/MainAbility/pages/index/index.hml
+19
-0
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/MainAbility/pages/index/index.js
...nopermission/src/main/js/MainAbility/pages/index/index.js
+60
-0
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/TestAbility/app.js
..._test/userauthnopermission/src/main/js/TestAbility/app.js
+23
-0
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/TestAbility/i18n/en-US.json
...rauthnopermission/src/main/js/TestAbility/i18n/en-US.json
+8
-0
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/TestAbility/i18n/zh-CN.json
...rauthnopermission/src/main/js/TestAbility/i18n/zh-CN.json
+8
-0
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/TestAbility/pages/index/index.css
...opermission/src/main/js/TestAbility/pages/index/index.css
+30
-0
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/TestAbility/pages/index/index.hml
...opermission/src/main/js/TestAbility/pages/index/index.hml
+5
-0
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/TestAbility/pages/index/index.js
...nopermission/src/main/js/TestAbility/pages/index/index.js
+26
-0
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/TestRunner/OpenHarmonyTestRunner.js
...ermission/src/main/js/TestRunner/OpenHarmonyTestRunner.js
+59
-0
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/test/List.Test.js
...n_test/userauthnopermission/src/main/js/test/List.Test.js
+19
-0
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/test/nopermisson.js
...test/userauthnopermission/src/main/js/test/nopermisson.js
+297
-0
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/resources/base/element/string.json
...hnopermission/src/main/resources/base/element/string.json
+24
-0
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/resources/base/media/icon.png
...erauthnopermission/src/main/resources/base/media/icon.png
+0
-0
useriam/face_auth/js_api_test/function_test/userauthpart2/src/main/js/test/Security_IAM_FUNC_Jsunit.test.js
...thpart2/src/main/js/test/Security_IAM_FUNC_Jsunit.test.js
+549
-458
未找到文件。
useriam/BUILD.gn
浏览文件 @
66e2ec29
...
...
@@ -18,6 +18,7 @@ group("useriam") {
if (is_standard_system) {
deps = [
"face_auth/js_api_test/function_test/userauth:ActsUserauthTest",
"face_auth/js_api_test/function_test/userauthnopermission:ActsUserauthnopermissionTest",
"face_auth/js_api_test/function_test/userauthpart2:ActsUserauthTwoTest",
]
}
...
...
useriam/face_auth/js_api_test/function_test/userauthnopermission/BUILD.gn
0 → 100644
浏览文件 @
66e2ec29
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsUserauthnopermissionTest") {
hap_profile = "./src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsUserauthnopermissionTest"
subsystem_name = "useriam"
part_name = "face_auth"
}
ohos_js_assets("hjs_demo_js_assets") {
js2abc = true
hap_profile = "./src/main/config.json"
source_dir = "./src/main/js"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
useriam/face_auth/js_api_test/function_test/userauthnopermission/Test.json
0 → 100644
浏览文件 @
66e2ec29
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"600000"
,
"shell-timeout"
:
"600000"
,
"bundle-name"
:
"com.example.myapplication101"
,
"package-name"
:
"com.example.myapplication101"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsUserauthnopermissionTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"remount"
,
"mkdir /data/test"
]
},
{
"type"
:
"PushKit"
,
"push"
:
[
"ActsUserauthnopermissionTest.hap->/data/test/ActsUserauthnopermissionTest.hap"
]
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"chmod 644 /data/test/*.hap"
,
"chmod 777 -R data"
]
}
]
}
useriam/face_auth/js_api_test/function_test/userauthnopermission/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
66e2ec29
文件已添加
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/config.json
0 → 100644
浏览文件 @
66e2ec29
{
"app"
:
{
"bundleName"
:
"com.example.myapplication101"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
12
,
"name"
:
"1.0.0"
},
"apiVersion"
:
{
"compatible"
:
4
,
"target"
:
5
,
"releaseType"
:
"Beta1"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.myapplication101"
,
"name"
:
".entry"
,
"mainAbility"
:
".MainAbility"
,
"deviceType"
:
[
"tablet"
,
"default"
,
"phone"
,
"tablet"
,
"tv"
,
"wearable"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
,
"installationFree"
:
false
},
"abilities"
:
[
{
"orientation"
:
"unspecified"
,
"formsEnabled"
:
false
,
"name"
:
".TestAbility"
,
"srcLanguage"
:
"js"
,
"srcPath"
:
"TestAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:TestAbility_desc"
,
"label"
:
"$string:TestAbility_label"
,
"type"
:
"page"
,
"visible"
:
true
,
"launchType"
:
"standard"
},
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"orientation"
:
"unspecified"
,
"formsEnabled"
:
false
,
"name"
:
".MainAbility"
,
"srcLanguage"
:
"js"
,
"srcPath"
:
"MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:MainAbility_desc"
,
"label"
:
"$string:MainAbility_label"
,
"type"
:
"page"
,
"visible"
:
true
,
"launchType"
:
"standard"
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
true
}
},
{
"pages"
:
[
"pages/index/index"
],
"name"
:
".TestAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
],
"testRunner"
:
{
"name"
:
"OpenHarmonyTestRunner"
,
"srcPath"
:
"TestRunner"
},
"srcPath"
:
""
}
}
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/MainAbility/app.js
0 → 100644
浏览文件 @
66e2ec29
/*
* 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
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
import
{
Hypium
}
from
'
@ohos/hypium
'
import
testsuite
from
'
../test/List.Test
'
export
default
{
onCreate
()
{
console
.
info
(
'
TestApplication onCreate
'
)
var
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
console
.
info
(
'
start run testcase!!!
'
)
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
},
onDestroy
()
{
console
.
info
(
"
TestApplication onDestroy
"
);
}
};
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/MainAbility/i18n/en-US.json
0 → 100644
浏览文件 @
66e2ec29
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/MainAbility/i18n/zh-CN.json
0 → 100644
浏览文件 @
66e2ec29
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/MainAbility/pages/index/index.css
0 → 100644
浏览文件 @
66e2ec29
/*
* 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.
*/
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
width
:
100%
;
height
:
100%
;
}
.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
;
}
}
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/MainAbility/pages/index/index.hml
0 → 100644
浏览文件 @
66e2ec29
/*
* 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.
*/
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/MainAbility/pages/index/index.js
0 → 100644
浏览文件 @
66e2ec29
/*
* 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
fileio
from
'
@ohos.fileio
'
export
default
{
data
:
{
title
:
""
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
},
onShow
()
{
console
.
info
(
'
onShow start
'
)
},
onReady
()
{
},
fileSave
(
caseNum
,
codeNum
,
...
code
)
{
console
.
log
(
caseNum
+
'
fileSave start
'
);
var
path
=
"
/data/config.dat
"
let
fd
=
fileio
.
openSync
(
path
,
0o102
,
0o666
);
var
message
=
caseNum
+
"
\r\n
"
+
codeNum
+
"
\r\n
"
;
for
(
var
i
=
0
;
i
<
code
.
length
;
i
++
){
message
=
message
+
code
[
i
]
+
"
\r\n
"
;
}
fileio
.
writeSync
(
fd
,
message
);
fileio
.
closeSync
(
fd
);
console
.
log
(
caseNum
+
'
fileSave end
'
);
},
fileSaveB
(
caseNum
,
code
)
{
console
.
log
(
caseNum
+
'
fileSave start
'
);
var
path
=
"
/data/config.dat
"
let
fd
=
fileio
.
openSync
(
path
,
0o102
,
0o666
);
var
message
=
code
;
fileio
.
writeSync
(
fd
,
message
);
fileio
.
closeSync
(
fd
);
console
.
log
(
caseNum
+
'
fileSave end
'
);
},
saveNull
()
{
console
.
log
(
'
JSAPI null file faceid.dat start
'
);
var
path
=
"
/data/faceId.dat
"
let
fd
=
fileio
.
openSync
(
path
,
0o102
,
0o666
);
var
message
=
""
;
fileio
.
writeSync
(
fd
,
message
);
fileio
.
closeSync
(
fd
);
console
.
log
(
'
JSAPI null file faceid.dat end
'
);
},
}
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/TestAbility/app.js
0 → 100644
浏览文件 @
66e2ec29
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export
default
{
onCreate
()
{
console
.
info
(
'
AceApplication onCreate
'
);
},
onDestroy
()
{
console
.
info
(
'
AceApplication onDestroy
'
);
}
};
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/TestAbility/i18n/en-US.json
0 → 100644
浏览文件 @
66e2ec29
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
},
"Files"
:
{
}
}
\ No newline at end of file
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/TestAbility/i18n/zh-CN.json
0 → 100644
浏览文件 @
66e2ec29
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
},
"Files"
:
{
}
}
\ No newline at end of file
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/TestAbility/pages/index/index.css
0 → 100644
浏览文件 @
66e2ec29
.container
{
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
left
:
0px
;
top
:
0px
;
width
:
100%
;
height
:
100%
;
}
.title
{
font-size
:
60px
;
text-align
:
center
;
width
:
100%
;
height
:
40%
;
margin
:
10px
;
}
@media
screen
and
(
device-type
:
phone
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
60px
;
}
}
@media
screen
and
(
device-type
:
tablet
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
100px
;
}
}
\ No newline at end of file
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/TestAbility/pages/index/index.hml
0 → 100644
浏览文件 @
66e2ec29
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/TestAbility/pages/index/index.js
0 → 100644
浏览文件 @
66e2ec29
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export
default
{
data
:
{
title
:
""
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
}
}
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/TestRunner/OpenHarmonyTestRunner.js
0 → 100644
浏览文件 @
66e2ec29
/*
* 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
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s itName
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s package
'
,
'
-s dryRun
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
+=
'
'
+
key
+
'
'
+
parameters
[
key
]
}
}
return
targetParams
.
trim
()
}
export
default
{
onPrepare
()
{
console
.
info
(
'
OpenHarmonyTestRunner OnPrepare
'
)
},
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
)
var
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
var
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
testAbilityName
=
abilityDelegatorArguments
.
parameters
[
'
-p
'
]
+
'
.MainAbility
'
var
cmd
=
'
aa start -d 0 -a
'
+
testAbilityName
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
var
debug
=
abilityDelegatorArguments
.
parameters
[
"
-D
"
]
console
.
info
(
'
debug value :
'
+
debug
)
if
(
debug
==
'
true
'
)
{
cmd
+=
'
-D
'
}
console
.
info
(
'
cmd :
'
+
cmd
)
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
executeShellCommand : data :
'
+
data
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
data
.
exitCode
);
})
}
};
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/test/List.Test.js
0 → 100644
浏览文件 @
66e2ec29
/*
* 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
userAuthTestNopermission
from
'
./nopermisson.js
'
export
default
function
testsuite
()
{
userAuthTestNopermission
()
}
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/js/test/nopermisson.js
0 → 100644
浏览文件 @
66e2ec29
/*
* 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
userAuth
from
'
@ohos.userIAM.userAuth
'
let
UserAuthKit
=
new
userAuth
.
UserAuth
()
var
index
=
require
(
'
../MainAbility/pages/index/index.js
'
);
var
waitFlag
=
false
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
/**
* test case
*/
export
default
function
userAuthTestExecute
()
{
describe
(
'
userAuthTestExecute
'
,
function
()
{
beforeEach
(
function
(
done
)
{
let
waitTime
=
1000
;
if
(
waitFlag
)
{
waitTime
=
30000
;
}
setTimeout
(
function
()
{
done
();
},
waitTime
);
})
afterEach
(
function
()
{
})
/**
* @tc.name execute_authentication_promise_Type_is_null
* @tc.number JSAPI_Function_Execute_2100
* @tc.size MEDIUM
* @tc.type FUNC
* @tc.level Level2
*/
it
(
'
JSAPI_Function_Nopermission_2100
'
,
0
,
function
(
done
)
{
console
.
log
(
"
JSAPI_Function_Nopermission_2100 start
"
);
const
auth
=
userAuth
.
getAuthenticator
();
auth
.
execute
(
"
FACE_ONLY
"
,
"
S1
"
).
catch
(
function
(
data
)
{
console
.
log
(
"
JSAPI_Function_Nopermission_2100 auth.execute:
"
+
data
);
// general error
expect
(
data
).
assertEqual
(
100
);
setTimeout
(
function
()
{
done
();
},
1
);
});
console
.
log
(
"
JSAPI_Function_Nopermission_2100 end
"
);
})
/**
* @tc.name execute_authentication_callback_Type_is_null
* @tc.number JSAPI_Function_Execute_1800
* @tc.size MEDIUM
* @tc.type FUNC
* @tc.level Level2
*/
it
(
'
JSAPI_Function_Nopermission_1800
'
,
0
,
function
(
done
)
{
console
.
log
(
"
JSAPI_Function_Nopermission_1800 start
"
);
const
auth
=
userAuth
.
getAuthenticator
();
auth
.
execute
(
"
FACE_ONLY
"
,
"
S1
"
,
function
(
data
)
{
console
.
log
(
"
JSAPI_Function_Nopermission_1800 auth.execute:
"
+
data
);
// general error
expect
(
data
).
assertEqual
(
100
);
setTimeout
(
function
()
{
done
();
},
1
);
});
console
.
log
(
"
JSAPI_Function_Nopermission_1800 end
"
);
})
/*
* @tc.number : Security_IAM_Nopermission_API8_Func_0101
* @tc.name : Kit interface get version
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
Security_IAM_Nopermission_API8_Func_0101
'
,
0
,
async
function
(
done
)
{
try
{
let
getversionresult
=
null
;
getversionresult
=
UserAuthKit
.
getVersion
();
console
.
info
(
'
Security_IAM_Nopermission_API8_Func_0101 getversionresult =
'
+
getversionresult
);
//mini version 0
expect
(
getversionresult
).
assertEqual
(
0
);
done
();
}
catch
(
e
)
{
console
.
log
(
"
testFace Security_IAM_Nopermission_API8_Func_0101 fail
"
+
e
.
code
);
expect
(
null
).
assertFail
();
done
();
}
})
/*
* @tc.number : Security_IAM_Nopermission_API8_Func_0112
* @tc.name : Kit interface get AvailabeStatus
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
Security_IAM_Nopermission_API8_Func_0112
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testFace Security_IAM_Nopermission_API8_Func_0112 start
'
);
try
{
let
AvailabeStatus
=
null
AvailabeStatus
=
UserAuthKit
.
getAvailableStatus
(
2
,
10000
);
console
.
info
(
'
testFace Security_IAM_Nopermission_API8_Func_0112,2,10000 result =
'
+
JSON
.
stringify
(
AvailabeStatus
));
// 100:general error
expect
(
1005
).
assertEqual
(
AvailabeStatus
);
done
()
}
catch
(
e
)
{
console
.
log
(
"
Security_IAM_Nopermission_API8_Func_0112 fail
"
+
e
.
code
);
expect
(
100
).
assertEqual
(
e
.
code
);
done
()
}
})
/*
* @tc.number : Security_IAM_Nopermission_API8_Func_0103
* @tc.name : Kit interface auth & cancel auth
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
Security_IAM_Nopermission_API8_Func_0103
'
,
0
,
async
function
(
done
)
{
let
contextID1
=
null
let
challenge
=
new
Uint8Array
([
253
,
19
,
58
,
160
,
67
,
200
,
247
,
37
])
let
onresult
=
{
authresult
:
null
,
authextr
:
null
,
}
let
onacquireinfo
=
{
authmodule
:
null
,
authacquire
:
null
,
authextr
:
null
}
console
.
log
(
"
Security_IAM_Nopermission_API8_Func_0103 2,10000
"
);
contextID1
=
UserAuthKit
.
auth
(
challenge
,
userAuth
.
UserAuthType
.
FACE
,
userAuth
.
AuthTrustLevel
.
ATL1
,
{
onResult
:
function
(
result
,
extraInfo
){
console
.
log
(
"
Security_IAM_Nopermission_API8_Func_0103 auth result =
"
+
result
);
onresult
.
authresult
=
result
;
//100:general error
expect
(
1005
).
assertEqual
(
result
);
console
.
info
(
'
Security_IAM_Nopermission_API8_Func_0103 contextID1 =
'
+
contextID1
);
let
cancelResult
=
UserAuthKit
.
cancelAuth
(
contextID1
);
console
.
info
(
'
Security_IAM_Nopermission_API8_Func_0103 cancelResult =
'
+
cancelResult
);
done
();
},
onAcquireInfo
:
function
(
modulea
,
acquire
,
extr
){
console
.
info
(
'
faceTest publicauth auth onAcquireInfo in
'
);
onacquireinfo
.
authmodule
=
modulea
;
onacquireinfo
.
authacquire
=
acquire
;
onacquireinfo
.
authextr
=
extr
;
console
.
log
(
"
testFace faceDemo auth module =
"
+
JSON
.
stringify
(
modulea
));
console
.
info
(
'
testFace publicauth auth onAcquireInfo =
'
+
JSON
.
stringify
(
onacquireinfo
));
}
});
})
/*
* @tc.number : Security_IAM_Nopermission_API9_Func_0101
* @tc.name : Kit interface get version
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
Security_IAM_Nopermission_API9_Func_0101
'
,
0
,
async
function
(
done
)
{
try
{
let
getversionresult
=
userAuth
.
getVersion
();
console
.
info
(
'
Security_IAM_Nopermission_API9_Func_0101 getversionresult =
'
+
getversionresult
);
// no permission
expect
(
getversionresult
).
assertEqual
(
201
);
done
();
}
catch
(
e
)
{
console
.
log
(
"
testFace GetVersionTest_0101 fail
"
+
e
.
code
);
expect
(
e
.
code
).
assertEqual
(
201
);
done
();
}
})
/*
* @tc.number : Security_IAM_Nopermisson_Func_0104
* @tc.name : getAvailabeStatus invalid parameters
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
Security_IAM_Nopermisson_API9_Func_0104
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
testFace Security_IAM_Nopermisson_API9_Func_0104 start
'
);
try
{
userAuth
.
getAvailableStatus
(
userAuth
.
UserAuthType
.
FACE
,
userAuth
.
AuthTrustLevel
.
ATL1
);
console
.
log
(
"
Security_IAM_Nopermisson_API9_Func_0104 success
"
);
done
()
}
catch
(
e
)
{
console
.
log
(
"
Security_IAM_Nopermisson_API9_Func_0104 fail
"
+
e
.
code
);
expect
(
e
.
code
).
assertEqual
(
201
);
done
()
}
})
/*
* @tc.number : Security_IAM_Nopermission_API9_Func_0110
* @tc.name : getAuthInstance faceType ATL4
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
Security_IAM_Nopermission_API9_Func_0110
'
,
0
,
async
function
(
done
)
{
let
challenge
=
new
Uint8Array
([
253
,
19
,
58
,
160
,
67
,
200
,
247
,
37
])
let
authType
=
userAuth
.
UserAuthType
.
FACE
;
let
authTrustLevel
=
userAuth
.
AuthTrustLevel
.
ATL1
;
try
{
var
authInstance
=
userAuth
.
getAuthInstance
(
challenge
,
authType
,
authTrustLevel
);
console
.
log
(
"
Security_IAM_Nopermission_API9_Func_0110 FACE ATL1 success
"
);
done
();
}
catch
(
e
)
{
console
.
log
(
"
Security_IAM_Nopermission_API9_Func_0110 FACE ATL1 fail
"
+
e
.
code
);
expect
(
e
.
code
).
assertEqual
(
201
);
done
();
}
})
/*
* @tc.number : Security_IAM_Nopermission_API9_Func_0103
* @tc.name : Kit interface auth & cancel auth
* @tc.size : MediumTest
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'
Security_IAM_Nopermission_API9_Func_0103
'
,
0
,
async
function
(
done
)
{
let
challenge
=
new
Uint8Array
([
253
,
19
,
58
,
160
,
67
,
200
,
247
,
37
])
let
authType
=
userAuth
.
UserAuthType
.
FACE
;
let
authTrustLevel
=
userAuth
.
AuthTrustLevel
.
ATL1
;
try
{
var
authInstance
=
userAuth
.
getAuthInstance
(
challenge
,
authType
,
authTrustLevel
);
// register result and tip
authInstance
.
on
(
"
result
"
,
{
callback
:
(
result
)
=>
{
console
.
log
(
"
authV9 result
"
+
result
.
result
);
console
.
log
(
"
authV9 token
"
+
result
.
token
);
console
.
log
(
"
authV9 remainAttempts
"
+
result
.
remainAttempts
);
console
.
log
(
"
authV9 lockoutDuration
"
+
result
.
lockoutDuration
);
expect
(
result
.
result
).
assertEqual
(
userAuth
.
ResultCodeV9
.
NOT_ENROLLED
);
}
});
authInstance
.
on
(
"
tip
"
,
{
callback
:
(
result
)
=>
{
console
.
log
(
"
authV9 module
"
+
result
.
module
);
console
.
log
(
"
authV9 tip
"
+
result
.
tip
);
}
});
//start auth
authInstance
.
start
();
}
catch
(
e
)
{
console
.
log
(
"
Security_IAM_Nopermission_API9_Func_0103 fail
"
+
e
.
code
);
expect
(
e
.
code
).
assertEqual
(
201
);
}
// cancel auth
try
{
authInstance
.
cancel
();
}
catch
(
e
)
{
console
.
log
(
"
Security_IAM_Nopermission_API9_Func_0103 cancel fail
"
+
e
.
code
);
expect
(
e
.
code
).
assertEqual
(
201
);
}
// unregister result and tip
try
{
authInstance
.
off
(
"
result
"
);
authInstance
.
off
(
"
tip
"
);
done
();
}
catch
(
e
)
{
console
.
log
(
"
Security_IAM_Nopermission_API9_Func_0103 fail
"
+
e
.
code
);
done
();
}
})
})
}
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
66e2ec29
{
"string"
:
[
{
"name"
:
"entry_MainAbility"
,
"value"
:
"entry_MainAbility"
},
{
"name"
:
"MainAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_label"
,
"value"
:
"label"
},
{
"name"
:
"TestAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"TestAbility_label"
,
"value"
:
"label"
}
]
}
\ No newline at end of file
useriam/face_auth/js_api_test/function_test/userauthnopermission/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
66e2ec29
6.6 KB
useriam/face_auth/js_api_test/function_test/userauthpart2/src/main/js/test/Security_IAM_FUNC_Jsunit.test.js
浏览文件 @
66e2ec29
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录