Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
c6355ae3
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看板
提交
c6355ae3
编写于
11月 30, 2021
作者:
Z
zhaoyuan17
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update account xts code 1130
Signed-off-by:
N
zhaoyuan17
<
zhaoyuan17@huawei.com
>
上级
74c034a3
变更
35
展开全部
隐藏空白更改
内联
并排
Showing
35 changed file
with
1078 addition
and
359 deletion
+1078
-359
account/appaccount/BUILD.gn
account/appaccount/BUILD.gn
+0
-1
account/appaccount/actsaccountchangeonoff/BUILD.gn
account/appaccount/actsaccountchangeonoff/BUILD.gn
+0
-31
account/appaccount/actsaccountchangeonoff/Test.json
account/appaccount/actsaccountchangeonoff/Test.json
+0
-19
account/appaccount/actsaccountchangeonoff/entry/src/main/config.json
...account/actsaccountchangeonoff/entry/src/main/config.json
+0
-61
account/appaccount/actsaccountchangeonoff/entry/src/main/js/default/app.js
...t/actsaccountchangeonoff/entry/src/main/js/default/app.js
+0
-22
account/appaccount/actsaccountchangeonoff/entry/src/main/js/default/i18n/en-US.json
...ountchangeonoff/entry/src/main/js/default/i18n/en-US.json
+0
-6
account/appaccount/actsaccountchangeonoff/entry/src/main/js/default/i18n/zh-CN.json
...ountchangeonoff/entry/src/main/js/default/i18n/zh-CN.json
+0
-6
account/appaccount/actsaccountchangeonoff/entry/src/main/js/default/pages/index/index.css
...angeonoff/entry/src/main/js/default/pages/index/index.css
+0
-9
account/appaccount/actsaccountchangeonoff/entry/src/main/js/default/pages/index/index.hml
...angeonoff/entry/src/main/js/default/pages/index/index.hml
+0
-5
account/appaccount/actsaccountchangeonoff/entry/src/main/js/default/pages/index/index.js
...hangeonoff/entry/src/main/js/default/pages/index/index.js
+0
-45
account/appaccount/actsaccountchangeonoff/entry/src/main/js/resources/base/element/string.json
...noff/entry/src/main/js/resources/base/element/string.json
+0
-12
account/appaccount/actsaccountchangeonoff/entry/src/main/js/resources/base/media/icon.png
...angeonoff/entry/src/main/js/resources/base/media/icon.png
+0
-0
account/appaccount/actsaccountchangeonoff/entry/src/main/js/test/List.test.js
...ctsaccountchangeonoff/entry/src/main/js/test/List.test.js
+0
-15
account/appaccount/actsaccountchangeonoff/signature/openharmony_sx.p7b
...count/actsaccountchangeonoff/signature/openharmony_sx.p7b
+0
-0
account/appaccount/actsaccounttest/Test.json
account/appaccount/actsaccounttest/Test.json
+3
-2
account/appaccount/actsaccounttest/entry/src/main/js/test/AddAccount.test.js
...actsaccounttest/entry/src/main/js/test/AddAccount.test.js
+16
-16
account/appaccount/actsaccounttest/entry/src/main/js/test/DeleteAccount.test.js
...saccounttest/entry/src/main/js/test/DeleteAccount.test.js
+16
-16
account/appaccount/actsaccounttest/entry/src/main/js/test/List.test.js
...count/actsaccounttest/entry/src/main/js/test/List.test.js
+2
-1
account/appaccount/actsaccounttest/entry/src/main/js/test/NoPermission.test.js
...tsaccounttest/entry/src/main/js/test/NoPermission.test.js
+1
-1
account/appaccount/actsaccounttest/entry/src/main/js/test/OnOff.js
...ppaccount/actsaccounttest/entry/src/main/js/test/OnOff.js
+368
-41
account/appaccount/actsgetallaccounts/entry/src/main/js/test/Getallaccounts.test.js
...allaccounts/entry/src/main/js/test/Getallaccounts.test.js
+591
-0
account/appaccount/actsgetallaccounts/entry/src/main/js/test/List.test.js
...nt/actsgetallaccounts/entry/src/main/js/test/List.test.js
+1
-1
account/appaccount/actssetchecksyncenable/entry/src/main/js/test/List.test.js
...ctssetchecksyncenable/entry/src/main/js/test/List.test.js
+1
-1
account/appaccount/actssetchecksyncenable/entry/src/main/js/test/Syncenable.test.js
...checksyncenable/entry/src/main/js/test/Syncenable.test.js
+0
-0
account/appaccount/getallaccessibleaccounts/actsgetallaccessibleaccounts/entry/src/main/js/test/Getallaccessible.test.js
...eaccounts/entry/src/main/js/test/Getallaccessible.test.js
+0
-4
account/appaccount/getallaccessibleaccounts/actsgetallaccessibleaccounts/entry/src/main/js/test/List.test.js
...allaccessibleaccounts/entry/src/main/js/test/List.test.js
+1
-1
account/appaccount/getallaccessibleaccounts/actsgetallaccessiblemultiple/entry/src/main/js/test/Getmultiple.test.js
...ssiblemultiple/entry/src/main/js/test/Getmultiple.test.js
+0
-5
account/appaccount/getallaccessibleaccounts/actsgetallaccessiblemultiple/entry/src/main/js/test/List.test.js
...allaccessiblemultiple/entry/src/main/js/test/List.test.js
+1
-1
account/appaccount/sceneProject/actsaccountaccessibleFirst/BUILD.gn
...paccount/sceneProject/actsaccountaccessibleFirst/BUILD.gn
+6
-3
account/appaccount/sceneProject/actsaccountaccessibleSecond/BUILD.gn
...account/sceneProject/actsaccountaccessibleSecond/BUILD.gn
+6
-3
account/appaccount/sceneProject/actsaccountsceneaccessible/BUILD.gn
...paccount/sceneProject/actsaccountsceneaccessible/BUILD.gn
+6
-3
account/appaccount/sceneProject/actsaccountsceneappaccess/BUILD.gn
...ppaccount/sceneProject/actsaccountsceneappaccess/BUILD.gn
+6
-3
account/appaccount/sceneProject/actsaccountsceneonoff/BUILD.gn
...nt/appaccount/sceneProject/actsaccountsceneonoff/BUILD.gn
+6
-3
account/appaccount/sceneProject/actsaccountsceneonoff/entry/src/main/js/default/pages/index/index.js
...sceneonoff/entry/src/main/js/default/pages/index/index.js
+41
-19
account/appaccount/sceneProject/actsscenegetallaccounts/BUILD.gn
.../appaccount/sceneProject/actsscenegetallaccounts/BUILD.gn
+6
-3
未找到文件。
account/appaccount/BUILD.gn
浏览文件 @
c6355ae3
...
...
@@ -17,7 +17,6 @@ group("appaccount_hap") {
testonly = true
if (is_standard_system) {
deps = [
"actsaccountchangeonoff:ActsAccountChangeOnOff",
"actsaccounttest:ActsAccountTest",
"actsgetallaccounts:ActsGetAllAccounts",
"actssetchecksyncenable:ActsSetCheckSyncEnable",
...
...
account/appaccount/actsaccountchangeonoff/BUILD.gn
已删除
100755 → 0
浏览文件 @
74c034a3
# 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("ActsAccountChangeOnOff") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAccountChangeOnOff"
}
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"
}
account/appaccount/actsaccountchangeonoff/Test.json
已删除
100755 → 0
浏览文件 @
74c034a3
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"60000"
,
"package"
:
"com.example.actsaccountchangeonoff"
,
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsAccountChangeOnOff.hap"
,
"ActsAccountSceneOnOff.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
account/appaccount/actsaccountchangeonoff/entry/src/main/config.json
已删除
100755 → 0
浏览文件 @
74c034a3
{
"app"
:
{
"bundleName"
:
"com.example.actsaccountchangeonoff"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1
,
"name"
:
"1.0"
},
"apiVersion"
:
{
"compatible"
:
4
,
"target"
:
5
,
"releaseType"
:
"Beta1"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.actsaccountchangeonoff"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"com.example.actsaccountchangeonoff.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:app_name"
,
"type"
:
"page"
,
"visible"
:
true
,
"launchType"
:
"standard"
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
\ No newline at end of file
account/appaccount/actsaccountchangeonoff/entry/src/main/js/default/app.js
已删除
100755 → 0
浏览文件 @
74c034a3
/*
* 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
'
);
}
};
account/appaccount/actsaccountchangeonoff/entry/src/main/js/default/i18n/en-US.json
已删除
100755 → 0
浏览文件 @
74c034a3
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
account/appaccount/actsaccountchangeonoff/entry/src/main/js/default/i18n/zh-CN.json
已删除
100755 → 0
浏览文件 @
74c034a3
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
account/appaccount/actsaccountchangeonoff/entry/src/main/js/default/pages/index/index.css
已删除
100755 → 0
浏览文件 @
74c034a3
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
100px
;
}
account/appaccount/actsaccountchangeonoff/entry/src/main/js/default/pages/index/index.hml
已删除
100755 → 0
浏览文件 @
74c034a3
<div class="container">
<text class="title">
{{title}}
</text>
</div>
account/appaccount/actsaccountchangeonoff/entry/src/main/js/default/pages/index/index.js
已删除
100755 → 0
浏览文件 @
74c034a3
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
file
from
'
@system.file
'
import
{
Core
,
ExpectExtend
}
from
'
deccjsunit/index
'
const
injectRef
=
Object
.
getPrototypeOf
(
global
)
||
global
injectRef
.
regeneratorRuntime
=
require
(
'
@babel/runtime/regenerator
'
)
export
default
{
data
:
{
title
:
"
测试on/off接口
"
},
onInit
()
{
this
.
title
=
"
测试on/off接口
"
;
},
onShow
()
{
console
.
info
(
'
onShow finish
'
)
const
core
=
Core
.
getInstance
()
const
expectExtend
=
new
ExpectExtend
({
'
id
'
:
'
extend
'
})
core
.
addService
(
'
expect
'
,
expectExtend
)
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
configService
.
setConfig
(
this
)
require
(
'
../../../test/List.test
'
)
core
.
execute
()
},
onReady
()
{
},
}
\ No newline at end of file
account/appaccount/actsaccountchangeonoff/entry/src/main/js/resources/base/element/string.json
已删除
100755 → 0
浏览文件 @
74c034a3
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"ActsAccountChangeOnOff"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
account/appaccount/actsaccountchangeonoff/entry/src/main/js/resources/base/media/icon.png
已删除
100755 → 0
浏览文件 @
74c034a3
6.6 KB
account/appaccount/actsaccountchangeonoff/entry/src/main/js/test/List.test.js
已删除
100755 → 0
浏览文件 @
74c034a3
/*
* 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
(
'
./ExampleJsunit.test.js
'
)
\ No newline at end of file
account/appaccount/actsaccountchangeonoff/signature/openharmony_sx.p7b
已删除
100755 → 0
浏览文件 @
74c034a3
文件已删除
account/appaccount/actsaccounttest/Test.json
浏览文件 @
c6355ae3
...
...
@@ -2,7 +2,7 @@
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"
2
00000"
,
"test-timeout"
:
"
3
00000"
,
"package"
:
"com.example.actsaccounttest"
,
"shell-timeout"
:
"60000"
},
...
...
@@ -10,7 +10,8 @@
{
"test-file-name"
:
[
"ActsAccountTest.hap"
,
"ActsAccountSceneAppAccess.hap"
"ActsAccountSceneAppAccess.hap"
,
"ActsAccountSceneOnOff.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
...
...
account/appaccount/actsaccounttest/entry/src/main/js/test/AddAccount.test.js
浏览文件 @
c6355ae3
...
...
@@ -21,8 +21,8 @@ describe('ActsAccountAddAccount', function () {
/*
* @tc.number : ActsAccountAddAccount_0100
* @tc.name : Add account call
l
back form
* @tc.desc : Add account in call
l
back form without additional information
* @tc.name : Add account callback form
* @tc.desc : Add account in callback form without additional information
*/
it
(
'
ActsAccountAddAccount_0100
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsAccountAddAccount_0100 start====
"
);
...
...
@@ -66,8 +66,8 @@ describe('ActsAccountAddAccount', function () {
/*
* @tc.number : ActsAccountAddAccount_0300
* @tc.name : Add account call
l
back form
* @tc.desc : Add account in call
l
back form with additional information
* @tc.name : Add account callback form
* @tc.desc : Add account in callback form with additional information
*/
it
(
'
ActsAccountAddAccount_0300
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsAccountAddAccount_0300 start====
"
);
...
...
@@ -112,7 +112,7 @@ describe('ActsAccountAddAccount', function () {
/*
* @tc.number : ActsAccountAddAccount_0500
* @tc.name : Add account call
l
back form
* @tc.name : Add account callback form
* @tc.desc : Repeatedly add the same name account and the same additional information
*/
it
(
'
ActsAccountAddAccount_0500
'
,
0
,
async
function
(
done
)
{
...
...
@@ -159,7 +159,7 @@ describe('ActsAccountAddAccount', function () {
/*
* @tc.number : ActsAccountAddAccount_0700
* @tc.name : Add account call
l
back form
* @tc.name : Add account callback form
* @tc.desc : The account name exceeds the length limit of 512 characters
*/
it
(
'
ActsAccountAddAccount_0700
'
,
0
,
async
function
(
done
)
{
...
...
@@ -202,7 +202,7 @@ describe('ActsAccountAddAccount', function () {
/*
* @tc.number : ActsAccountAddAccount_0900
* @tc.name : Add account call
l
back form
* @tc.name : Add account callback form
* @tc.desc : Additional information exceeds the length limit of 1024 characters
*/
it
(
'
ActsAccountAddAccount_0900
'
,
0
,
async
function
(
done
)
{
...
...
@@ -245,7 +245,7 @@ describe('ActsAccountAddAccount', function () {
/*
* @tc.number : ActsAccountAddAccount_1100
* @tc.name : Add account call
l
back form
* @tc.name : Add account callback form
* @tc.desc : The account name is an empty string
*/
it
(
'
ActsAccountAddAccount_1100
'
,
0
,
async
function
(
done
)
{
...
...
@@ -281,7 +281,7 @@ describe('ActsAccountAddAccount', function () {
/*
* @tc.number : ActsAccountAddAccount_1300
* @tc.name : Add account call
l
back form
* @tc.name : Add account callback form
* @tc.desc : Additional information is an empty string
*/
it
(
'
ActsAccountAddAccount_1300
'
,
0
,
async
function
(
done
)
{
...
...
@@ -323,7 +323,7 @@ describe('ActsAccountAddAccount', function () {
/*
* @tc.number : ActsAccountAddAccount_1500
* @tc.name : Add account call
l
back form
* @tc.name : Add account callback form
* @tc.desc : The account name is a special character such as a space
*/
it
(
'
ActsAccountAddAccount_1500
'
,
0
,
async
function
(
done
)
{
...
...
@@ -361,7 +361,7 @@ describe('ActsAccountAddAccount', function () {
/*
* @tc.number : ActsAccountAddAccount_1700
* @tc.name : Add account call
l
back form
* @tc.name : Add account callback form
* @tc.desc : The account name is a special string
*/
it
(
'
ActsAccountAddAccount_1700
'
,
0
,
async
function
(
done
)
{
...
...
@@ -406,7 +406,7 @@ describe('ActsAccountAddAccount', function () {
/*
* @tc.number : ActsAccountAddAccount_1900
* @tc.name : Add account call
l
back form
* @tc.name : Add account callback form
* @tc.desc : Additional information is a special character such as a space
*/
it
(
'
ActsAccountAddAccount_1900
'
,
0
,
async
function
(
done
)
{
...
...
@@ -451,7 +451,7 @@ describe('ActsAccountAddAccount', function () {
/*
* @tc.number : ActsAccountAddAccount_2100
* @tc.name : Add account call
l
back form
* @tc.name : Add account callback form
* @tc.desc : Additional information is a special string
*/
it
(
'
ActsAccountAddAccount_2100
'
,
0
,
async
function
(
done
)
{
...
...
@@ -496,7 +496,7 @@ describe('ActsAccountAddAccount', function () {
/*
* @tc.number : ActsAccountAddAccount_2300
* @tc.name : Add account call
l
back form
* @tc.name : Add account callback form
* @tc.desc : Repeatedly add accounts with the same name and different additional information
*/
it
(
'
ActsAccountAddAccount_2300
'
,
0
,
async
function
(
done
)
{
...
...
@@ -543,7 +543,7 @@ describe('ActsAccountAddAccount', function () {
/*
* @tc.number : ActsAccountAddAccount_2500
* @tc.name : Add account call
l
back form
* @tc.name : Add account callback form
* @tc.desc : The account name reaches the limit of 512 characters
*/
it
(
'
ActsAccountAddAccount_2500
'
,
0
,
async
function
(
done
)
{
...
...
@@ -594,7 +594,7 @@ describe('ActsAccountAddAccount', function () {
/*
* @tc.number : ActsAccountAddAccount_2700
* @tc.name : Add account call
l
back form
* @tc.name : Add account callback form
* @tc.desc : Additional information reaches the limit of 1024 characters
*/
it
(
'
ActsAccountAddAccount_2700
'
,
0
,
async
function
(
done
)
{
...
...
account/appaccount/actsaccounttest/entry/src/main/js/test/DeleteAccount.test.js
浏览文件 @
c6355ae3
...
...
@@ -15,8 +15,8 @@
import
account
from
'
@ohos.account.appAccount
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
const
NAMELIMIT
=
512
;
const
TIMEOUT
=
1000
;
const
STRCOUNT
=
1025
;
describe
(
'
ActsAccountDeleteAccount
'
,
function
()
{
function
sleep
(
delay
)
{
var
start
=
(
new
Date
()).
getTime
();
...
...
@@ -34,7 +34,7 @@ describe('ActsAccountDeleteAccount', function () {
/*
* @tc.number : ActsAccountDeleteAccount_0100
* @tc.name : Delete account call
l
back form
* @tc.name : Delete account callback form
* @tc.desc : Delete the added account in callback form
*/
it
(
'
ActsAccountDeleteAccount_0100
'
,
0
,
async
function
(
done
)
{
...
...
@@ -77,7 +77,7 @@ describe('ActsAccountDeleteAccount', function () {
/*
* @tc.number : ActsAccountDeleteAccount_0300
* @tc.name : Delete account call
l
back form
* @tc.name : Delete account callback form
* @tc.desc : Delete unadded account in callback form
*/
it
(
'
ActsAccountDeleteAccount_0300
'
,
0
,
async
function
(
done
)
{
...
...
@@ -113,7 +113,7 @@ describe('ActsAccountDeleteAccount', function () {
/*
* @tc.number : ActsAccountDeleteAccount_0500
* @tc.name : Delete account call
l
back form
* @tc.name : Delete account callback form
* @tc.desc : Delete the added account, the first time it can be deleted, the second time the deletion fails
*/
it
(
'
ActsAccountDeleteAccount_0500
'
,
0
,
async
function
(
done
)
{
...
...
@@ -161,17 +161,17 @@ describe('ActsAccountDeleteAccount', function () {
/*
* @tc.number : ActsAccountDeleteAccount_0700
* @tc.name : Delete account call
l
back form
* @tc.desc : Delete the account name exceeds the length limit of
1024
* @tc.name : Delete account callback form
* @tc.desc : Delete the account name exceeds the length limit of
512 characters
*/
it
(
'
ActsAccountDeleteAccount_0700
'
,
0
,
async
function
(
done
){
console
.
debug
(
"
====>ActsAccountDeleteAccount_0700 start====
"
);
var
bigStr
=
''
;
for
(
var
i
=
0
;
i
<
STRCOUNT
;
i
++
)
{
bigStr
+=
'
t
'
;
var
nameLimit
=
''
;
for
(
var
i
=
0
;
i
<
NAMELIMIT
+
1
;
i
++
)
{
nameLimit
+=
'
t
'
;
}
var
appAccountManager
=
account
.
createAppAccountManager
();
appAccountManager
.
deleteAccount
(
bigStr
,
(
err
)
=>
{
appAccountManager
.
deleteAccount
(
nameLimit
,
(
err
)
=>
{
console
.
debug
(
"
====>delete Account ActsAccountDeleteAccount_0700 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertEqual
(
true
);
console
.
debug
(
"
====>ActsAccountDeleteAccount_0700 end====
"
);
...
...
@@ -182,18 +182,18 @@ describe('ActsAccountDeleteAccount', function () {
/*
* @tc.number : ActsAccountDeleteAccount_0800
* @tc.name : Delete account promise form
* @tc.desc : Delete the account name exceeds the length limit of
1024
* @tc.desc : Delete the account name exceeds the length limit of
512 characters
*/
it
(
'
ActsAccountDeleteAccount_0800
'
,
0
,
async
function
(
done
){
console
.
debug
(
"
====>ActsAccountDeleteAccount_0800 start====
"
);
var
bigStr
=
''
;
for
(
var
i
=
0
;
i
<
STRCOUNT
;
i
++
)
{
bigStr
+=
'
t
'
;
var
nameLimit
=
''
;
for
(
var
i
=
0
;
i
<
NAMELIMIT
+
1
;
i
++
)
{
nameLimit
+=
'
n
'
;
}
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>delete Account ActsAccountDeleteAccount_0800 start====
"
);
try
{
await
appAccountManager
.
deleteAccount
(
bigStr
);
await
appAccountManager
.
deleteAccount
(
nameLimit
);
}
catch
(
err
){
console
.
debug
(
"
====>delete account ActsAccountDeleteAccount_0800 err:
"
+
JSON
.
stringify
(
err
));
...
...
@@ -205,7 +205,7 @@ describe('ActsAccountDeleteAccount', function () {
/*
* @tc.number : ActsAccountDeleteAccount_0900
* @tc.name : Delete account call
l
back form
* @tc.name : Delete account callback form
* @tc.desc : Delete the account name is an empty string
*/
it
(
'
ActsAccountDeleteAccount_0900
'
,
0
,
async
function
(
done
){
...
...
account/appaccount/actsaccounttest/entry/src/main/js/test/List.test.js
浏览文件 @
c6355ae3
...
...
@@ -20,4 +20,5 @@ require('./AssociatedData.test.js')
require
(
'
./Credential.test.js
'
)
require
(
'
./OAuthToken.test.js
'
)
require
(
'
./CreatManager.test.js
'
)
require
(
'
./NoPermission.test.js
'
)
\ No newline at end of file
require
(
'
./NoPermission.test.js
'
)
require
(
'
./OnOff.js
'
)
\ No newline at end of file
account/appaccount/actsaccounttest/entry/src/main/js/test/NoPermission.test.js
浏览文件 @
c6355ae3
...
...
@@ -16,7 +16,7 @@ import account from '@ohos.account.appAccount'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
const
TIMEOUT
=
1000
;
const
ERR_APPACCOUNT_SERVICE_PERMISSION_DENIED
=
452199
0
;
const
ERR_APPACCOUNT_SERVICE_PERMISSION_DENIED
=
452199
2
;
describe
(
'
ActsAccountNoPermission
'
,
function
()
{
function
sleep
(
delay
)
{
var
start
=
(
new
Date
()).
getTime
();
...
...
account/appaccount/actsaccount
changeonoff/entry/src/main/js/test/ExampleJsunit.test
.js
→
account/appaccount/actsaccount
test/entry/src/main/js/test/OnOff
.js
浏览文件 @
c6355ae3
此差异已折叠。
点击以展开。
account/appaccount/actsgetallaccounts/entry/src/main/js/test/
ExampleJsunit
.test.js
→
account/appaccount/actsgetallaccounts/entry/src/main/js/test/
Getallaccounts
.test.js
浏览文件 @
c6355ae3
...
...
@@ -17,7 +17,7 @@ import featureAbility from '@ohos.ability.featureability'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
const
TIMEOUT
=
2000
;
const
STRCOUNT
=
1025
;
const
LENGTHLIMIT
=
1024
;
describe
(
'
ActsGetAllAccounts
'
,
function
()
{
/*
...
...
@@ -179,11 +179,11 @@ describe('ActsGetAllAccounts', function () {
console
.
debug
(
"
====>ActsGetAllAccounts_0700 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat finish====
"
);
var
bigBundleNam
e
=
''
;
for
(
var
i
=
0
;
i
<
STRCOUNT
;
i
++
)
{
bigBundleNam
e
+=
'
t
'
;
var
limitBundl
e
=
''
;
for
(
var
i
=
0
;
i
<
LENGTHLIMIT
+
1
;
i
++
)
{
limitBundl
e
+=
'
t
'
;
}
appAccountManager
.
getAllAccounts
(
bigBundleNam
e
,
(
err
,
data
)
=>
{
appAccountManager
.
getAllAccounts
(
limitBundl
e
,
(
err
,
data
)
=>
{
console
.
debug
(
"
====>getAllAccounts 0700 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertEqual
(
true
);
console
.
debug
(
"
====>ActsGetAllAccounts_0700 end====
"
);
...
...
@@ -200,12 +200,12 @@ describe('ActsGetAllAccounts', function () {
console
.
debug
(
"
====>ActsGetAllAccounts_0800 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat finish====
"
);
var
bigBundleNam
e
=
''
;
for
(
var
i
=
0
;
i
<
STRCOUNT
;
i
++
)
{
bigBundleName
+=
'
t
'
;
var
limitBundl
e
=
''
;
for
(
var
i
=
0
;
i
<
LENGTHLIMIT
+
1
;
i
++
)
{
limitBundle
+=
'
n
'
;
}
try
{
var
data
=
await
appAccountManager
.
getAllAccounts
(
bigBundleNam
e
);
var
data
=
await
appAccountManager
.
getAllAccounts
(
limitBundl
e
);
}
catch
(
err
){
console
.
debug
(
"
====>getAllAccounts 0800 err:
"
+
JSON
.
stringify
(
err
));
...
...
@@ -217,7 +217,7 @@ describe('ActsGetAllAccounts', function () {
/*
* @tc.number : ActsGetAllAccounts_0900
* @tc.name : getAllAccounts
* @tc.name : getAllAccounts
callback
* @tc.desc : This application adds an account, and after other applications authorize an account to this
* application, this application obtains the information of its own application
*/
...
...
@@ -227,7 +227,7 @@ describe('ActsGetAllAccounts', function () {
console
.
debug
(
"
====>creat finish====
"
);
var
selfBundle
=
"
com.example.actsgetallaaccounts
"
;
console
.
debug
(
"
====>add account 0900 start====
"
);
await
appAccountManager
.
addAccount
(
"
Account_
this_application
"
);
await
appAccountManager
.
addAccount
(
"
Account_
application_callback
"
);
console
.
debug
(
"
====>startAbility 0900 start====
"
);
await
featureAbility
.
startAbility
(
{
...
...
@@ -242,30 +242,350 @@ describe('ActsGetAllAccounts', function () {
},
},
);
function
getAllCallback
(
err
,
data
){
console
.
debug
(
"
====>getAllAccounts 0900 err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>getAllAccounts 0900 data:
"
+
JSON
.
stringify
(
data
));
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
[
0
].
name
).
assertEqual
(
"
Account_application_callback
"
);
expect
(
data
[
0
].
owner
).
assertEqual
(
"
com.example.actsgetallaaccounts
"
);
appAccountManager
.
deleteAccount
(
"
Account_application_callback
"
,
(
err
)
=>
{
console
.
debug
(
"
====>delete account 0900 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
console
.
debug
(
"
====>ActsGetAllAccounts_0900 end====
"
);
done
();
});
}
setTimeout
(
async
function
(){
console
.
debug
(
"
====>getAllAccounts 0900 start====
"
);
appAccountManager
.
getAllAccounts
(
selfBundle
,
getAllCallback
);
},
TIMEOUT
);
});
/*
* @tc.number : ActsGetAllAccounts_1000
* @tc.name : getAllAccounts promise
* @tc.desc : This application adds an account, and after other applications authorize an account to this
* application, this application obtains the information of its own application
*/
it
(
'
ActsGetAllAccounts_1000
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsGetAllAccounts_1000 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat finish====
"
);
var
selfBundle
=
"
com.example.actsgetallaaccounts
"
;
console
.
debug
(
"
====>add account 1000 start====
"
);
await
appAccountManager
.
addAccount
(
"
Account_application_promise
"
);
console
.
debug
(
"
====>startAbility 1000 start====
"
);
await
featureAbility
.
startAbility
(
{
want
:
{
deviceId
:
""
,
bundleName
:
"
com.example.actsscenegetallaccounts
"
,
abilityName
:
"
com.example.actsscenegetallaccounts.MainAbility
"
,
action
:
"
action1
"
,
parameters
:
{},
},
},
);
setTimeout
(
async
function
(){
console
.
debug
(
"
====>getAllAccounts 1000 start====
"
);
try
{
var
data
=
await
appAccountManager
.
getAllAccounts
(
selfBundle
);
}
catch
(
err
){
console
.
error
(
"
====>getAllAccounts
09
00 fail err:
"
+
JSON
.
stringify
(
err
));
console
.
error
(
"
====>getAllAccounts
10
00 fail err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
console
.
debug
(
"
====>getAllAccounts
09
00 data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>getAllAccounts
10
00 data:
"
+
JSON
.
stringify
(
data
));
try
{
expect
(
data
[
0
].
name
).
assertEqual
(
"
Account_
this_application
"
);
expect
(
data
[
0
].
name
).
assertEqual
(
"
Account_
application_promise
"
);
expect
(
data
[
0
].
owner
).
assertEqual
(
"
com.example.actsgetallaaccounts
"
);
}
catch
(
err
){
console
.
error
(
"
====>check data
09
00 fail err:
"
+
JSON
.
stringify
(
err
));
console
.
error
(
"
====>check data
10
00 fail err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
console
.
debug
(
"
====>delete account
09
00 start====
"
);
await
appAccountManager
.
deleteAccount
(
"
Account_
this_application
"
);
console
.
debug
(
"
====>ActsGetAllAccounts_
09
00 end====
"
);
console
.
debug
(
"
====>delete account
10
00 start====
"
);
await
appAccountManager
.
deleteAccount
(
"
Account_
application_promise
"
);
console
.
debug
(
"
====>ActsGetAllAccounts_
10
00 end====
"
);
done
();
},
TIMEOUT
);
});
/*
* @tc.number : ActsGetAllAccounts_1100
* @tc.name : getAllAccounts callback
* @tc.desc : This application adds an account, and after other applications authorize an account to this
* application, this application obtains the information of its own application
*/
it
(
'
ActsGetAllAccounts_1100
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsGetAllAccounts_0900 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat finish====
"
);
var
specifiedBundle
=
"
com.example.actsscenegetallaccounts
"
;
console
.
debug
(
"
====>startAbility 1100 start====
"
);
await
featureAbility
.
startAbility
(
{
want
:
{
deviceId
:
""
,
bundleName
:
"
com.example.actsscenegetallaccounts
"
,
abilityName
:
"
com.example.actsscenegetallaccounts.MainAbility
"
,
action
:
"
action1
"
,
parameters
:
{},
},
},
);
function
getAllCallback
(
err
,
data
){
console
.
debug
(
"
====>getAllAccounts 1100 err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>getAllAccounts 1100 data:
"
+
JSON
.
stringify
(
data
));
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
[
0
].
name
).
assertEqual
(
"
account_name_scene_single
"
);
expect
(
data
[
0
].
owner
).
assertEqual
(
"
com.example.actsscenegetallaccounts
"
);
console
.
debug
(
"
====>ActsGetAllAccounts_1100 end====
"
);
done
();
}
setTimeout
(
async
function
(){
console
.
debug
(
"
====>getAllAccounts 1100 start====
"
);
appAccountManager
.
getAllAccounts
(
specifiedBundle
,
getAllCallback
);
},
TIMEOUT
);
});
/*
* @tc.number : ActsGetAllAccounts_1200
* @tc.name : getAllAccounts promise
* @tc.desc : This application adds an account, and after other applications authorize an account to this
* application, this application obtains the information of its own application
*/
it
(
'
ActsGetAllAccounts_1200
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsGetAllAccounts_1200 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat finish====
"
);
var
specifiedBundle
=
"
com.example.actsscenegetallaccounts
"
;
console
.
debug
(
"
====>startAbility 1200 start====
"
);
await
featureAbility
.
startAbility
(
{
want
:
{
deviceId
:
""
,
bundleName
:
"
com.example.actsscenegetallaccounts
"
,
abilityName
:
"
com.example.actsscenegetallaccounts.MainAbility
"
,
action
:
"
action1
"
,
parameters
:
{},
},
},
);
setTimeout
(
async
function
(){
console
.
debug
(
"
====>getAllAccounts 1200 start====
"
);
try
{
var
data
=
await
appAccountManager
.
getAllAccounts
(
specifiedBundle
);
}
catch
(
err
){
console
.
error
(
"
====>getAllAccounts 1200 fail err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
console
.
debug
(
"
====>getAllAccounts 1200 data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
[
0
].
name
).
assertEqual
(
"
account_name_scene_single
"
);
expect
(
data
[
0
].
owner
).
assertEqual
(
"
com.example.actsscenegetallaccounts
"
);
console
.
debug
(
"
====>ActsGetAllAccounts_1200 end====
"
);
done
();
},
TIMEOUT
);
});
/*
* @tc.number : ActsGetAllAccounts_1300
* @tc.name : getAllAccounts callback
* @tc.desc : The parameter owner is a bundlename that does not exist
*/
it
(
'
ActsGetAllAccounts_1300
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsGetAllAccounts_1300 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat finish====
"
);
var
nonexistentBundle
=
"
com.example.actsgetallaccountsnonexistent
"
;
appAccountManager
.
getAllAccounts
(
nonexistentBundle
,
(
err
,
data
)
=>
{
console
.
debug
(
"
====>getAllAccounts 1300 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertEqual
(
true
);
console
.
debug
(
"
====>ActsGetAllAccounts_1300 end====
"
);
done
();
})
});
/*
* @tc.number : ActsGetAllAccounts_1400
* @tc.name : getAllAccounts promise
* @tc.desc : The parameter owner is a bundlename that does not exist
*/
it
(
'
ActsGetAllAccounts_1400
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsGetAllAccounts_1400 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat finish====
"
);
var
nonexistentBundle
=
"
com.example.actsgetallaccountsnonexistent
"
;
try
{
var
data
=
await
appAccountManager
.
getAllAccounts
(
nonexistentBundle
);
}
catch
(
err
){
console
.
debug
(
"
====>getAllAccounts 1400 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertEqual
(
true
);
console
.
debug
(
"
====>ActsGetAllAccounts_1400 end====
"
);
done
();
}
});
/*
* @tc.number : ActsGetAllAccounts_1500
* @tc.name : getAllAccounts callback
* @tc.desc : Get account information after adding and deleting account
*/
it
(
'
ActsGetAllAccounts_1500
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsGetAllAccounts_1500 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat finish====
"
);
var
selfBundle
=
"
com.example.actsgetallaaccounts
"
;
appAccountManager
.
addAccount
(
"
account_callback_delete
"
,
(
err
)
=>
{
console
.
debug
(
"
====>add account 1500 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
appAccountManager
.
getAllAccounts
(
selfBundle
,
(
err
,
data
)
=>
{
console
.
debug
(
"
====>getAllAccounts 1500 err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>getAllAccounts 1500 data:
"
+
JSON
.
stringify
(
data
));
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
[
0
].
name
).
assertEqual
(
"
account_callback_delete
"
);
expect
(
data
[
0
].
owner
).
assertEqual
(
"
com.example.actsgetallaaccounts
"
);
appAccountManager
.
deleteAccount
(
"
account_callback_delete
"
,
(
err
)
=>
{
console
.
debug
(
"
====>delete account 1500 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
appAccountManager
.
getAllAccounts
(
selfBundle
,
(
err
,
data
)
=>
{
console
.
debug
(
"
====>getAllAccounts 1500 err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>getAllAccounts 1500 data:
"
+
JSON
.
stringify
(
data
));
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
length
).
assertEqual
(
0
);
console
.
debug
(
"
====>ActsGetAllAccounts_1500 end====
"
);
done
();
})
});
})
});
});
/*
* @tc.number : ActsGetAllAccounts_1600
* @tc.name : getAllAccounts promise
* @tc.desc : Get account information after adding and deleting account
*/
it
(
'
ActsGetAllAccounts_1600
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsGetAllAccounts_1600 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat finish====
"
);
var
selfBundle
=
"
com.example.actsgetallaaccounts
"
;
console
.
debug
(
"
====>add account 1600 start====
"
);
await
appAccountManager
.
addAccount
(
"
account_promise_delete
"
);
console
.
debug
(
"
====>first getAllAccounts 1600 start====
"
);
try
{
var
data
=
await
appAccountManager
.
getAllAccounts
(
selfBundle
);
}
catch
(
err
){
console
.
error
(
"
====>getAllAccounts 1600 fail err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
expect
(
data
[
0
].
name
).
assertEqual
(
"
account_promise_delete
"
);
expect
(
data
[
0
].
owner
).
assertEqual
(
"
com.example.actsgetallaaccounts
"
);
console
.
debug
(
"
====>delete account 1600 start====
"
);
await
appAccountManager
.
deleteAccount
(
"
account_promise_delete
"
);
console
.
debug
(
"
====>second getAllAccounts 1600 start====
"
);
try
{
var
dataDelete
=
await
appAccountManager
.
getAllAccounts
(
selfBundle
);
}
catch
(
err
){
console
.
error
(
"
====>second getAllAccounts 1600 fail err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
expect
(
dataDelete
.
length
).
assertEqual
(
0
);
console
.
debug
(
"
====>ActsGetAllAccounts_1600 end====
"
);
done
();
});
/*
* @tc.number : ActsGetAllAccounts_1700
* @tc.name : getAllAccounts callback
* @tc.desc : Get account information after adding an account with additional information and deleting an
* account
*/
it
(
'
ActsGetAllAccounts_1700
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsGetAllAccounts_1700 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat finish====
"
);
var
selfBundle
=
"
com.example.actsgetallaaccounts
"
;
appAccountManager
.
addAccount
(
"
account_callback_additional
"
,
"
account_extrainfo
"
,
(
err
)
=>
{
console
.
debug
(
"
====>add account 1700 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
appAccountManager
.
getAllAccounts
(
selfBundle
,
(
err
,
data
)
=>
{
console
.
debug
(
"
====>getAllAccounts 1700 err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>getAllAccounts 1700 data:
"
+
JSON
.
stringify
(
data
));
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
[
0
].
name
).
assertEqual
(
"
account_callback_additional
"
);
expect
(
data
[
0
].
owner
).
assertEqual
(
"
com.example.actsgetallaaccounts
"
);
appAccountManager
.
deleteAccount
(
"
account_callback_additional
"
,
(
err
)
=>
{
console
.
debug
(
"
====>delete account 1700 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
appAccountManager
.
getAllAccounts
(
selfBundle
,
(
err
,
data
)
=>
{
console
.
debug
(
"
====>getAllAccounts 1700 err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>getAllAccounts 1700 data:
"
+
JSON
.
stringify
(
data
));
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
length
).
assertEqual
(
0
);
console
.
debug
(
"
====>ActsGetAllAccounts_1700 end====
"
);
done
();
})
});
})
});
});
/*
* @tc.number : ActsGetAllAccounts_1800
* @tc.name : getAllAccounts promise
* @tc.desc : Get account information after adding an account with additional information and deleting an
* account
*/
it
(
'
ActsGetAllAccounts_1800
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsGetAllAccounts_1800 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat finish====
"
);
var
selfBundle
=
"
com.example.actsgetallaaccounts
"
;
console
.
debug
(
"
====>add account 1800 start====
"
);
await
appAccountManager
.
addAccount
(
"
account_promise_additional
"
,
"
account_extrainfo
"
);
console
.
debug
(
"
====>first getAllAccounts 1800 start====
"
);
try
{
var
data
=
await
appAccountManager
.
getAllAccounts
(
selfBundle
);
}
catch
(
err
){
console
.
error
(
"
====>getAllAccounts 1800 fail err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
console
.
debug
(
"
====>first getAllAccounts 1800 data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
[
0
].
name
).
assertEqual
(
"
account_promise_additional
"
);
expect
(
data
[
0
].
owner
).
assertEqual
(
"
com.example.actsgetallaaccounts
"
);
console
.
debug
(
"
====>delete account 1800 start====
"
);
await
appAccountManager
.
deleteAccount
(
"
account_promise_additional
"
);
console
.
debug
(
"
====>second getAllAccounts 1800 start====
"
);
try
{
var
dataDelete
=
await
appAccountManager
.
getAllAccounts
(
selfBundle
);
}
catch
(
err
){
console
.
error
(
"
====>second getAllAccounts 1800 fail err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
console
.
debug
(
"
====>second getAllAccounts 1800 data:
"
+
JSON
.
stringify
(
data
));
expect
(
dataDelete
.
length
).
assertEqual
(
0
);
console
.
debug
(
"
====>ActsGetAllAccounts_1800 end====
"
);
done
();
});
})
\ No newline at end of file
account/appaccount/actsgetallaccounts/entry/src/main/js/test/List.test.js
浏览文件 @
c6355ae3
...
...
@@ -12,4 +12,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require
(
'
./ExampleJsunit.test.js
'
)
\ No newline at end of file
require
(
'
./Getallaccounts.test.js
'
)
\ No newline at end of file
account/appaccount/actssetchecksyncenable/entry/src/main/js/test/List.test.js
浏览文件 @
c6355ae3
...
...
@@ -12,4 +12,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require
(
'
./ExampleJsunit.test.js
'
)
\ No newline at end of file
require
(
'
./Syncenable.test.js
'
)
\ No newline at end of file
account/appaccount/actssetchecksyncenable/entry/src/main/js/test/
ExampleJsunit
.test.js
→
account/appaccount/actssetchecksyncenable/entry/src/main/js/test/
Syncenable
.test.js
浏览文件 @
c6355ae3
文件已移动
account/appaccount/getallaccessibleaccounts/actsgetallaccessibleaccounts/entry/src/main/js/test/
ExampleJsunit
.test.js
→
account/appaccount/getallaccessibleaccounts/actsgetallaccessibleaccounts/entry/src/main/js/test/
Getallaccessible
.test.js
浏览文件 @
c6355ae3
...
...
@@ -17,7 +17,6 @@ import featureAbility from '@ohos.ability.featureability'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
const
TIMEOUT
=
2000
;
const
TIMEOUTEND
=
4000
;
describe
(
'
ActsGetAllAccessibleAccounts
'
,
function
()
{
/*
...
...
@@ -534,8 +533,5 @@ describe('ActsGetAllAccessibleAccounts', function () {
console
.
debug
(
"
====>ActsGetAllAccessibleAccounts_1100 end====
"
);
done
();
},
TIMEOUT
);
setTimeout
(
function
(){
console
.
debug
(
"
====>time out ActsGetAllAccessibleAccounts_1100====
"
);
},
TIMEOUTEND
);
});
})
\ No newline at end of file
account/appaccount/getallaccessibleaccounts/actsgetallaccessibleaccounts/entry/src/main/js/test/List.test.js
浏览文件 @
c6355ae3
...
...
@@ -12,4 +12,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require
(
'
./ExampleJsunit.test.js
'
)
\ No newline at end of file
require
(
'
./Getallaccessible.test.js
'
)
\ No newline at end of file
account/appaccount/getallaccessibleaccounts/actsgetallaccessiblemultiple/entry/src/main/js/test/
ExampleJsunit
.test.js
→
account/appaccount/getallaccessibleaccounts/actsgetallaccessiblemultiple/entry/src/main/js/test/
Getmultiple
.test.js
浏览文件 @
c6355ae3
...
...
@@ -17,8 +17,6 @@ import featureAbility from '@ohos.ability.featureability'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
const
TIMEOUT
=
3000
;
const
TIMEOUTEND
=
5000
;
describe
(
'
ActsGetAllAccessibleMultiple
'
,
function
()
{
beforeAll
(
async
function
(
done
)
{
console
.
debug
(
"
====>startAbility first 0100 start====
"
);
...
...
@@ -108,8 +106,5 @@ describe('ActsGetAllAccessibleMultiple', function () {
console
.
debug
(
"
====>ActsGetAllAccessibleAccounts_0100 end====
"
);
done
();
},
TIMEOUT
);
setTimeout
(
function
(){
console
.
debug
(
"
====>time out ActsGetAllAccessibleMultiple_0100====>
"
);
},
TIMEOUTEND
);
});
})
\ No newline at end of file
account/appaccount/getallaccessibleaccounts/actsgetallaccessiblemultiple/entry/src/main/js/test/List.test.js
浏览文件 @
c6355ae3
...
...
@@ -12,4 +12,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require
(
'
./ExampleJsunit.test.js
'
)
\ No newline at end of file
require
(
'
./Getmultiple.test.js
'
)
\ No newline at end of file
account/appaccount/sceneProject/actsaccountaccessibleFirst/BUILD.gn
浏览文件 @
c6355ae3
...
...
@@ -10,17 +10,20 @@
# 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
("ActsAccountAccessibleFirst") {
ohos_
hap
("ActsAccountAccessibleFirst") {
hap_profile = "./entry/src/main/config.json"
hap_name = "ActsAccountAccessibleFirst"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAccountAccessibleFirst"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
...
...
account/appaccount/sceneProject/actsaccountaccessibleSecond/BUILD.gn
浏览文件 @
c6355ae3
...
...
@@ -10,17 +10,20 @@
# 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
("ActsAccountAccessibleSecond") {
ohos_
hap
("ActsAccountAccessibleSecond") {
hap_profile = "./entry/src/main/config.json"
hap_name = "ActsAccountAccessibleSecond"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAccountAccessibleSecond"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
...
...
account/appaccount/sceneProject/actsaccountsceneaccessible/BUILD.gn
浏览文件 @
c6355ae3
...
...
@@ -10,17 +10,20 @@
# 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
("ActsAccountSceneAccessible") {
ohos_
hap
("ActsAccountSceneAccessible") {
hap_profile = "./entry/src/main/config.json"
hap_name = "ActsAccountSceneAccessible"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAccountSceneAccessible"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
...
...
account/appaccount/sceneProject/actsaccountsceneappaccess/BUILD.gn
浏览文件 @
c6355ae3
...
...
@@ -10,17 +10,20 @@
# 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
("ActsAccountSceneAppAccess") {
ohos_
hap
("ActsAccountSceneAppAccess") {
hap_profile = "./entry/src/main/config.json"
hap_name = "ActsAccountSceneAppAccess"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAccountSceneAppAccess"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
...
...
account/appaccount/sceneProject/actsaccountsceneonoff/BUILD.gn
浏览文件 @
c6355ae3
...
...
@@ -10,17 +10,20 @@
# 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
("ActsAccountSceneOnOff") {
ohos_
hap
("ActsAccountSceneOnOff") {
hap_profile = "./entry/src/main/config.json"
hap_name = "ActsAccountSceneOnOff"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAccountSceneOnOff"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
...
...
account/appaccount/sceneProject/actsaccountsceneonoff/entry/src/main/js/default/pages/index/index.js
浏览文件 @
c6355ae3
...
...
@@ -14,6 +14,14 @@
*/
import
account
from
'
@ohos.account.appAccount
'
import
commonevent
from
'
@ohos.commonevent
'
const
ACCOUNT_TEST_ONOFF_EXTRA
=
1
const
ACCOUNT_TEST_ONOFF_ASSOCIATEDDATA
=
2
const
ACCOUNT_TEST_ONOFF_CREDENTIAL
=
3
const
ACCOUNT_TEST_ONOFF_DELETE
=
4
const
ACCOUNT_TEST_ONOFF_DELETEONLY
=
5
const
ACCOUNT_TEST_ONOFF_DISABLE
=
6
const
ACCOUNT_TEST_ONOFF_DISABLEONLY
=
7
const
injectRef
=
Object
.
getPrototypeOf
(
global
)
||
global
injectRef
.
regeneratorRuntime
=
require
(
'
@babel/runtime/regenerator
'
)
...
...
@@ -29,6 +37,9 @@ export default {
var
commonEventSubscribeInfo
=
{
events
:
[
"
account_on_change
"
]
}
// The callback of the event that publishes the verification result to the test application, and unsubscribe
// the change of account information
function
publishCallback
(
err
){
console
.
debug
(
"
====>publish call back scene err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>scene off start====
"
);
...
...
@@ -36,10 +47,13 @@ export default {
console
.
debug
(
"
====>scene off finish====
"
);
});
}
// Subscribe to the callback of account information changes, verify the received account information, and send
// an event with the verification result to the test application
function
changeOnExtra
(
data
){
console
.
debug
(
"
====>receive change 0100 data:
"
+
JSON
.
stringify
(
data
));
try
{
if
(
data
[
0
].
owner
==
"
com.example.actsaccount
changeonoff
"
&&
data
[
0
].
name
==
"
changeonoff_extra
"
){
if
(
data
[
0
].
owner
==
"
com.example.actsaccount
test
"
&&
data
[
0
].
name
==
"
changeonoff_extra
"
){
var
commonEventPublishData
=
{
data
:
"
SUCCESS
"
}
...
...
@@ -58,10 +72,11 @@ export default {
commonevent
.
publish
(
"
account_on_change_extra
"
,
commonEventPublishData
,
publishCallback
);
}
}
function
changeOnAssociateData
(
data
){
console
.
debug
(
"
====>receive change 0200 data:
"
+
JSON
.
stringify
(
data
));
try
{
if
(
data
[
0
].
owner
==
"
com.example.actsaccount
changeonoff
"
&&
data
[
0
].
name
==
"
onoff_associatedata
"
){
if
(
data
[
0
].
owner
==
"
com.example.actsaccount
test
"
&&
data
[
0
].
name
==
"
onoff_associatedata
"
){
var
commonEventPublishData
=
{
data
:
"
SUCCESS
"
}
...
...
@@ -80,10 +95,11 @@ export default {
commonevent
.
publish
(
"
account_on_change_associatedata
"
,
commonEventPublishData
,
publishCallback
);
}
}
function
changeOnCredential
(
data
){
console
.
debug
(
"
====>receive change 0300 data:
"
+
JSON
.
stringify
(
data
));
try
{
if
(
data
[
0
].
owner
==
"
com.example.actsaccount
changeonoff
"
&&
data
[
0
].
name
==
"
onoff_credential
"
){
if
(
data
[
0
].
owner
==
"
com.example.actsaccount
test
"
&&
data
[
0
].
name
==
"
onoff_credential
"
){
var
commonEventPublishData
=
{
data
:
"
SUCCESS
"
}
...
...
@@ -102,10 +118,11 @@ export default {
commonevent
.
publish
(
"
account_on_change_credential
"
,
commonEventPublishData
,
publishCallback
);
}
}
function
changeOnDeleteAnother
(
data
){
console
.
debug
(
"
====>receive change 0400 data:
"
+
JSON
.
stringify
(
data
));
try
{
if
(
data
[
0
].
owner
==
"
com.example.actsaccount
changeonoff
"
&&
data
[
0
].
name
==
"
onoff_deleteFir
"
){
if
(
data
[
0
].
owner
==
"
com.example.actsaccount
test
"
&&
data
[
0
].
name
==
"
onoff_deleteFir
"
){
var
commonEventPublishData
=
{
data
:
"
SUCCESS
"
}
...
...
@@ -124,6 +141,7 @@ export default {
commonevent
.
publish
(
"
account_on_delete_another
"
,
commonEventPublishData
,
publishCallback
);
}
}
function
changeOnDelete
(
data
){
console
.
debug
(
"
====>receive change 0500 data:
"
+
JSON
.
stringify
(
data
));
try
{
...
...
@@ -146,10 +164,11 @@ export default {
commonevent
.
publish
(
"
account_on_change_delete
"
,
commonEventPublishData
,
publishCallback
);
}
}
function
changeOnDisableAnother
(
data
){
console
.
debug
(
"
====>receive change 0600 data:
"
+
JSON
.
stringify
(
data
));
try
{
if
(
data
[
0
].
owner
==
"
com.example.actsaccount
changeonoff
"
&&
data
[
0
].
name
==
"
onoff_enableFir
"
){
if
(
data
[
0
].
owner
==
"
com.example.actsaccount
test
"
&&
data
[
0
].
name
==
"
onoff_enableFir
"
){
var
commonEventPublishData
=
{
data
:
"
SUCCESS
"
}
...
...
@@ -168,6 +187,7 @@ export default {
commonevent
.
publish
(
"
account_on_disable_another
"
,
commonEventPublishData
,
publishCallback
);
}
}
function
changeOnDisable
(
data
){
console
.
debug
(
"
====>receive change 0700 data:
"
+
JSON
.
stringify
(
data
));
try
{
...
...
@@ -190,37 +210,39 @@ export default {
commonevent
.
publish
(
"
account_on_change_disable
"
,
commonEventPublishData
,
publishCallback
);
}
}
// Receive events sent by the test application to correspond to different test cases
function
subscriberCallback
(
err
,
data
){
console
.
debug
(
"
====>receive event err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>receive event data:
"
+
JSON
.
stringify
(
data
));
switch
(
data
.
code
){
case
1
:
case
ACCOUNT_TEST_ONOFF_EXTRA
:
console
.
debug
(
"
====>receive event 0100 event:
"
+
data
.
event
);
appAccountManager
.
on
(
'
change
'
,
[
"
com.example.actsaccount
changeonoff
"
],
changeOnExtra
);
appAccountManager
.
on
(
'
change
'
,
[
"
com.example.actsaccount
test
"
],
changeOnExtra
);
break
;
case
2
:
case
ACCOUNT_TEST_ONOFF_ASSOCIATEDDATA
:
console
.
debug
(
"
====>receive event 0200 event:
"
+
data
.
event
);
appAccountManager
.
on
(
'
change
'
,
[
"
com.example.actsaccount
changeonoff
"
],
changeOnAssociateData
);
appAccountManager
.
on
(
'
change
'
,
[
"
com.example.actsaccount
test
"
],
changeOnAssociateData
);
break
;
case
3
:
case
ACCOUNT_TEST_ONOFF_CREDENTIAL
:
console
.
debug
(
"
====>receive event 0300 event:
"
+
data
.
event
);
appAccountManager
.
on
(
'
change
'
,
[
"
com.example.actsaccount
changeonoff
"
],
changeOnCredential
);
appAccountManager
.
on
(
'
change
'
,
[
"
com.example.actsaccount
test
"
],
changeOnCredential
);
break
;
case
4
:
case
ACCOUNT_TEST_ONOFF_DELETE
:
console
.
debug
(
"
====>receive event 0400 event:
"
+
data
.
event
);
appAccountManager
.
on
(
'
change
'
,
[
"
com.example.actsaccount
changeonoff
"
],
changeOnDeleteAnother
);
appAccountManager
.
on
(
'
change
'
,
[
"
com.example.actsaccount
test
"
],
changeOnDeleteAnother
);
break
;
case
5
:
case
ACCOUNT_TEST_ONOFF_DELETEONLY
:
console
.
debug
(
"
====>receive event 0500 event:
"
+
data
.
event
);
appAccountManager
.
on
(
'
change
'
,
[
"
com.example.actsaccount
changeonoff
"
],
changeOnDelete
);
appAccountManager
.
on
(
'
change
'
,
[
"
com.example.actsaccount
test
"
],
changeOnDelete
);
break
;
case
6
:
case
ACCOUNT_TEST_ONOFF_DISABLE
:
console
.
debug
(
"
====>receive event 0600 event:
"
+
data
.
event
);
appAccountManager
.
on
(
'
change
'
,
[
"
com.example.actsaccount
changeonoff
"
],
changeOnDisableAnother
);
appAccountManager
.
on
(
'
change
'
,
[
"
com.example.actsaccount
test
"
],
changeOnDisableAnother
);
break
;
case
7
:
case
ACCOUNT_TEST_ONOFF_DISABLEONLY
:
console
.
debug
(
"
====>receive event 0700 event:
"
+
data
.
event
);
appAccountManager
.
on
(
'
change
'
,
[
"
com.example.actsaccount
changeonoff
"
],
changeOnDisable
);
appAccountManager
.
on
(
'
change
'
,
[
"
com.example.actsaccount
test
"
],
changeOnDisable
);
break
;
default
:
console
.
debug
(
"
====>receive event enter default====
"
);
...
...
account/appaccount/sceneProject/actsscenegetallaccounts/BUILD.gn
浏览文件 @
c6355ae3
...
...
@@ -10,17 +10,20 @@
# 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
("ActsSceneGetAllAccounts") {
ohos_
hap
("ActsSceneGetAllAccounts") {
hap_profile = "./entry/src/main/config.json"
hap_name = "ActsSceneGetAllAccounts"
subsystem_name = XTS_SUITENAME
final_hap_path =
"${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap"
testonly = true
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsSceneGetAllAccounts"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录