Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
3f479d4f
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
未验证
提交
3f479d4f
编写于
2月 16, 2022
作者:
O
openharmony_ci
提交者:
Gitee
2月 16, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1924 人脸合作项目第二期测试代码上库
Merge pull request !1924 from 胡吉翔/useriam2
上级
59cca3d6
1558e44a
变更
18
展开全部
隐藏空白更改
内联
并排
Showing
18 changed file
with
3371 addition
and
1 deletion
+3371
-1
useriam/BUILD.gn
useriam/BUILD.gn
+4
-1
useriam/face_auth/js_api_test/function_test/userauthpart2/BUILD.gn
...ace_auth/js_api_test/function_test/userauthpart2/BUILD.gn
+31
-0
useriam/face_auth/js_api_test/function_test/userauthpart2/Test.json
...ce_auth/js_api_test/function_test/userauthpart2/Test.json
+38
-0
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/config.json
...st/function_test/userauthpart2/entry/src/main/config.json
+84
-0
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/default/app.js
...ction_test/userauthpart2/entry/src/main/js/default/app.js
+23
-0
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/default/i18n/en-US.json
...t/userauthpart2/entry/src/main/js/default/i18n/en-US.json
+6
-0
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/default/i18n/zh-CN.json
...t/userauthpart2/entry/src/main/js/default/i18n/zh-CN.json
+6
-0
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/default/pages/index/index.css
...authpart2/entry/src/main/js/default/pages/index/index.css
+46
-0
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/default/pages/index/index.hml
...authpart2/entry/src/main/js/default/pages/index/index.hml
+5
-0
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/default/pages/index/index.js
...rauthpart2/entry/src/main/js/default/pages/index/index.js
+43
-0
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/resources/base/element/string.json
...art2/entry/src/main/js/resources/base/element/string.json
+12
-0
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/resources/base/media/icon.png
...authpart2/entry/src/main/js/resources/base/media/icon.png
+0
-0
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/test/List.test.js
...on_test/userauthpart2/entry/src/main/js/test/List.test.js
+18
-0
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/test/Publicfunction-n.js
.../userauthpart2/entry/src/main/js/test/Publicfunction-n.js
+488
-0
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/test/Security_IAM_Coauth_Func_CallbackJsunit.test.js
...n/js/test/Security_IAM_Coauth_Func_CallbackJsunit.test.js
+651
-0
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/test/Security_IAM_Face_Func_CallbackJsunit.test.js
...ain/js/test/Security_IAM_Face_Func_CallbackJsunit.test.js
+784
-0
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/test/Security_IAM_PIN_Func_CallbackJsunit.test.js
...main/js/test/Security_IAM_PIN_Func_CallbackJsunit.test.js
+1132
-0
useriam/face_auth/js_api_test/function_test/userauthpart2/signature/openharmony_sx.p7b
.../function_test/userauthpart2/signature/openharmony_sx.p7b
+0
-0
未找到文件。
useriam/BUILD.gn
浏览文件 @
3f479d4f
...
...
@@ -16,6 +16,9 @@ import("//test/xts/tools/build/suite.gni")
group("useriam") {
testonly = true
if (is_standard_system) {
deps = [ "face_auth/js_api_test/function_test/userauth:ActsUserauthTest" ]
deps = [
"face_auth/js_api_test/function_test/userauth:ActsUserauthTest",
"face_auth/js_api_test/function_test/userauthpart2:ActsUserauthTwoTest",
]
}
}
useriam/face_auth/js_api_test/function_test/userauthpart2/BUILD.gn
0 → 100644
浏览文件 @
3f479d4f
# 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("ActsUserauthTwoTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsUserauthTwoTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
useriam/face_auth/js_api_test/function_test/userauthpart2/Test.json
0 → 100644
浏览文件 @
3f479d4f
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"900000"
,
"package"
:
"com.example.myapplication101"
,
"shell-timeout"
:
"600000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsUserauthTwoTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"remount"
,
"mkdir /data/test"
]
},
{
"type"
:
"PushKit"
,
"push"
:
[
"ActsUserauthTwoTest.hap->/data/test/ActsUserauthTwoTest.hap"
]
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"chmod 644 /data/test/*.hap"
,
"chmod 777 -R data"
]
}
]
}
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/config.json
0 → 100644
浏览文件 @
3f479d4f
{
"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"
:
".MyApplication"
,
"mainAbility"
:
"com.example.myapplication101.MainAbility"
,
"deviceType"
:
[
"phone"
,
"tablet"
,
"tv"
,
"wearable"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
,
"installationFree"
:
false
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"com.example.myapplication101.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:entry_MainAbility"
,
"type"
:
"page"
,
"launchType"
:
"standard"
,
"visible"
:
true
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
true
}
}
],
"reqPermissions"
:
[
{
"reason"
:
"reason_manage_face"
,
"usedScene"
:
{
"ability"
:
[
"com.myface.Ability"
,
"com.myface.AbilityBackground"
],
"when"
:
"always"
},
"name"
:
"ohos.permission.MANAGE_FACE"
},
{
"reason"
:
"reason_access_biometric"
,
"usedScene"
:
{
"ability"
:
[
"com.mybiometric.Ability"
,
"com.mybiometric.AbilityBackground"
],
"when"
:
"always"
},
"name"
:
"ohos.permission.ACCESS_BIOMETRIC"
}
]
}
}
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/default/app.js
0 → 100644
浏览文件 @
3f479d4f
/*
* 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
'
);
}
};
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/default/i18n/en-US.json
0 → 100644
浏览文件 @
3f479d4f
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/default/i18n/zh-CN.json
0 → 100644
浏览文件 @
3f479d4f
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/default/pages/index/index.css
0 → 100644
浏览文件 @
3f479d4f
.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/userauthpart2/entry/src/main/js/default/pages/index/index.hml
0 → 100644
浏览文件 @
3f479d4f
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/default/pages/index/index.js
0 → 100644
浏览文件 @
3f479d4f
/*
* 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
{
Core
,
ExpectExtend
}
from
'
deccjsunit/index
'
import
fileio
from
'
@ohos.fileio
'
export
default
{
data
:
{
title
:
""
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
},
onShow
()
{
console
.
info
(
'
onShow start
'
)
const
core
=
Core
.
getInstance
()
const
expectExtend
=
new
ExpectExtend
({
'
id
'
:
'
extend
'
})
core
.
addService
(
'
expect
'
,
expectExtend
)
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
this
.
timeout
=
35000
;
configService
.
setConfig
(
this
)
require
(
'
../../../test/List.test.js
'
)
core
.
execute
()
console
.
info
(
'
onShow end
'
)
},
onReady
()
{
},
}
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/resources/base/element/string.json
0 → 100644
浏览文件 @
3f479d4f
{
"string"
:
[
{
"name"
:
"entry_MainAbility"
,
"value"
:
"entry_MainAbility"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Empty Ability"
}
]
}
\ No newline at end of file
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/resources/base/media/icon.png
0 → 100644
浏览文件 @
3f479d4f
6.6 KB
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/test/List.test.js
0 → 100644
浏览文件 @
3f479d4f
/*
* 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
(
"
./Security_IAM_PIN_Func_CallbackJsunit.test.js
"
)
require
(
"
./Security_IAM_Coauth_Func_CallbackJsunit.test.js
"
)
require
(
"
./Security_IAM_Face_Func_CallbackJsunit.test.js
"
)
\ No newline at end of file
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/test/Publicfunction-n.js
0 → 100644
浏览文件 @
3f479d4f
/*
* 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
{
describe
,
it
,
expect
}
from
'
deccjsunit/index
'
import
userIDM
from
'
@ohos.useridm
'
import
pinAuth
from
'
@ohos.pinauth
'
import
userAuth
from
'
@ohos.userauth
'
let
UserIDM
=
null
let
PinAuth
=
null
let
UserAuth
=
null
function
sleep
(
ms
)
{
return
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
ms
));
}
//同步
function
publicRegisterInputer
(
PinAuth
,
AuthSubType
,
Inputerdata
){
console
.
info
(
'
testFace publicRegisterInputer in
'
);
try
{
console
.
info
(
'
testFace publicRegisterInputer in try
'
);
console
.
info
(
'
testFace publicRegisterInputer PinAuth =
'
+
PinAuth
);
let
registerresult
=
PinAuth
.
registerInputer
({
onGetData
:
(
AuthSubType
,
IInputData
)
=>
{
console
.
info
(
'
testFace faceDemo registerInputer AuthSubType
'
);
console
.
info
(
'
testFace faceDemo registerInputer AuthSubType111
'
);
IInputData
.
onSetData
(
AuthSubType
,
Inputerdata
)
}
})
console
.
log
(
"
testFace publicRegisterInputer result is:
"
+
registerresult
);
return
registerresult
;
}
catch
(
e
)
{
console
.
log
(
"
testFace publicRegisterInputer fail
"
+
e
);
expect
(
null
).
assertFail
();
}
}
function
publicunRegisterInputer
(
PinAuth
,
callback
){
console
.
info
(
'
testFace publicunRegisterInputer in
'
);
try
{
console
.
info
(
'
testFace publicunRegisterInputer in try
'
);
console
.
info
(
'
testFace publicunRegisterInputer PinAuth =
'
+
PinAuth
);
let
unRegist
=
1
;
PinAuth
.
unregisterInputer
();
callback
(
unRegist
)
}
catch
(
e
)
{
console
.
log
(
"
testFace publicRegisterInputer fail
"
+
e
);
expect
(
null
).
assertFail
();
}
}
function
publicOpenSession
(
UserIDM
,
callback
){
console
.
info
(
'
testFace publicOpenSession in
'
);
try
{
console
.
info
(
'
testFace publicOpenSession in try
'
);
console
.
info
(
'
testFace faceDemo UserIDM =
'
+
UserIDM
);
let
challenge
=
null
UserIDM
.
openSession
(
function
(
data
){
try
{
console
.
log
(
"
testFace before get challenge
"
);
console
.
log
(
"
testFace +
"
+
data
);
challenge
=
data
;
console
.
log
(
"
testFace end
"
);
console
.
log
(
"
testFace after get challenge
"
);
callback
(
challenge
);
expect
(
true
).
assertEqual
(
challenge
!=
null
);
}
catch
(
e
)
{
console
.
info
(
'
testFace faceDemo openSession error =
'
+
JSON
.
stringify
(
e
));
}
});
}
catch
(
e
)
{
console
.
log
(
"
testFace publicOpenSession fail
"
+
e
);
console
.
log
(
e
);
expect
(
null
).
assertFail
();
}
}
function
publicCloseSession
(
UserIDM
,
callback
){
console
.
info
(
'
testFace publicCloseSession in
'
);
try
{
console
.
info
(
'
testFace publicCloseSession in try
'
);
console
.
info
(
'
testFace publicCloseSession UserIDM =
'
+
UserIDM
);
let
closesession
=
0
;
UserIDM
.
closeSession
();
callback
(
closesession
);
}
catch
(
e
)
{
console
.
log
(
"
testFace publicCloseSession fail
"
+
e
);
expect
(
null
).
assertFail
();
}}
async
function
publicaddCredential
(
UserIDM
,
CredentialInfo
,
callback1
,
callback2
){
console
.
info
(
'
testFace publicaddCredential in
'
);
try
{
console
.
info
(
'
testFace publicaddCredential in try
'
);
let
onresult
=
{
addCredresult
:
null
,
credentialId
:
null
,
}
let
onAcquireInfo
=
{
addCredmodule
:
null
,
addCredacquire
:
null
,
addCredextr
:
null
}
console
.
info
(
'
faceTest publicaddCredential UserIDM =
'
+
UserIDM
);
UserIDM
.
addCredential
(
CredentialInfo
,
{
onResult
:
function
(
result
,
extraInfo
){
console
.
info
(
"
testFace addCredential result =
"
+
result
);
console
.
info
(
"
testFace addCredential extraInfo =
"
+
JSON
.
stringify
(
extraInfo
));
console
.
log
(
result
)
onresult
.
addCredresult
=
result
;
if
(
extraInfo
!=
undefined
)
{
onresult
.
credentialId
=
extraInfo
.
credentialId
}
else
{
onresult
.
credentialId
=
null
;
}
callback1
(
onresult
)
},
onAcquireInfo
:
function
(
modulea
,
acquire
,
extr
){
console
.
info
(
'
testFace publicaddCredential onAcquireInfo in
'
);
onAcquireInfo
.
addCredmodule
=
modulea
;
onAcquireInfo
.
addCredacquire
=
acquire
;
onAcquireInfo
.
addCredextr
=
extr
;
console
.
info
(
'
testFace publicaddCredential onAcquireInfo =
'
+
JSON
.
stringify
(
onAcquireInfo
));
console
.
info
(
modulea
);
callback2
(
onAcquireInfo
)
},
})
}
catch
(
e
)
{
console
.
log
(
"
testFace publicaddCredential fail
"
+
e
);
expect
(
null
).
assertFail
();
}
}
function
publicupdateCred
(
UserIDM
,
CredentialInfo
,
callback1
,
callback2
){
console
.
info
(
'
testFace publicupdateCred in
'
);
try
{
console
.
info
(
'
testFace publicupdateCred in try
'
);
console
.
info
(
'
testFace publicupdateCred UserIDM =
'
+
UserIDM
);
let
onresult
=
{
updateCredresult
:
null
,
CredentialId
:
null
,
}
let
onacquireinfo
=
{
updateCredmodule
:
null
,
updateCredacquire
:
null
,
updateCredextr
:
null
}
UserIDM
.
updateCredential
(
CredentialInfo
,
{
onResult
:
function
(
result
,
extraInfo
){
console
.
log
(
"
testFace faceDemo updateCredential result =
"
+
result
)
onresult
.
updateCredresult
=
result
console
.
log
(
"
testFace faceDemo updateCredential credentialId =
"
+
extraInfo
.
credentialId
)
if
(
extraInfo
!=
undefined
)
{
onresult
.
CredentialId
=
extraInfo
.
credentialId
}
else
{
onresult
.
CredentialId
=
null
;
}
console
.
info
(
'
testFace publicupdateCred updateCredential onResult =
'
+
JSON
.
stringify
(
onresult
));
callback1
(
onresult
)
},
onAcquireInfo
:
function
(
modulea
,
acquire
,
extr
){
console
.
info
(
'
testFace publicupdateCred updateCredential onAcquireInfo in
'
);
onacquireinfo
.
updateCredmodule
=
modulea
onacquireinfo
.
updateCredacquire
=
acquire
onacquireinfo
.
updateCredextr
=
extr
console
.
info
(
'
testFace public updateCredential onacquireinfo =
'
+
JSON
.
stringify
(
onacquireinfo
));
console
.
log
(
"
testFace faceDemo updateCredential module =
"
+
modulea
)
callback2
(
onacquireinfo
)
}
})
}
catch
(
e
)
{
console
.
log
(
"
testFace publicupdateCred fail
"
+
e
);
expect
(
null
).
assertFail
();
}
}
//同步
function
publiccancel
(
UserIDM
,
challenge
){
console
.
info
(
'
testFace publiccancel in
'
);
try
{
console
.
info
(
'
testFace publiccancel in try
'
);
console
.
info
(
'
testFace publiccancel UserIDM =
'
+
UserIDM
);
let
cancelresult
=
UserIDM
.
cancel
(
challenge
)
console
.
log
(
"
testFace cancelresult is
"
+
cancelresult
);
return
cancelresult
}
catch
(
e
)
{
console
.
log
(
"
testFace publiccancel fail
"
+
e
);
expect
(
null
).
assertFail
();
}
}
function
publicdelUser
(
UserIDM
,
token
,
callback1
,
callback2
){
console
.
info
(
'
testFace publicdelUser in
'
);
try
{
console
.
info
(
'
testFace publicdelUser in try
'
);
console
.
info
(
'
testFace publicdelUser UserIDM =
'
+
UserIDM
);
let
onresult
=
{
delUserresult
:
null
,
CredentialId
:
null
,
}
let
onacquireinfo
=
{
delUsermodule
:
null
,
delUseracquire
:
null
,
delUserextr
:
null
}
UserIDM
.
delUser
(
token
,
{
onResult
:
function
(
result
,
extraInfo
){
console
.
log
(
"
testFace faceDemo delUser result =
"
+
result
)
onresult
.
delUserresult
=
result
if
(
extraInfo
!=
undefined
)
{
onresult
.
CredentialId
=
extraInfo
.
credentialId
}
else
{
onresult
.
CredentialId
=
null
;
}
console
.
info
(
'
testFace publicdelUser delUser =
'
+
JSON
.
stringify
(
onresult
));
callback1
(
onresult
)
},
onAcquireInfo
:
function
(
modulea
,
acquire
,
extr
){
console
.
log
(
"
testFace faceDemo delUser onAcquireInfo in
"
);
onacquireinfo
.
delUsermodule
=
modulea
onacquireinfo
.
delUseracquire
=
acquire
onacquireinfo
.
delUserextr
=
extr
console
.
log
(
"
testFace faceDemo delUser onAcquireInfo =
"
+
JSON
.
stringify
(
onacquireinfo
));
callback2
(
onacquireinfo
)
}
})
}
catch
(
e
)
{
console
.
log
(
"
testFace publicdelUser fail
"
+
e
);
expect
(
null
).
assertFail
();
}
}
function
publicdelCred
(
UserIDM
,
credentialId
,
token
,
callback1
,
callback2
){
console
.
info
(
'
testFace publicdelCred in
'
);
try
{
console
.
info
(
'
testFace publicdelCred in try
'
);
console
.
info
(
'
testFace publicdelCred UserIDM =
'
+
UserIDM
);
let
onresult
=
{
delCredresult
:
null
,
CredentialId
:
null
,
}
let
onacquireinfo
=
{
delCredmodule
:
null
,
delCredacquire
:
null
,
delCredextr
:
null
}
UserIDM
.
delCred
(
credentialId
,
token
,{
onResult
:
function
(
result
,
extraInfo
){
console
.
log
(
"
testFace faceDemo delCred result =
"
+
result
)
onresult
.
delCredresult
=
result
console
.
log
(
"
testFace faceDemo delCred extraInfo =
"
+
extraInfo
)
if
(
extraInfo
!=
undefined
)
{
onresult
.
CredentialId
=
extraInfo
.
credentialId
}
else
{
onresult
.
CredentialId
=
null
;
}
console
.
log
(
"
testFace faceDemo delCred onresult =
"
+
JSON
.
stringify
(
onresult
));
callback1
(
onresult
)
},
onAcquireInfo
:
function
(
modulea
,
acquire
,
extr
){
console
.
info
(
'
testFace publicdelCred delCred onAcquireInfo in
'
);
onacquireinfo
.
delCredmodule
=
modulea
onacquireinfo
.
delCredacquire
=
acquire
onacquireinfo
.
delCredextr
=
extr
console
.
log
(
"
testFace faceDemo delCred module =
"
+
modulea
);
console
.
log
(
"
testFace faceDemo delCred onacquireinfo =
"
+
JSON
.
stringify
(
onacquireinfo
));
callback2
(
onacquireinfo
)
}
})
}
catch
(
e
)
{
console
.
log
(
"
testFace publicdelCred fail
"
+
e
);
expect
(
null
).
assertFail
();
}
}
function
publicgetAuthInfo
(
UserIDM
,
authType
,
callback
){
console
.
info
(
'
testFace publicgetAuthInfo in
'
);
try
{
console
.
info
(
'
testFace publicgetAuthInfo in try
'
);
console
.
info
(
'
testFace publicgetAuthInfo UserIDM =
'
+
UserIDM
);
UserIDM
.
getAuthInfo
(
authType
,
function
(
AsyncCallback
)
{
console
.
log
(
"
testFace faceDemo getAuthInfo AsyncCallback =
"
+
JSON
.
stringify
(
AsyncCallback
))
callback
(
AsyncCallback
)
})
}
catch
(
e
)
{
console
.
log
(
"
testFace publicgetAuthInfo fail
"
+
e
);
expect
(
null
).
assertFail
();
}
}
function
publicgetallAuthInfo
(
UserIDM
,
callback
){
console
.
info
(
'
testFace publicgetallAuthInfo in
'
);
try
{
console
.
info
(
'
testFace publicgetallAuthInfo in try
'
);
console
.
info
(
'
testFace publicgetallAuthInfo UserIDM =
'
+
UserIDM
);
UserIDM
.
getAuthInfo
(
function
(
AsyncCallback
)
{
console
.
log
(
"
testFace faceDemo getallAuthInfo AsyncCallback =
"
+
JSON
.
stringify
(
AsyncCallback
))
callback
(
AsyncCallback
)
})
}
catch
(
e
)
{
console
.
log
(
"
testFace publicgetallAuthInfo fail
"
+
e
);
expect
(
null
).
assertFail
();
}
}
//同步
function
publicgetAvailabeStatus
(
UserAuth
,
authType
,
authTrustLevel
){
console
.
info
(
'
testFace publicgetAvailabeStatus in
'
);
try
{
console
.
info
(
'
testFace publicgetAvailabeStatus in try
'
);
console
.
info
(
'
testFace publicgetAvailabeStatus UserAuth =
'
+
UserAuth
);
let
AvailabeStatus
=
null
AvailabeStatus
=
UserAuth
.
getAvailabeStatus
(
authType
,
authTrustLevel
);
console
.
info
(
'
testFace publicgetAvailabeStatus result =
'
+
JSON
.
stringify
(
AsyncCallback
));
return
AvailabeStatus
}
catch
(
e
)
{
console
.
log
(
"
testFace publicgetAvailabeStatus fail
"
+
e
);
expect
(
null
).
assertFail
();
}
}
function
publicgetProperty
(
UserAuth
,
GetPropertyRequest
,
callback
){
console
.
info
(
'
testFace publicgetProperty in
'
);
try
{
console
.
info
(
'
testFace publicgetProperty in try
'
);
console
.
info
(
'
testFace publicgetProperty UserAuth =
'
+
UserAuth
);
UserAuth
.
getProperty
(
GetPropertyRequest
,
function
(
AsyncCallback
)
{
console
.
log
(
"
testFace faceDemo getallAuthInfo AsyncCallback =
"
+
JSON
.
stringify
(
AsyncCallback
))
callback
(
AsyncCallback
)
})
}
catch
(
e
)
{
console
.
log
(
"
testFace publicgetProperty fail
"
+
e
);
expect
(
null
).
assertFail
();
}
}
function
publicsetProperty
(
UserAuth
,
SetPropertyRequest
,
callback
){
console
.
info
(
'
testFace publicsetProperty in
'
);
try
{
console
.
info
(
'
testFace publicsetProperty in try
'
);
console
.
info
(
'
testFace publicsetProperty UserAuth =
'
+
UserAuth
);
UserAuth
.
setProperty
(
SetPropertyRequest
,
function
(
AsyncCallback
)
{
console
.
log
(
"
testFace faceDemo getallAuthInfo AsyncCallback =
"
+
JSON
.
stringify
(
AsyncCallback
))
callback
(
AsyncCallback
)
})
}
catch
(
e
)
{
console
.
log
(
"
testFace publicsetProperty fail
"
+
e
);
expect
(
null
).
assertFail
();
}
}
function
publicauth
(
UserAuth
,
challenge
,
authType
,
authTrustLevel
,
callback1
,
callback2
){
console
.
info
(
'
testFace publicauth in
'
);
try
{
console
.
info
(
'
testFace publicauth in try
'
);
console
.
info
(
'
testFace publicauth UserAuth =
'
+
UserAuth
);
let
onresult
=
{
authresult
:
null
,
authextr
:
null
,
}
let
onacquireinfo
=
{
authmodule
:
null
,
authacquire
:
null
,
authextr
:
null
}
let
contextID1
=
null
contextID1
=
UserAuth
.
auth
(
challenge
,
authType
,
authTrustLevel
,{
onResult
:
function
(
result
,
extraInfo
){
console
.
log
(
"
testFace faceDemo auth result =
"
+
result
)
onresult
.
authresult
=
result
console
.
log
(
"
testFace faceDemo auth extraInfo =
"
+
JSON
.
stringify
(
extraInfo
));
onresult
.
authextr
=
extraInfo
;
console
.
info
(
'
testFace publicauth auth onResult =
'
+
JSON
.
stringify
(
onresult
));
callback1
(
onresult
)
},
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
));
callback2
(
onacquireinfo
)
}
});
console
.
info
(
'
testFace publicauth auth contextID1 =
'
+
contextID1
);
return
contextID1
}
catch
(
e
)
{
console
.
log
(
"
testFace publicauth fail
"
+
e
);
expect
(
null
).
assertFail
();
}
}
function
publicauthUser
(
UserAuth
,
userID
,
challenge
,
authType
,
authTrustLevel
,
callback1
,
callback2
){
console
.
info
(
'
testFace publicauthUser in
'
);
try
{
console
.
info
(
'
testFace publicauthUser in try
'
);
console
.
info
(
'
testFace publicauthUser UserAuth =
'
+
UserAuth
);
let
onresult
=
{
authresult
:
null
,
authextr
:
null
,
}
let
onacquireinfo
=
{
authmodule
:
null
,
authacquire
:
null
,
authextr
:
null
}
let
contextID1
=
null
contextID1
=
UserAuth
.
authUser
(
userID
,
challenge
,
authType
,
authTrustLevel
,
{
onResult
:
function
(
result
,
extraInfo
){
console
.
log
(
"
testFace faceDemo authUser result =
"
+
result
)
onresult
.
authresult
=
result
console
.
log
(
"
testFace faceDemo authUser authextr =
"
+
extraInfo
)
onresult
.
authextr
=
extraInfo
;
console
.
info
(
'
testFace publicauthUser authUser onResult =
'
+
JSON
.
stringify
(
onresult
));
callback1
(
onresult
)
},
onAcquireInfo
:
function
(
modulea
,
acquire
,
extr
){
console
.
info
(
'
testFace publicauthUser authUser onAcquireInfo in
'
);
onacquireinfo
.
authmodule
=
modulea
onacquireinfo
.
authacquire
=
acquire
onacquireinfo
.
authextr
=
extr
console
.
log
(
"
testFace faceDemo authUser module =
"
+
modulea
);
console
.
info
(
'
testFace publicauthUser authUser onacquireinfo =
'
+
JSON
.
stringify
(
onacquireinfo
));
callback2
(
onacquireinfo
)
}
})
console
.
info
(
'
testFace publicauthUser authUser contextID1 =
'
+
contextID1
);
return
contextID1
}
catch
(
e
)
{
console
.
log
(
"
testFace publicauthUser fail
"
+
e
);
expect
(
null
).
assertFail
();
}
}
//同步
function
publicgecancelAuth
(
UserAuth
,
contextID
){
console
.
info
(
'
testFace publicgecancelAuth in
'
);
try
{
console
.
info
(
'
testFace publicgecancelAuth in try
'
);
console
.
info
(
'
testFace publicgecancelAuth UserAuth =
'
+
UserAuth
);
let
cancelAuthresult
=
null
cancelAuthresult
=
UserAuth
.
cancelAuth
(
contextID
)
console
.
info
(
'
testFace publicgecancelAuth cancelAuth cancelAuthresult =
'
+
cancelAuthresult
);
return
cancelAuthresult
}
catch
(
e
)
{
console
.
log
(
"
testFace publiccancelAuth fail
"
+
e
);
expect
(
null
).
assertFail
();
}
}
export
{
publicRegisterInputer
,
publicgetallAuthInfo
,
publicunRegisterInputer
,
publicOpenSession
,
publicCloseSession
,
publicaddCredential
,
publicupdateCred
,
publiccancel
,
publicdelUser
,
publicdelCred
,
publicgetAuthInfo
,
publicgetAvailabeStatus
,
publicgetProperty
,
publicsetProperty
,
publicauth
,
publicauthUser
,
publicgecancelAuth
}
\ No newline at end of file
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/test/Security_IAM_Coauth_Func_CallbackJsunit.test.js
0 → 100644
浏览文件 @
3f479d4f
此差异已折叠。
点击以展开。
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/test/Security_IAM_Face_Func_CallbackJsunit.test.js
0 → 100644
浏览文件 @
3f479d4f
此差异已折叠。
点击以展开。
useriam/face_auth/js_api_test/function_test/userauthpart2/entry/src/main/js/test/Security_IAM_PIN_Func_CallbackJsunit.test.js
0 → 100644
浏览文件 @
3f479d4f
此差异已折叠。
点击以展开。
useriam/face_auth/js_api_test/function_test/userauthpart2/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
3f479d4f
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录