Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
8c867866
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看板
未验证
提交
8c867866
编写于
2月 14, 2022
作者:
O
openharmony_ci
提交者:
Gitee
2月 14, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1887 Change signture and add limit test
Merge pull request !1887 from 高曦/master_account_0211
上级
13985dad
9dc0c5c3
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
661 addition
and
33 deletion
+661
-33
account/osaccount/actsosaccountsystemtest/entry/src/main/js/default/pages/index/index.js
...systemtest/entry/src/main/js/default/pages/index/index.js
+1
-1
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Activate.test.js
...accountsystemtest/entry/src/main/js/test/Activate.test.js
+1
-2
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Create.test.js
...osaccountsystemtest/entry/src/main/js/test/Create.test.js
+5
-4
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Limit.test.js
...sosaccountsystemtest/entry/src/main/js/test/Limit.test.js
+627
-0
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/List.test.js
...tsosaccountsystemtest/entry/src/main/js/test/List.test.js
+2
-1
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Photo.test.js
...sosaccountsystemtest/entry/src/main/js/test/Photo.test.js
+1
-1
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Query.test.js
...sosaccountsystemtest/entry/src/main/js/test/Query.test.js
+8
-8
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Set.test.js
...ctsosaccountsystemtest/entry/src/main/js/test/Set.test.js
+2
-2
account/osaccount/actsosaccountsystemtest/signature/openharmony_sx.p7b
...ount/actsosaccountsystemtest/signature/openharmony_sx.p7b
+0
-0
account/osaccount/actsosaccountthirdpartytest/entry/src/main/js/default/pages/index/index.js
...dpartytest/entry/src/main/js/default/pages/index/index.js
+1
-1
account/osaccount/actsosaccountthirdpartytest/entry/src/main/js/test/OsAccountGet.test.js
...hirdpartytest/entry/src/main/js/test/OsAccountGet.test.js
+9
-9
account/osaccount/actsosaccountthirdpartytest/entry/src/main/js/test/OsAccountIs.test.js
...thirdpartytest/entry/src/main/js/test/OsAccountIs.test.js
+4
-4
account/osaccount/actsosaccountthirdpartytest/signature/openharmony_sx.p7b
.../actsosaccountthirdpartytest/signature/openharmony_sx.p7b
+0
-0
未找到文件。
account/osaccount/actsosaccountsystemtest/entry/src/main/js/default/pages/index/index.js
浏览文件 @
8c867866
...
...
@@ -35,7 +35,7 @@ export default {
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
this
.
timeout
=
8
000
;
this
.
timeout
=
30
000
;
configService
.
setConfig
(
this
)
require
(
'
../../../test/List.test
'
)
...
...
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Activate.test.js
浏览文件 @
8c867866
...
...
@@ -16,7 +16,7 @@ import osaccount from '@ohos.account.osAccount'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
const
TIMEOUT
=
1000
;
const
ERR_OSACCOUNT_KIT_ACTIVATE_OS_ACCOUNT_ERROR
=
458757
4
;
const
ERR_OSACCOUNT_KIT_ACTIVATE_OS_ACCOUNT_ERROR
=
458757
1
;
describe
(
'
ActsOsAccountSystemTest
'
,
function
()
{
/*
...
...
@@ -161,7 +161,6 @@ describe('ActsOsAccountSystemTest', function () {
var
isActiveHandred
=
await
osAccountManager
.
isOsAccountActived
(
100
);
console
.
debug
(
"
====>localId: 100 isOsAccountActived:
"
+
isActiveHandred
);
expect
(
isActiveHandred
).
assertFalse
();
await
osAccountManager
.
activateOsAccount
(
100
);
await
osAccountManager
.
removeOsAccount
(
osLocalId
);
console
.
debug
(
"
====>ActsOsAccountActivate_0400 end====
"
);
done
();
...
...
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Create.test.js
浏览文件 @
8c867866
...
...
@@ -15,10 +15,10 @@
import
osaccount
from
'
@ohos.account.osaccount
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
const
ERR_OS_ACCOUNT_KIT_CREATE_OS_ACCOUNT_ERROR
=
458752
6
;
const
ERR_OSACCOUNT_KIT_REMOVE_OSACCOUNT_ERROR
=
45875
32
;
const
ERR_OSACCOUNT_KIT_LOCAL_NAME_EMPTY_ERROR
=
45875
81
;
const
ERR_OSACCOUNT_KIT_CANNOT_DELETE_ID_ERROR
=
458758
4
;
const
ERR_OS_ACCOUNT_KIT_CREATE_OS_ACCOUNT_ERROR
=
458752
3
;
const
ERR_OSACCOUNT_KIT_REMOVE_OSACCOUNT_ERROR
=
45875
29
;
const
ERR_OSACCOUNT_KIT_LOCAL_NAME_EMPTY_ERROR
=
45875
78
;
const
ERR_OSACCOUNT_KIT_CANNOT_DELETE_ID_ERROR
=
458758
1
;
describe
(
'
ActsOsAccountSystemTest
'
,
function
()
{
/*
...
...
@@ -605,6 +605,7 @@ describe('ActsOsAccountSystemTest', function () {
console
.
debug
(
"
====>second createOsAccount OsAccountInfo:
"
+
JSON
.
stringify
(
accountInfoSec
));
var
localIdSec
=
accountInfoSec
.
localId
;
var
serialNumSec
=
accountInfoSec
.
serialNumber
;
await
osAccountManager
.
removeOsAccount
(
localIdSec
);
console
.
debug
(
"
====>first create localId:
"
+
localIdFir
+
"
second create localId:
"
+
localIdSec
);
console
.
debug
(
"
====>first create serialNumber:
"
+
serialNumFir
+
"
second serialNumber:
"
+
serialNumSec
);
expect
(
localIdFir
).
assertEqual
(
localIdSec
);
...
...
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Limit.test.js
0 → 100755
浏览文件 @
8c867866
/*
* 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
NAMELIMIT
=
1024
;
const
TIMEOUT
=
1000
;
const
EACHTIMEOUT
=
3000
;
const
ERR_OSACCOUNT_KIT_LOCAL_NAME_OUTFLOW_ERROR
=
4587577
;
const
ERR_OSACCOUNT_KIT_SET_OS_ACCOUNT_PROFILE_PHOTO_ERROR
=
4587563
;
describe
(
'
ActsOsAccountSystemTest
'
,
function
()
{
function
sleep
(
delay
)
{
var
start
=
(
new
Date
()).
getTime
();
while
((
new
Date
()).
getTime
()
-
start
<
delay
)
{
continue
;
}
}
beforeEach
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeEach enter====
"
);
sleep
(
EACHTIMEOUT
);
done
();
})
/*
* @tc.number : ActsOsAccountLimit_0100
* @tc.name : Subscribe and unsubscribing local multi-user
* @tc.desc : subscription name exceeds the length limit of 1024 characters
*/
it
(
'
ActsOsAccountLimit_0100
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountLimit_0100 start====
"
);
var
nameLimit
=
""
;
for
(
var
i
=
0
;
i
<
NAMELIMIT
+
1
;
i
++
){
nameLimit
+=
'
t
'
;
}
var
localId
;
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
function
onCallback
(
receiveLocalId
){
console
.
debug
(
"
====>receive localId:
"
+
receiveLocalId
);
if
(
receiveLocalId
==
localId
){
console
.
debug
(
"
====> wrongly received localId:
"
+
localId
+
"
after unsubscribing
"
);
expect
().
assertFail
();
done
();
}
}
osAccountManager
.
on
(
"
activating
"
,
nameLimit
,
onCallback
);
sleep
(
TIMEOUT
);
osAccountManager
.
createOsAccount
(
"
aaa
"
,
osaccount
.
OsAccountType
.
NORMAL
,
(
err
,
info
)
=>
{
console
.
debug
(
"
====>createOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>createOsAccount info:
"
+
JSON
.
stringify
(
info
));
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
info
.
localName
).
assertEqual
(
"
aaa
"
);
localId
=
info
.
localId
;
osAccountManager
.
activateOsAccount
(
localId
,
(
err
)
=>
{
console
.
debug
(
"
====>activateOsAccount err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
sleep
(
TIMEOUT
);
setTimeout
(()
=>
{
osAccountManager
.
removeOsAccount
(
localId
,
(
err
)
=>
{
console
.
debug
(
"
====>remove localId
"
+
localId
+
"
err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
console
.
debug
(
"
====>ActsOsAccountLimit_0100 end====
"
);
done
();
})
},
TIMEOUT
)
})
})
});
/*
* @tc.number : ActsOsAccountLimit_0200
* @tc.name : Subscribe and unsubscribing local multi-user
* @tc.desc : subscription name exceeds the length limit of 1024 characters
*/
it
(
'
ActsOsAccountLimit_0200
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountLimit_0200 start====
"
);
var
nameLimit
=
""
;
for
(
var
i
=
0
;
i
<
NAMELIMIT
+
1
;
i
++
){
nameLimit
+=
'
t
'
;
}
var
localId
;
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
function
onCallback
(
receiveLocalId
){
console
.
debug
(
"
====>receive localId:
"
+
receiveLocalId
);
if
(
receiveLocalId
==
localId
){
console
.
debug
(
"
====> wrongly received localId:
"
+
localId
+
"
after unsubscribing
"
);
expect
().
assertFail
();
done
();
}
}
osAccountManager
.
on
(
"
activate
"
,
nameLimit
,
onCallback
);
sleep
(
TIMEOUT
);
osAccountManager
.
createOsAccount
(
"
aaa
"
,
osaccount
.
OsAccountType
.
NORMAL
,
(
err
,
info
)
=>
{
console
.
debug
(
"
====>createOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>createOsAccount info:
"
+
JSON
.
stringify
(
info
));
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
info
.
localName
).
assertEqual
(
"
aaa
"
);
localId
=
info
.
localId
;
osAccountManager
.
activateOsAccount
(
localId
,
(
err
)
=>
{
console
.
debug
(
"
====>activateOsAccount err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
sleep
(
TIMEOUT
);
setTimeout
(()
=>
{
osAccountManager
.
removeOsAccount
(
localId
,
(
err
)
=>
{
console
.
debug
(
"
====>removeOsAccount err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
console
.
debug
(
"
====>ActsOsAccountLimit_0200 end====
"
);
done
();
})
},
TIMEOUT
)
})
})
});
/*
* @tc.number : ActsOsAccountLimit_0300
* @tc.name : Subscribe and unsubscribing local multi-user
* @tc.desc : subscription name length is 1024 characters
*/
it
(
'
ActsOsAccountLimit_0300
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountLimit_0300 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
var
localId
;
var
activatingSign
=
false
;
var
nameLimit
=
""
;
for
(
var
i
=
0
;
i
<
NAMELIMIT
;
i
++
){
nameLimit
+=
'
t
'
;
}
console
.
debug
(
"
====>get AccountManager finish====
"
);
function
onCallback
(
receiveLocalId
){
console
.
debug
(
"
====>receive localId:
"
+
receiveLocalId
);
if
(
receiveLocalId
==
localId
){
osAccountManager
.
off
(
"
activating
"
,
nameLimit
,
offCallback
);
}
}
function
onActivateCallback
(
receiveId
){
console
.
debug
(
"
====>onActivateCallback receive localId:
"
+
receiveId
);
if
(
receiveId
==
localId
){
osAccountManager
.
off
(
"
activate
"
,
nameLimit
,
offActivateCallback
);
}
}
function
removeCallback
(
err
){
console
.
debug
(
"
====>remove localId:
"
+
localId
+
"
err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
console
.
debug
(
"
====>the activating sign is:
"
+
activatingSign
);
expect
(
activatingSign
).
assertTrue
();
console
.
debug
(
"
====>ActsOsAccountLimit_0300 end====
"
);
done
();
}
function
offCallback
(){
console
.
debug
(
"
====>off enter
"
)
activatingSign
=
true
;
}
function
offActivateCallback
(){
console
.
debug
(
"
====>offActivateCallback enter
"
)
sleep
(
TIMEOUT
);
osAccountManager
.
removeOsAccount
(
localId
,
removeCallback
);
}
console
.
debug
(
"
====>on activating start====
"
);
osAccountManager
.
on
(
"
activating
"
,
nameLimit
,
onCallback
);
console
.
debug
(
"
====>on activate start====
"
);
osAccountManager
.
on
(
"
activate
"
,
nameLimit
,
onActivateCallback
);
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 : ActsOsAccountLimit_0400
* @tc.name : Subscribe and unsubscribing local multi-user
* @tc.desc : subscription name length is 1024 characters
*/
it
(
'
ActsOsAccountLimit_0400
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountLimit_0400 start====
"
);
var
nameLimit
=
""
;
for
(
var
i
=
0
;
i
<
NAMELIMIT
;
i
++
){
nameLimit
+=
'
t
'
;
}
var
localId
;
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
function
onCallback
(
receiveLocalId
){
console
.
debug
(
"
====>on receive localId:
"
+
receiveLocalId
);
if
(
receiveLocalId
==
localId
){
osAccountManager
.
off
(
"
activate
"
,
nameLimit
,
offCallback
);
}
}
function
offCallback
(
receiveLocalId
){
console
.
debug
(
"
====>off receive localId:
"
+
receiveLocalId
);
osAccountManager
.
removeOsAccount
(
localId
,
(
err
)
=>
{
console
.
debug
(
"
====>removeOsAccount err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
console
.
debug
(
"
====>ActsOsAccountLimit_0400 end====
"
);
done
();
})
}
osAccountManager
.
on
(
"
activate
"
,
nameLimit
,
onCallback
);
sleep
(
TIMEOUT
);
osAccountManager
.
createOsAccount
(
"
aaa
"
,
osaccount
.
OsAccountType
.
NORMAL
,
(
err
,
info
)
=>
{
console
.
debug
(
"
====>createOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>createOsAccount info:
"
+
JSON
.
stringify
(
info
));
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
info
.
localName
).
assertEqual
(
"
aaa
"
);
localId
=
info
.
localId
;
osAccountManager
.
activateOsAccount
(
localId
,
(
err
)
=>
{
console
.
debug
(
"
====>activateOsAccount err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
})
})
});
/*
* @tc.number : ActsOsAccountLimit_0500
* @tc.name : setOsAccountName callback
* @tc.desc : create name length is 1024 characters
*/
it
(
'
ActsOsAccountLimit_0500
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountLimit_0500 start====
"
);
var
nameLimit
=
""
;
for
(
var
i
=
0
;
i
<
NAMELIMIT
+
1
;
i
++
){
nameLimit
+=
'
t
'
;
}
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
osAccountManager
.
createOsAccount
(
"
aaa
"
,
osaccount
.
OsAccountType
.
NORMAL
,
(
err
,
info
)
=>
{
console
.
debug
(
"
====>createOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>createOsAccount info:
"
+
JSON
.
stringify
(
info
));
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
info
.
localName
).
assertEqual
(
"
aaa
"
);
var
localId
=
info
.
localId
;
osAccountManager
.
setOsAccountName
(
localId
,
nameLimit
,
(
err
)
=>
{
console
.
debug
(
"
====>setOsAccountName err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_LOCAL_NAME_OUTFLOW_ERROR
);
osAccountManager
.
removeOsAccount
(
localId
,
(
err
)
=>
{
console
.
debug
(
"
====>removeOsAccount
"
+
localId
+
"
err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
console
.
debug
(
"
====>ActsOsAccountLimit_0500 end====
"
);
done
();
})
})
})
});
/*
* @tc.number : ActsOsAccountLimit_0600
* @tc.name : setOsAccountName promise
* @tc.desc : create name length is 1024 characters
*/
it
(
'
ActsOsAccountLimit_0600
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountLimit_0600 start====
"
);
var
nameLimit
=
""
;
for
(
var
i
=
0
;
i
<
NAMELIMIT
+
1
;
i
++
){
nameLimit
+=
'
t
'
;
}
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
info
=
await
osAccountManager
.
createOsAccount
(
"
aaa
"
,
osaccount
.
OsAccountType
.
NORMAL
);
console
.
debug
(
"
====>createOsAccount info:
"
+
JSON
.
stringify
(
info
));
expect
(
info
.
localName
).
assertEqual
(
"
aaa
"
);
var
localId
=
info
.
localId
;
try
{
await
osAccountManager
.
setOsAccountName
(
localId
,
nameLimit
);
console
.
debug
(
"
====>setOsAccountName finish====
"
);
}
catch
(
err
){
console
.
debug
(
"
====>setOsAccountName err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_LOCAL_NAME_OUTFLOW_ERROR
);
await
osAccountManager
.
removeOsAccount
(
localId
);
console
.
debug
(
"
====>removeOsAccount
"
+
localId
+
"
finish
"
);
console
.
debug
(
"
====>ActsOsAccountLimit_0600 end====
"
);
done
();
}
});
/*
* @tc.number : ActsOsAccountLimit_0700
* @tc.name : setOsAccountName callback
* @tc.desc : set the length of the profile photo to exceed the limit of 4096 characters
*/
it
(
'
ActsOsAccountLimit_0700
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountLimit_0700 start====
"
);
var
nameLimit
=
""
;
for
(
var
i
=
0
;
i
<
NAMELIMIT
;
i
++
){
nameLimit
+=
'
t
'
;
}
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
osAccountManager
.
createOsAccount
(
"
aaa
"
,
osaccount
.
OsAccountType
.
NORMAL
,
(
err
,
info
)
=>
{
console
.
debug
(
"
====>createOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>createOsAccount info:
"
+
JSON
.
stringify
(
info
));
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
info
.
localName
).
assertEqual
(
"
aaa
"
);
var
localId
=
info
.
localId
;
osAccountManager
.
setOsAccountName
(
localId
,
nameLimit
,
(
err
)
=>
{
console
.
debug
(
"
====>setOsAccountName err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
osAccountManager
.
removeOsAccount
(
localId
,
(
err
)
=>
{
console
.
debug
(
"
====>removeOsAccount
"
+
localId
+
"
err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
console
.
debug
(
"
====>ActsOsAccountLimit_0700 end====
"
);
done
();
})
})
})
});
/*
* @tc.number : ActsOsAccountLimit_0800
* @tc.name : setOsAccountName promise
* @tc.desc : set the length of the profile photo to exceed the limit of 4096 characters
*/
it
(
'
ActsOsAccountLimit_0800
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountLimit_0800 start====
"
);
var
nameLimit
=
""
;
for
(
var
i
=
0
;
i
<
NAMELIMIT
;
i
++
){
nameLimit
+=
'
t
'
;
}
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
info
=
await
osAccountManager
.
createOsAccount
(
"
aaa
"
,
osaccount
.
OsAccountType
.
NORMAL
);
console
.
debug
(
"
====>createOsAccount info:
"
+
JSON
.
stringify
(
info
));
expect
(
info
.
localName
).
assertEqual
(
"
aaa
"
);
var
localId
=
info
.
localId
;
try
{
await
osAccountManager
.
setOsAccountName
(
localId
,
nameLimit
);
}
catch
(
err
){
console
.
debug
(
"
====>setOsAccountName err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
await
osAccountManager
.
removeOsAccount
(
localId
);
console
.
debug
(
"
====>ActsOsAccountLimit_0800 end====
"
);
done
();
});
/*
* @tc.number : ActsOsAccountLimit_0900
* @tc.name : setOsAccountProfilePhoto callback
* @tc.desc : set the length of the profile photo to exceed the limit of 4096 characters
*/
it
(
'
ActsOsAccountLimit_0900
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountLimit_0900 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
photo
=
"
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA8AAAAIcCAIAAAC2P1AsAAAAAXNSR0IArs4c6QAAAARnQU1BAA
"
+
"
Cxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAx6SURBVHhe7d0hbFR3HMDxY4rKSkggWTMQLMEUtYppqgZiCZYlrSwJDk3mlrQSBJZkYq
"
+
"
gVgV1RrZmogVRAAvJk67rr9VoqVug3Gekon08vef/33tV/88/v3ju3vrs+OMbble9v3dte2d2ae33x7pULf08uH1jYWn803F+Ov3n+9urGgy
"
+
"
vjbx659TnMjv4AAOA0fDM5nsD15c313Y3xZ+v25Nq+qb9+Pz8YDH+8OXj75/Sos2//9BnrGQAATtGxO9Bri7NLj/eXO/dXhy/mj9+Bfj5zY3
"
+
"
56fLrzdO7aby/Hd4/64f2ztXeXJif/ATvQAACclpONcEwu/Kup/Wi+vrz55OqFG/NTk9r+nFMcAhoAgNNyohGOtcXZG+f2PzNrz2cO1rO/Ph
"
+
"
9F9szBlvP5pw+nBwvv7lzZPwUAgDPokwE9vTR38c3ouLC1vnq4ozxcORiDfrN5fnwcDDanX7wcrhzuOj8+7OyZtcklAAD44n16B/r6z8PLo8
"
+
"
MoiOen96/sVfW5mT/Gq8vXhveXx9F87f2To8Meo+A++MXhRydAAADgS3JcQE89nZu9dW/v2Rq/LG3PPdpP4Y2Vheml+cHKpIw3HtwcXFraun
"
+
"
N18j8AAHDmHRfQ23fWNp4t7+wtX1+8ezD0PH4ux/TSwemNxcM9aQAA+Cqc4EeE3717Mp7EOPLs5537r8ab0B95zsaHGei93xoCAMDZcIKAHt
"
+
"
l78sbM6+XNlYXRyXDl1fDFlU9l8YcZ6L1JDwAAOBuODei1xfEM9MJwbvyelNurG0+Wtif39vakN799aIQDAICvzsdepPK/5UUqAACclpONcA
"
+
"
AAAGMCGgAAgnO7u7uTJQAA8Cl2oAEAIBDQAAAQ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AEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABg
"
+
"
CAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABgCAQE
"
+
"
ADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAAnNhg8A/kgOxh0ol1ZgAAAABJRU
"
+
"
5ErkJggg==
"
osAccountManager
.
createOsAccount
(
"
aaa
"
,
osaccount
.
OsAccountType
.
NORMAL
,
(
err
,
info
)
=>
{
console
.
debug
(
"
====>createOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>createOsAccount info:
"
+
JSON
.
stringify
(
info
));
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
info
.
localName
).
assertEqual
(
"
aaa
"
);
var
localId
=
info
.
localId
;
osAccountManager
.
setOsAccountProfilePhoto
(
localId
,
photo
,
(
err
)
=>
{
console
.
debug
(
"
====>setOsAccountProfilePhoto err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_SET_OS_ACCOUNT_PROFILE_PHOTO_ERROR
);
osAccountManager
.
removeOsAccount
(
localId
,
(
err
)
=>
{
console
.
debug
(
"
====>removeOsAccount err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
console
.
debug
(
"
====>ActsOsAccountLimit_0900 end====
"
);
done
();
})
})
})
});
/*
* @tc.number : ActsOsAccountLimit_1000
* @tc.name : setOsAccountProfilePhoto promise
* @tc.desc : set the length of the profile photo to exceed the limit of 4096 characters
*/
it
(
'
ActsOsAccountLimit_1000
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountLimit_1000 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
photo
=
"
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA8AAAAIcCAIAAAC2P1AsAAAAAXNSR0IArs4c6QAAAARnQU1BAA
"
+
"
Cxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAx6SURBVHhe7d0hbFR3HMDxY4rKSkggWTMQLMEUtYppqgZiCZYlrSwJDk3mlrQSBJZkYq
"
+
"
gVgV1RrZmogVRAAvJk67rr9VoqVug3Gekon08vef/33tV/88/v3ju3vrs+OMbble9v3dte2d2ae33x7pULf08uH1jYWn803F+Ov3n+9urGgy
"
+
"
vjbx659TnMjv4AAOA0fDM5nsD15c313Y3xZ+v25Nq+qb9+Pz8YDH+8OXj75/Sos2//9BnrGQAATtGxO9Bri7NLj/eXO/dXhy/mj9+Bfj5zY3
"
+
"
56fLrzdO7aby/Hd4/64f2ztXeXJif/ATvQAACclpONcEwu/Kup/Wi+vrz55OqFG/NTk9r+nFMcAhoAgNNyohGOtcXZG+f2PzNrz2cO1rO/Ph
"
+
"
9F9szBlvP5pw+nBwvv7lzZPwUAgDPokwE9vTR38c3ouLC1vnq4ozxcORiDfrN5fnwcDDanX7wcrhzuOj8+7OyZtcklAAD44n16B/r6z8PLo8
"
+
"
MoiOen96/sVfW5mT/Gq8vXhveXx9F87f2To8Meo+A++MXhRydAAADgS3JcQE89nZu9dW/v2Rq/LG3PPdpP4Y2Vheml+cHKpIw3HtwcXFraun
"
+
"
N18j8AAHDmHRfQ23fWNp4t7+wtX1+8ezD0PH4ux/TSwemNxcM9aQAA+Cqc4EeE3717Mp7EOPLs5537r8ab0B95zsaHGei93xoCAMDZcIKAHt
"
+
"
l78sbM6+XNlYXRyXDl1fDFlU9l8YcZ6L1JDwAAOBuODei1xfEM9MJwbvyelNurG0+Wtif39vakN799aIQDAICvzsdepPK/5UUqAACclpONcA
"
+
"
AAAGMCGgAAgnO7u7uTJQ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0AAI
"
+
"
GABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABg
"
+
"
CAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABgCAQE
"
+
"
ADAEAgoAEAIBDQAAAQCGgAAAgENAAABAIaAAACAQ0AAIGABgCAQEADAEAgoAEAIBDQAAAQCGgAAAgENAAAnNhg8A/kgOxh0ol1ZgAAAABJRU
"
+
"
5ErkJggg==
"
var
info
=
await
osAccountManager
.
createOsAccount
(
"
aaa
"
,
osaccount
.
OsAccountType
.
NORMAL
);
console
.
debug
(
"
====>createOsAccount info:
"
+
JSON
.
stringify
(
info
));
expect
(
info
.
localName
).
assertEqual
(
"
aaa
"
);
var
localId
=
info
.
localId
;
try
{
await
osAccountManager
.
setOsAccountProfilePhoto
(
localId
,
photo
);
}
catch
(
err
){
console
.
debug
(
"
====>setOsAccountProfilePhoto err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_SET_OS_ACCOUNT_PROFILE_PHOTO_ERROR
);
await
osAccountManager
.
removeOsAccount
(
localId
);
console
.
debug
(
"
====>ActsOsAccountLimit_1000 end====
"
);
done
();
}
});
/*
* @tc.number : ActsOsAccountLimit_1100
* @tc.name : setOsAccountProfilePhoto callback
* @tc.desc : set the length of the profile photo to exceed the limit of 4096 characters
*/
it
(
'
ActsOsAccountLimit_1100
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountLimit_1100 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
photo
=
"
data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAAdCAYAAADl208VAAAAAXNSR0IArs4c6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1tkSQ+Jc5DYDwYKL9gsqTx2Pi3h/k/0I9O/pz1o5M/Z/3o5M9Uv+DvTQM1EO6eSn0AAAAASUVORK5CYII=
"
osAccountManager
.
createOsAccount
(
"
aaa
"
,
osaccount
.
OsAccountType
.
NORMAL
,
(
err
,
info
)
=>
{
console
.
debug
(
"
====>createOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>createOsAccount info:
"
+
JSON
.
stringify
(
info
));
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
info
.
localName
).
assertEqual
(
"
aaa
"
);
var
localId
=
info
.
localId
;
osAccountManager
.
setOsAccountProfilePhoto
(
localId
,
photo
,
(
err
)
=>
{
console
.
debug
(
"
====>setOsAccountProfilePhoto err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_SET_OS_ACCOUNT_PROFILE_PHOTO_ERROR
);
osAccountManager
.
removeOsAccount
(
localId
,
(
err
)
=>
{
console
.
debug
(
"
====>removeOsAccount err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
console
.
debug
(
"
====>ActsOsAccountLimit_1100 end====
"
);
done
();
})
})
})
});
/*
* @tc.number : ActsOsAccountLimit_1200
* @tc.name : setOsAccountProfilePhoto promise
* @tc.desc : set the length of the profile photo to exceed the limit of 4096 characters
*/
it
(
'
ActsOsAccountLimit_1200
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsOsAccountLimit_1200 start====
"
);
var
osAccountManager
=
osaccount
.
getAccountManager
();
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
photo
=
"
data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAAdCAYAAADl208VAAAAAXNSR0IArs4c6QAAAARnQU1BA
"
+
"
ACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAvESURBVFhH3Zb3c1TXGYbzD6RMJplEfdV2tasuVFZo1VcNUEMCgST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Account
(
"
aaa
"
,
osaccount
.
OsAccountType
.
NORMAL
);
console
.
debug
(
"
====>createOsAccount info:
"
+
JSON
.
stringify
(
info
));
expect
(
info
.
localName
).
assertEqual
(
"
aaa
"
);
var
localId
=
info
.
localId
;
try
{
await
osAccountManager
.
setOsAccountProfilePhoto
(
localId
,
photo
);
}
catch
(
err
){
console
.
debug
(
"
====>setOsAccountProfilePhoto err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_OSACCOUNT_KIT_SET_OS_ACCOUNT_PROFILE_PHOTO_ERROR
);
await
osAccountManager
.
removeOsAccount
(
localId
);
console
.
debug
(
"
====>ActsOsAccountLimit_1200 end====
"
);
done
();
}
});
})
\ No newline at end of file
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/List.test.js
浏览文件 @
8c867866
...
...
@@ -18,4 +18,5 @@ 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
require
(
'
./Create.test.js
'
)
require
(
'
./Limit.test.js
'
)
\ No newline at end of file
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Photo.test.js
浏览文件 @
8c867866
...
...
@@ -16,7 +16,7 @@ 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
=
458755
8
;
const
ERR_OSACCOUNT_KIT_GET_OS_ACCOUNT_PROFILE_PHOTO_ERROR
=
458755
5
;
describe
(
'
ActsOsAccountSystemTest
'
,
function
()
{
/*
...
...
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Query.test.js
浏览文件 @
8c867866
...
...
@@ -17,7 +17,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
const
TIMEOUT
=
1000
;
const
OSACCOUNTMAXNUMBER
=
999
;
const
ERR_OSACCOUNT_KIT_QUERY_OS_ACCOUNT_BY_ID_ERROR
=
458755
6
;
const
ERR_OSACCOUNT_KIT_QUERY_OS_ACCOUNT_BY_ID_ERROR
=
458755
3
;
describe
(
'
ActsOsAccountSystemTest
'
,
function
()
{
/*
...
...
@@ -377,7 +377,7 @@ describe('ActsOsAccountSystemTest', function () {
/*
* @tc.number : ActsOsAccountQuery_1600
* @tc.name : queryMaxOsAccountNumber
callback
* @tc.name : queryMaxOsAccountNumber
promise
* @tc.desc : Query the maximum number of users that can be created on the device
*/
it
(
'
ActsOsAccountQuery_1600
'
,
0
,
async
function
(
done
)
{
...
...
@@ -404,12 +404,12 @@ describe('ActsOsAccountSystemTest', function () {
console
.
debug
(
"
====>queryCurrentOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>queryCurrentOsAccount data:
"
+
JSON
.
stringify
(
data
));
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
data
.
localId
).
assertEqual
(
0
);
expect
(
data
.
localId
).
assertEqual
(
10
0
);
expect
(
data
.
type
.
ADMIN
).
assertEqual
(
0
);
var
serialNumberStr
=
data
.
serialNumber
.
toString
();
var
serialIntercept
=
serialNumberStr
.
substring
(
8
);
console
.
debug
(
"
====>truncate the last eight characters:
"
+
serialIntercept
);
expect
(
serialIntercept
).
assertEqual
(
"
0000000
0
"
);
expect
(
serialIntercept
).
assertEqual
(
"
0000000
1
"
);
expect
(
data
.
isCreateCompleted
).
assertTrue
();
console
.
debug
(
"
====>ActsOsAccountQuery_1700 end====
"
);
done
();
...
...
@@ -427,12 +427,12 @@ describe('ActsOsAccountSystemTest', function () {
console
.
debug
(
"
====>get os AccountManager finish====
"
);
var
data
=
await
AccountManager
.
queryCurrentOsAccount
();
console
.
debug
(
"
====>queryCurrentOsAccount data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
localId
).
assertEqual
(
0
);
expect
(
data
.
localId
).
assertEqual
(
10
0
);
expect
(
data
.
type
.
ADMIN
).
assertEqual
(
0
);
var
serialNumberStr
=
data
.
serialNumber
.
toString
();
var
serialIntercept
=
serialNumberStr
.
substring
(
8
);
console
.
debug
(
"
====>truncate the last eight characters:
"
+
serialIntercept
);
expect
(
serialIntercept
).
assertEqual
(
"
0000000
0
"
);
expect
(
serialIntercept
).
assertEqual
(
"
0000000
1
"
);
expect
(
data
.
isCreateCompleted
).
assertTrue
();
console
.
debug
(
"
====>ActsOsAccountQuery_1800 end====
"
);
done
();
...
...
@@ -462,7 +462,7 @@ describe('ActsOsAccountSystemTest', function () {
console
.
debug
(
"
====>queryCurrentOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>queryCurrentOsAccount data:
"
+
JSON
.
stringify
(
currentOsInfo
));
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
currentOsInfo
.
localId
).
assertEqual
(
0
);
expect
(
currentOsInfo
.
localId
).
assertEqual
(
10
0
);
AccountManager
.
removeOsAccount
(
createLocalId
,
(
err
)
=>
{
console
.
debug
(
"
====>remove localId:
"
+
createLocalId
+
"
err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
0
);
...
...
@@ -491,7 +491,7 @@ describe('ActsOsAccountSystemTest', function () {
await
AccountManager
.
activateOsAccount
(
createLocalId
);
var
currentOsInfo
=
await
AccountManager
.
queryCurrentOsAccount
();
console
.
debug
(
"
====>queryCurrentOsAccount:
"
+
JSON
.
stringify
(
currentOsInfo
));
expect
(
currentOsInfo
.
localId
).
assertEqual
(
0
);
expect
(
currentOsInfo
.
localId
).
assertEqual
(
10
0
);
await
AccountManager
.
removeOsAccount
(
createLocalId
);
console
.
debug
(
"
====>ActsOsAccountQuery_2000 end====
"
);
done
();
...
...
account/osaccount/actsosaccountsystemtest/entry/src/main/js/test/Set.test.js
浏览文件 @
8c867866
...
...
@@ -16,8 +16,8 @@ import osAccount from '@ohos.account.osAccount'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
const
TIMEOUT
=
1000
;
const
ERR_OSACCOUNT_KIT_SET_OS_ACCOUNT_NAME_ERROR
=
458756
4
;
const
ERR_OSACCOUNT_KIT_SET_OS_ACCOUNT_PROFILE_PHOTO_ERROR
=
458756
6
;
const
ERR_OSACCOUNT_KIT_SET_OS_ACCOUNT_NAME_ERROR
=
458756
1
;
const
ERR_OSACCOUNT_KIT_SET_OS_ACCOUNT_PROFILE_PHOTO_ERROR
=
458756
3
;
describe
(
'
ActsOsAccountSystemTest
'
,
function
()
{
/*
...
...
account/osaccount/actsosaccountsystemtest/signature/openharmony_sx.p7b
浏览文件 @
8c867866
无法预览此类型文件
account/osaccount/actsosaccountthirdpartytest/entry/src/main/js/default/pages/index/index.js
浏览文件 @
8c867866
...
...
@@ -35,7 +35,7 @@ export default {
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
this
.
timeout
=
8
000
;
this
.
timeout
=
15
000
;
configService
.
setConfig
(
this
)
require
(
'
../../../test/List.test
'
)
...
...
account/osaccount/actsosaccountthirdpartytest/entry/src/main/js/test/OsAccountGet.test.js
浏览文件 @
8c867866
...
...
@@ -16,7 +16,7 @@ import osaccount from '@ohos.account.osAccount'
import
bundle
from
'
@ohos.bundle
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
const
ERR_OS
ACCOUNT_KIT_GET_OS_ACCOUNT_LOCAL_ID_FROM_UID_ERROR
=
4587551
;
const
ERR_OS
_ACCOUNT_SERVICE_MANAGER_BAD_UID_ERR
=
4653057
;
describe
(
'
ActsOsAccountThirdPartyTest
'
,
function
()
{
/*
...
...
@@ -36,7 +36,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
console
.
debug
(
"
====>get localId err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>localId obtained by uid:
"
+
localId
);
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
localId
).
assertEqual
(
0
);
expect
(
localId
).
assertEqual
(
10
0
);
console
.
debug
(
"
====>ActsOsAccountGetIdFormUid_0100 end====
"
);
done
();
});
...
...
@@ -57,7 +57,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
console
.
debug
(
"
====>obtained uid:
"
+
uid
);
var
localId
=
await
osAccountManager
.
getOsAccountLocalIdFromUid
(
uid
);
console
.
debug
(
"
====>localId obtained by uid:
"
+
localId
);
expect
(
localId
).
assertEqual
(
0
);
expect
(
localId
).
assertEqual
(
10
0
);
console
.
debug
(
"
====>ActsOsAccountGetIdFormUid_0200 end====
"
);
done
();
});
...
...
@@ -75,7 +75,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
osAccountManager
.
getOsAccountLocalIdFromUid
(
incorrectUid
,
(
err
,
localId
)
=>
{
console
.
debug
(
"
====>get localId err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>localId obtained by uid:
"
+
localId
);
expect
(
err
.
code
).
assertEqual
(
ERR_OS
ACCOUNT_KIT_GET_OS_ACCOUNT_LOCAL_ID_FROM_UID_ERRO
R
);
expect
(
err
.
code
).
assertEqual
(
ERR_OS
_ACCOUNT_SERVICE_MANAGER_BAD_UID_ER
R
);
expect
(
localId
).
assertEqual
(
0
);
console
.
debug
(
"
====>ActsOsAccountGetIdFormUid_0300 end====
"
);
done
();
...
...
@@ -96,7 +96,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
await
osAccountManager
.
getOsAccountLocalIdFromUid
(
incorrectUid
);
}
catch
(
err
){
console
.
debug
(
"
====>get localId by uid err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_OS
ACCOUNT_KIT_GET_OS_ACCOUNT_LOCAL_ID_FROM_UID_ERRO
R
);
expect
(
err
.
code
).
assertEqual
(
ERR_OS
_ACCOUNT_SERVICE_MANAGER_BAD_UID_ER
R
);
console
.
debug
(
"
====>ActsOsAccountGetIdFormUid_0400 end====
"
);
done
();
}
...
...
@@ -115,7 +115,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
osAccountManager
.
getOsAccountLocalIdFromUid
(
incorrectUid
,
(
err
,
localId
)
=>
{
console
.
debug
(
"
====>get localId err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>localId obtained by uid:
"
+
localId
);
expect
(
err
.
code
).
assertEqual
(
ERR_OS
ACCOUNT_KIT_GET_OS_ACCOUNT_LOCAL_ID_FROM_UID_ERRO
R
);
expect
(
err
.
code
).
assertEqual
(
ERR_OS
_ACCOUNT_SERVICE_MANAGER_BAD_UID_ER
R
);
expect
(
localId
).
assertEqual
(
0
);
console
.
debug
(
"
====>ActsOsAccountGetIdFormUid_0500 end====
"
);
done
();
...
...
@@ -136,7 +136,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
await
osAccountManager
.
getOsAccountLocalIdFromUid
(
incorrectUid
);
}
catch
(
err
){
console
.
debug
(
"
====>get localId by uid err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
).
assertEqual
(
ERR_OS
ACCOUNT_KIT_GET_OS_ACCOUNT_LOCAL_ID_FROM_UID_ERRO
R
);
expect
(
err
.
code
).
assertEqual
(
ERR_OS
_ACCOUNT_SERVICE_MANAGER_BAD_UID_ER
R
);
console
.
debug
(
"
====>ActsOsAccountGetIdFormUid_0600 end====
"
);
done
();
}
...
...
@@ -155,7 +155,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
console
.
debug
(
"
====>get localId err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>localId obtained by process:
"
+
localId
);
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
localId
).
assertEqual
(
0
);
expect
(
localId
).
assertEqual
(
10
0
);
console
.
debug
(
"
====>ActsOsAccountGetIdFormProcess_0100 end====
"
);
done
();
});
...
...
@@ -172,7 +172,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
console
.
debug
(
"
====>get AccountManager finish====
"
);
var
localId
=
await
osAccountManager
.
getOsAccountLocalIdFromProcess
();
console
.
debug
(
"
====>localId obtained by process:
"
+
localId
);
expect
(
localId
).
assertEqual
(
0
);
expect
(
localId
).
assertEqual
(
10
0
);
console
.
debug
(
"
====>ActsOsAccountGetIdFormProcess_0200 end====
"
);
done
();
});
...
...
account/osaccount/actsosaccountthirdpartytest/entry/src/main/js/test/OsAccountIs.test.js
浏览文件 @
8c867866
...
...
@@ -16,8 +16,8 @@ import osAccount from '@ohos.account.osAccount'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
const
TIMEOUT
=
1000
;
const
ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_ACTIVED_ERROR
=
458754
5
;
const
ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_VERIFIED_ERROR
=
458754
8
;
const
ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_ACTIVED_ERROR
=
458754
2
;
const
ERR_OSACCOUNT_KIT_IS_OS_ACCOUNT_VERIFIED_ERROR
=
458754
5
;
describe
(
'
ActsOsAccountThirdPartyTest
'
,
function
()
{
/*
...
...
@@ -33,7 +33,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
console
.
debug
(
"
====>getDistributedVirtualDeviceId err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>getDistributedVirtualDeviceId deviceId:
"
+
deviceId
);
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
deviceId
).
assertEqual
(
"
0
"
);
expect
(
deviceId
).
assertEqual
(
""
);
console
.
debug
(
"
====>ActsOsAccountDeviceId_0100 end====
"
);
done
();
})
...
...
@@ -57,7 +57,7 @@ describe('ActsOsAccountThirdPartyTest', function () {
done
();
}
console
.
debug
(
"
====>getDistributedVirtualDeviceId:
"
+
deviceId
);
expect
(
deviceId
).
assertEqual
(
"
0
"
);
expect
(
deviceId
).
assertEqual
(
""
);
console
.
debug
(
"
====>ActsOsAccountDeviceId_0200 end====
"
);
done
();
})
...
...
account/osaccount/actsosaccountthirdpartytest/signature/openharmony_sx.p7b
100644 → 100755
浏览文件 @
8c867866
无法预览此类型文件
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录