Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
fd6169f7
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看板
提交
fd6169f7
编写于
1月 21, 2022
作者:
G
gaoxi785
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update account xts case and fix appaccount bug
Signed-off-by:
N
gaoxi785
<
gaoxi785@huawei.com
>
上级
759af0d5
变更
17
展开全部
显示空白变更内容
内联
并排
Showing
17 changed file
with
3227 addition
and
65 deletion
+3227
-65
account/appaccount/actsaccountpressure/Test.json
account/appaccount/actsaccountpressure/Test.json
+1
-1
account/appaccount/actsaccounttest/entry/src/main/js/test/NoPermission.test.js
...tsaccounttest/entry/src/main/js/test/NoPermission.test.js
+2
-2
account/appaccount/actsaccounttest/entry/src/main/js/test/OnOff.js
...ppaccount/actsaccounttest/entry/src/main/js/test/OnOff.js
+12
-9
account/osaccount/actsosaccountsystemtest/Test.json
account/osaccount/actsosaccountsystemtest/Test.json
+1
-1
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Activate.test.js
...accountsystemtest/entry/src/main/js/test/Activate.test.js
+1
-1
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Constraints.test.js
...ountsystemtest/entry/src/main/js/test/Constraints.test.js
+1093
-0
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Create.test.js
...osaccountsystemtest/entry/src/main/js/test/Create.test.js
+616
-0
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/List.test.js
...tsosaccountsystemtest/entry/src/main/js/test/List.test.js
+5
-1
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/OnOff.test.js
...sosaccountsystemtest/entry/src/main/js/test/OnOff.test.js
+57
-45
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Photo.test.js
...sosaccountsystemtest/entry/src/main/js/test/Photo.test.js
+189
-0
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Query.test.js
...sosaccountsystemtest/entry/src/main/js/test/Query.test.js
+1
-1
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Set.test.js
...ctsosaccountsystemtest/entry/src/main/js/test/Set.test.js
+774
-0
account/osaccount/actsosaccountthirdpartytest/Test.json
account/osaccount/actsosaccountthirdpartytest/Test.json
+1
-1
account/osaccount/actsosaccountthirdpartytest/entry/src/main/js/default/pages/index/index.js
...dpartytest/entry/src/main/js/default/pages/index/index.js
+1
-0
account/osaccount/actsosaccountthirdpartytest/entry/src/main/js/test/List.test.js
...accountthirdpartytest/entry/src/main/js/test/List.test.js
+2
-1
account/osaccount/actsosaccountthirdpartytest/entry/src/main/js/test/OsAccountGet.test.js
...hirdpartytest/entry/src/main/js/test/OsAccountGet.test.js
+469
-0
account/osaccount/actsosaccountthirdpartytest/entry/src/main/js/test/OsAccountIs.test.js
...thirdpartytest/entry/src/main/js/test/OsAccountIs.test.js
+2
-2
未找到文件。
account/appaccount/actsaccountpressure/Test.json
浏览文件 @
fd6169f7
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
"description"
:
"Configuration for hjunit demo Tests"
,
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"driver"
:
{
"type"
:
"JSUnitTest"
,
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"
30
00000"
,
"test-timeout"
:
"
15
00000"
,
"package"
:
"com.example.actsaccountpressure"
,
"package"
:
"com.example.actsaccountpressure"
,
"shell-timeout"
:
"60000"
"shell-timeout"
:
"60000"
},
},
...
...
account/appaccount/actsaccounttest/entry/src/main/js/test/NoPermission.test.js
浏览文件 @
fd6169f7
...
@@ -189,7 +189,7 @@ describe('ActsAccountNoPermission', function () {
...
@@ -189,7 +189,7 @@ describe('ActsAccountNoPermission', function () {
console
.
debug
(
"
====>ActsAccountNoPermission_0700 start====
"
);
console
.
debug
(
"
====>ActsAccountNoPermission_0700 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat finish====
"
);
console
.
debug
(
"
====>creat finish====
"
);
var
selfBundle
=
"
com.example.actsaccount
nopermission
"
;
var
selfBundle
=
"
com.example.actsaccount
test
"
;
appAccountManager
.
addAccount
(
"
getAll_callback_nopermission
"
,
(
err
)
=>
{
appAccountManager
.
addAccount
(
"
getAll_callback_nopermission
"
,
(
err
)
=>
{
console
.
debug
(
"
====>add account 0700 err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>add account 0700 err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
err
.
code
).
assertEqual
(
0
);
...
@@ -215,7 +215,7 @@ describe('ActsAccountNoPermission', function () {
...
@@ -215,7 +215,7 @@ describe('ActsAccountNoPermission', function () {
console
.
debug
(
"
====>ActsAccountNoPermission_0800 start====
"
);
console
.
debug
(
"
====>ActsAccountNoPermission_0800 start====
"
);
var
appAccountManager
=
account
.
createAppAccountManager
();
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat finish====
"
);
console
.
debug
(
"
====>creat finish====
"
);
var
selfBundle
=
"
com.example.actsaccount
nopermission
"
;
var
selfBundle
=
"
com.example.actsaccount
test
"
;
console
.
debug
(
"
====>add account 0800 start====
"
);
console
.
debug
(
"
====>add account 0800 start====
"
);
await
appAccountManager
.
addAccount
(
"
getAll_promise_nopermission
"
);
await
appAccountManager
.
addAccount
(
"
getAll_promise_nopermission
"
);
console
.
debug
(
"
====>getAllAccounts 0800 start====
"
);
console
.
debug
(
"
====>getAllAccounts 0800 start====
"
);
...
...
account/appaccount/actsaccounttest/entry/src/main/js/test/OnOff.js
浏览文件 @
fd6169f7
...
@@ -655,6 +655,8 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -655,6 +655,8 @@ describe('ActsAccountChangeOnOff', async function () {
expect
(
data
).
assertEqual
(
"
com.example.actsaccounttest
"
);
expect
(
data
).
assertEqual
(
"
com.example.actsaccounttest
"
);
}
}
twiceSign
=
twiceSign
+
1
;
twiceSign
=
twiceSign
+
1
;
setTimeout
(
async
function
(){
console
.
debug
(
"
====>off start====
"
);
appAccountManager
.
off
(
'
change
'
,
function
(){
appAccountManager
.
off
(
'
change
'
,
function
(){
console
.
debug
(
"
====>off ActsAccountChangeOnOff_1000 finish====
"
);
console
.
debug
(
"
====>off ActsAccountChangeOnOff_1000 finish====
"
);
appAccountManager
.
deleteAccount
(
"
onoff_twice
"
,
(
err
)
=>
{
appAccountManager
.
deleteAccount
(
"
onoff_twice
"
,
(
err
)
=>
{
...
@@ -665,6 +667,7 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -665,6 +667,7 @@ describe('ActsAccountChangeOnOff', async function () {
done
();
done
();
});
});
});
});
},
1000
)
}
}
try
{
try
{
appAccountManager
.
on
(
'
change
'
,
[
"
com.example.actsaccounttest
"
],
changeOnFirstCallback
);
appAccountManager
.
on
(
'
change
'
,
[
"
com.example.actsaccounttest
"
],
changeOnFirstCallback
);
...
...
account/osaccount/actsosaccountsystemtest/Test.json
浏览文件 @
fd6169f7
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
"description"
:
"Configuration for hjunit demo Tests"
,
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"driver"
:
{
"type"
:
"JSUnitTest"
,
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"
3
00000"
,
"test-timeout"
:
"
8
00000"
,
"package"
:
"com.example.actsosaccountsystemtest"
,
"package"
:
"com.example.actsosaccountsystemtest"
,
"shell-timeout"
:
"60000"
"shell-timeout"
:
"60000"
},
},
...
...
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Activate.test.js
浏览文件 @
fd6169f7
...
@@ -16,7 +16,7 @@ import osaccount from '@ohos.account.osAccount'
...
@@ -16,7 +16,7 @@ import osaccount from '@ohos.account.osAccount'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
const
TIMEOUT
=
1000
;
const
TIMEOUT
=
1000
;
const
ERR_OSACCOUNT_KIT_ACTIVATE_OS_ACCOUNT_ERROR
=
458757
1
;
const
ERR_OSACCOUNT_KIT_ACTIVATE_OS_ACCOUNT_ERROR
=
458757
4
;
describe
(
'
ActsOsAccountSystemTest
'
,
function
()
{
describe
(
'
ActsOsAccountSystemTest
'
,
function
()
{
/*
/*
...
...
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Constraints.test.js
0 → 100755
浏览文件 @
fd6169f7
此差异已折叠。
点击以展开。
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Create.test.js
0 → 100755
浏览文件 @
fd6169f7
此差异已折叠。
点击以展开。
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/List.test.js
浏览文件 @
fd6169f7
...
@@ -15,3 +15,7 @@
...
@@ -15,3 +15,7 @@
require
(
'
./Query.test.js
'
)
require
(
'
./Query.test.js
'
)
require
(
'
./Activate.test.js
'
)
require
(
'
./Activate.test.js
'
)
require
(
'
./OnOff.test.js
'
)
require
(
'
./OnOff.test.js
'
)
require
(
'
./Set.test.js
'
)
require
(
'
./Constraints.test.js
'
)
require
(
'
./Photo.test.js
'
)
require
(
'
./Create.test.js
'
)
\ No newline at end of file
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/OnOff.test.js
浏览文件 @
fd6169f7
...
@@ -25,47 +25,6 @@ describe('ActsOsAccountSystemTest', function () {
...
@@ -25,47 +25,6 @@ describe('ActsOsAccountSystemTest', function () {
}
}
}
}
/*
* @tc.number : ActsOsAccountOnOff_0100
* @tc.name : Subscribe and unsubscribing local multi-user
* @tc.desc : Verify that the activating type subscription can receive user switching
*/
it
(
'
ActsOsAccountOnOff_0100
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountOnOff_0100 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
var
localId
;
console
.
debug
(
"
====>get AccountManager finish====
"
);
function
onCallback
(
receiveLocalId
){
console
.
debug
(
"
====>receive localId:
"
+
receiveLocalId
);
if
(
receiveLocalId
==
localId
){
osAccountManager
.
off
(
"
activating
"
,
"
osAccountOnOffNameA
"
,
offCallback
);
}
}
function
removeCallback
(
err
){
console
.
debug
(
"
====>remove localId:
"
+
localId
+
"
err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
console
.
debug
(
"
====>ActsOsAccountOnOff_0100 end====
"
);
done
();
}
function
offCallback
(){
console
.
debug
(
"
====>off enter
"
)
osAccountManager
.
removeOsAccount
(
localId
,
removeCallback
);
}
osAccountManager
.
on
(
"
activating
"
,
"
osAccountOnOffNameA
"
,
onCallback
);
sleep
(
TIMEOUT
);
osAccountManager
.
createOsAccount
(
"
osAccountNameA
"
,
1
,
(
err
,
osAccountInfo
)
=>
{
console
.
debug
(
"
====>createOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>createOsAccount osAccountInfo:
"
+
JSON
.
stringify
(
osAccountInfo
));
localId
=
osAccountInfo
.
localId
;
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
osAccountInfo
.
localName
).
assertEqual
(
"
osAccountNameA
"
);
osAccountManager
.
activateOsAccount
(
localId
,
(
err
)
=>
{
console
.
debug
(
"
====>activateOsAccount err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
});
});
});
/*
/*
* @tc.number : ActsOsAccountOnOff_0200
* @tc.number : ActsOsAccountOnOff_0200
* @tc.name : Subscribe and unsubscribing local multi-user
* @tc.name : Subscribe and unsubscribing local multi-user
...
@@ -271,6 +230,7 @@ describe('ActsOsAccountSystemTest', function () {
...
@@ -271,6 +230,7 @@ describe('ActsOsAccountSystemTest', function () {
osAccountManager
.
activateOsAccount
(
localId
,
(
err
)
=>
{
osAccountManager
.
activateOsAccount
(
localId
,
(
err
)
=>
{
console
.
debug
(
"
====>activateOsAccount errcode:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>activateOsAccount errcode:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
err
.
code
).
assertEqual
(
0
);
sleep
(
TIMEOUT
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
osAccountManager
.
removeOsAccount
(
localId
,
(
err
)
=>
{
osAccountManager
.
removeOsAccount
(
localId
,
(
err
)
=>
{
console
.
debug
(
"
====>remove localId:
"
+
localId
+
"
err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>remove localId:
"
+
localId
+
"
err:
"
+
JSON
.
stringify
(
err
));
...
@@ -759,4 +719,56 @@ describe('ActsOsAccountSystemTest', function () {
...
@@ -759,4 +719,56 @@ describe('ActsOsAccountSystemTest', function () {
},
TIMEOUT
);
},
TIMEOUT
);
});
});
/*
* @tc.number : ActsOsAccountOnOff_2000
* @tc.name : Subscribe and unsubscribing local multi-user
* @tc.desc : Authenticate switch back after switching user subscription receives two callbacks
*/
it
(
'
ActsOsAccountOnOff_2000
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountOnOff_2000 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
var
localId
;
var
enterSign
=
0
;
var
localHundredId
=
100
;
console
.
debug
(
"
====>get AccountManager finish====
"
);
function
onCallback
(
receiveLocalId
){
console
.
debug
(
"
====>receive localId:
"
+
receiveLocalId
);
if
(
receiveLocalId
==
localId
){
enterSign
=
enterSign
+
1
;
}
if
(
receiveLocalId
==
localHundredId
){
enterSign
=
enterSign
+
1
;
osAccountManager
.
off
(
"
activate
"
,
"
osAccountOnOffNameQ
"
,
offCallback
);
}
}
function
offCallback
(){
console
.
debug
(
"
====>off enter
"
)
osAccountManager
.
removeOsAccount
(
localId
,
(
err
)
=>
{
console
.
debug
(
"
====>remove localId:
"
+
localId
+
"
err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
console
.
debug
(
"
====>the enterSign is:
"
+
enterSign
);
expect
(
enterSign
).
assertEqual
(
2
);
console
.
debug
(
"
====>ActsOsAccountOnOff_2000 end====
"
);
done
();
})
}
osAccountManager
.
on
(
"
activate
"
,
"
osAccountOnOffNameQ
"
,
onCallback
);
sleep
(
TIMEOUT
);
osAccountManager
.
createOsAccount
(
"
osAccountNameQ
"
,
1
,
(
err
,
osAccountInfo
)
=>
{
console
.
debug
(
"
====>createOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>createOsAccount osAccountInfo:
"
+
JSON
.
stringify
(
osAccountInfo
));
localId
=
osAccountInfo
.
localId
;
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
osAccountInfo
.
localName
).
assertEqual
(
"
osAccountNameQ
"
);
osAccountManager
.
activateOsAccount
(
localId
,
(
err
)
=>
{
console
.
debug
(
"
====>activateOsAccount err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
osAccountManager
.
activateOsAccount
(
localHundredId
,
(
err
)
=>
{
console
.
debug
(
"
====>activateOsAccount err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
});
});
});
})
})
})
\ No newline at end of file
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Photo.test.js
0 → 100755
浏览文件 @
fd6169f7
/*
* 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
osaccount
from
'
@ohos.account.osaccount
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
const
TIMEOUT
=
1000
;
const
ERR_OSACCOUNT_KIT_GET_OS_ACCOUNT_PROFILE_PHOTO_ERROR
=
4587558
;
describe
(
'
ActsOsAccountSystemTest
'
,
function
()
{
/*
* @tc.number : ActsOsAccountProfilePhoto_0100
* @tc.name : getOsAccountProfilePhoto callback
* @tc.desc : Verify that the newly created user photo is an empty string
*/
it
(
'
ActsOsAccountProfilePhoto_0100
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountProfilePhoto_0100 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
localId
;
osAccountManager
.
createOsAccount
(
"
osAccountNameIdSerialC
"
,
osaccount
.
OsAccountType
.
NORMAL
,
(
err
,
data
)
=>
{
console
.
debug
(
"
====>create os account err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>create os account OsAccountInfo:
"
+
JSON
.
stringify
(
data
));
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
localName
).
assertEqual
(
"
osAccountNameIdSerialC
"
);
localId
=
data
.
localId
;
osAccountManager
.
getOsAccountProfilePhoto
(
localId
,
(
err
,
photo
)
=>
{
console
.
debug
(
"
====>getOsAccountProfilePhoto err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>get photo:
"
+
photo
+
"
by localId:
"
+
localId
);
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
photo
).
assertEqual
(
""
);
osAccountManager
.
removeOsAccount
(
localId
,
(
err
)
=>
{
console
.
debug
(
"
====>remove localId:
"
+
localId
+
"
err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
console
.
debug
(
"
====>ActsOsAccountProfilePhoto_0100 end====
"
);
done
();
})
})
})
});
/*
* @tc.number : ActsOsAccountProfilePhoto_0200
* @tc.name : getOsAccountProfilePhoto promise
* @tc.desc : Verify that the newly created user photo is an empty string
*/
it
(
'
ActsOsAccountProfilePhoto_0200
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountProfilePhoto_0200 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
localId
;
var
data
=
await
osAccountManager
.
createOsAccount
(
"
osAccountNameIdSerialD
"
,
osaccount
.
OsAccountType
.
NORMAL
);
console
.
debug
(
"
====>create os account OsAccountInfo:
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
localName
).
assertEqual
(
"
osAccountNameIdSerialD
"
);
localId
=
data
.
localId
;
var
photo
=
await
osAccountManager
.
getOsAccountProfilePhoto
(
localId
);
console
.
debug
(
"
====>get photo:
"
+
photo
+
"
by localId:
"
+
localId
);
expect
(
photo
).
assertEqual
(
""
);
await
osAccountManager
.
removeOsAccount
(
localId
);
console
.
debug
(
"
====>ActsOsAccountProfilePhoto_0200 end====
"
);
done
();
});
/*
* @tc.number : ActsOsAccountProfilePhoto_0300
* @tc.name : getOsAccountProfilePhoto callback
* @tc.desc : Verify to ger the photo of the user that does not exist
*/
it
(
'
ActsOsAccountProfilePhoto_0300
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountProfilePhoto_0300 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
nonExistentId
=
1000
;
osAccountManager
.
getOsAccountProfilePhoto
(
nonExistentId
,
(
err
)
=>
{
console
.
debug
(
"
====>getOsAccountProfilePhoto err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_GET_OS_ACCOUNT_PROFILE_PHOTO_ERROR
);
console
.
debug
(
"
====>ActsOsAccountProfilePhoto_0300 end====
"
);
done
();
})
});
/*
* @tc.number : ActsOsAccountProfilePhoto_0400
* @tc.name : getOsAccountProfilePhoto promise
* @tc.desc : Verify to get the photo of the user that does not exist
*/
it
(
'
ActsOsAccountProfilePhoto_0400
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountProfilePhoto_0400 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
nonExistentId
=
1000
;
try
{
await
osAccountManager
.
getOsAccountProfilePhoto
(
nonExistentId
);
}
catch
(
err
){
console
.
debug
(
"
====>getOsAccountProfilePhoto err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_GET_OS_ACCOUNT_PROFILE_PHOTO_ERROR
);
console
.
debug
(
"
====>ActsOsAccountProfilePhoto_0400 end====
"
);
done
();
}
});
/*
* @tc.number : ActsOsAccountProfilePhoto_0500
* @tc.name : getOsAccountProfilePhoto callback
* @tc.desc : Verify to get photo with parameter type mismatch
*/
it
(
'
ActsOsAccountProfilePhoto_0500
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountProfilePhoto_0500 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
localIdStr
=
"
100
"
;
function
gerPhotoCallback
(
err
,
data
){
console
.
debug
(
"
====>getOsAccountProfilePhoto err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
osAccountManager
.
getOsAccountProfilePhoto
(
localIdStr
,
gerPhotoCallback
);
setTimeout
(()
=>
{
console
.
debug
(
"
====>ActsOsAccountProfilePhoto_0500 end====
"
);
done
();
},
TIMEOUT
);
});
/*
* @tc.number : ActsOsAccountProfilePhoto_0600
* @tc.name : getOsAccountProfilePhoto promise
* @tc.desc : Verify to the get photo with parameter type mismatch
*/
it
(
'
ActsOsAccountProfilePhoto_0600
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountProfilePhoto_0600 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
localIdStr
=
"
100
"
;
var
data
=
await
osAccountManager
.
getOsAccountProfilePhoto
(
localIdStr
);
expect
(
data
).
assertEqual
(
null
);
console
.
debug
(
"
====>ActsOsAccountProfilePhoto_0600 end====
"
);
done
();
});
/*
* @tc.number : ActsOsAccountProfilePhoto_0700
* @tc.name : getOsAccountProfilePhoto callback
* @tc.desc : Verify to get photo with parameter undefined
*/
it
(
'
ActsOsAccountProfilePhoto_0700
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountProfilePhoto_0700 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
undefinedId
=
undefined
;
function
gerPhotoCallback
(
err
,
data
){
console
.
debug
(
"
====>getOsAccountProfilePhoto err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
osAccountManager
.
getOsAccountProfilePhoto
(
undefinedId
,
gerPhotoCallback
);
setTimeout
(()
=>
{
console
.
debug
(
"
====>ActsOsAccountProfilePhoto_0700 end====
"
);
done
();
},
TIMEOUT
);
});
/*
* @tc.number : ActsOsAccountProfilePhoto_0800
* @tc.name : getOsAccountProfilePhoto promise
* @tc.desc : Verify to get photo with parameter undefined
*/
it
(
'
ActsOsAccountProfilePhoto_0800
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountProfilePhoto_0800 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
undefinedId
=
undefined
;
var
data
=
await
osAccountManager
.
getOsAccountProfilePhoto
(
undefinedId
);
expect
(
data
).
assertEqual
(
null
);
console
.
debug
(
"
====>ActsOsAccountProfilePhoto_0800 end====
"
);
done
();
});
})
\ No newline at end of file
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Query.test.js
浏览文件 @
fd6169f7
...
@@ -17,7 +17,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
...
@@ -17,7 +17,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
const
TIMEOUT
=
1000
;
const
TIMEOUT
=
1000
;
const
OSACCOUNTMAXNUMBER
=
999
;
const
OSACCOUNTMAXNUMBER
=
999
;
const
ERR_OSACCOUNT_KIT_QUERY_OS_ACCOUNT_BY_ID_ERROR
=
458755
4
;
const
ERR_OSACCOUNT_KIT_QUERY_OS_ACCOUNT_BY_ID_ERROR
=
458755
6
;
describe
(
'
ActsOsAccountSystemTest
'
,
function
()
{
describe
(
'
ActsOsAccountSystemTest
'
,
function
()
{
/*
/*
...
...
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Set.test.js
0 → 100755
浏览文件 @
fd6169f7
此差异已折叠。
点击以展开。
account/osaccount/actsosaccountthirdpartytest/Test.json
浏览文件 @
fd6169f7
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
"description"
:
"Configuration for hjunit demo Tests"
,
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"driver"
:
{
"type"
:
"JSUnitTest"
,
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"
1
00000"
,
"test-timeout"
:
"
2
00000"
,
"package"
:
"com.example.actsosaccountthirdpartytest"
,
"package"
:
"com.example.actsosaccountthirdpartytest"
,
"shell-timeout"
:
"60000"
"shell-timeout"
:
"60000"
},
},
...
...
account/osaccount/actsosaccountthirdpartytest/entry/src/main/js/default/pages/index/index.js
浏览文件 @
fd6169f7
...
@@ -35,6 +35,7 @@ export default {
...
@@ -35,6 +35,7 @@ export default {
core
.
init
()
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
const
configService
=
core
.
getDefaultService
(
'
config
'
)
this
.
timeout
=
8000
;
configService
.
setConfig
(
this
)
configService
.
setConfig
(
this
)
require
(
'
../../../test/List.test
'
)
require
(
'
../../../test/List.test
'
)
...
...
account/osaccount/actsosaccountthirdpartytest/entry/src/main/js/test/List.test.js
浏览文件 @
fd6169f7
...
@@ -13,3 +13,4 @@
...
@@ -13,3 +13,4 @@
* limitations under the License.
* limitations under the License.
*/
*/
require
(
'
./OsAccountIs.test.js
'
)
require
(
'
./OsAccountIs.test.js
'
)
require
(
'
./OsAccountGet.test.js
'
)
\ No newline at end of file
account/osaccount/actsosaccountthirdpartytest/entry/src/main/js/test/OsAccountGet.test.js
0 → 100755
浏览文件 @
fd6169f7
此差异已折叠。
点击以展开。
account/osaccount/actsosaccountthirdpartytest/entry/src/main/js/test/OsAccountIs.test.js
浏览文件 @
fd6169f7
...
@@ -16,8 +16,8 @@ import osAccount from '@ohos.account.osAccount'
...
@@ -16,8 +16,8 @@ import osAccount from '@ohos.account.osAccount'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
const
TIMEOUT
=
1000
;
const
TIMEOUT
=
1000
;
const
ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_ACTIVED_ERROR
=
458754
3
;
const
ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_ACTIVED_ERROR
=
458754
5
;
const
ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_VERIFIED_ERROR
=
458754
6
;
const
ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_VERIFIED_ERROR
=
458754
8
;
describe
(
'
ActsOsAccountThirdPartyTest
'
,
function
()
{
describe
(
'
ActsOsAccountThirdPartyTest
'
,
function
()
{
/*
/*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录