Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
ffd5691d
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看板
提交
ffd5691d
编写于
12月 17, 2021
作者:
O
openharmony_ci
提交者:
Gitee
12月 17, 2021
浏览文件
操作
浏览文件
下载
差异文件
!1378 Fix appaccount test bug
Merge pull request !1378 from blackleon/master_1215_02
上级
22795157
6c04446f
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
157 addition
and
41 deletion
+157
-41
account/appaccount/actsaccountpressure/Test.json
account/appaccount/actsaccountpressure/Test.json
+1
-1
account/appaccount/actsaccountpressure/entry/src/main/js/default/pages/index/index.js
...ntpressure/entry/src/main/js/default/pages/index/index.js
+1
-1
account/appaccount/actsaccountpressure/entry/src/main/js/test/Pressure.test.js
...tsaccountpressure/entry/src/main/js/test/Pressure.test.js
+43
-20
account/appaccount/actsaccounttest/Test.json
account/appaccount/actsaccounttest/Test.json
+1
-1
account/appaccount/actsaccounttest/entry/src/main/js/test/AppAccess.test.js
.../actsaccounttest/entry/src/main/js/test/AppAccess.test.js
+8
-1
account/appaccount/actsaccounttest/entry/src/main/js/test/AssociatedData.test.js
...accounttest/entry/src/main/js/test/AssociatedData.test.js
+8
-1
account/appaccount/actsaccounttest/entry/src/main/js/test/Credential.test.js
...actsaccounttest/entry/src/main/js/test/Credential.test.js
+8
-1
account/appaccount/actsaccounttest/entry/src/main/js/test/ExtraInfo.test.js
.../actsaccounttest/entry/src/main/js/test/ExtraInfo.test.js
+8
-1
account/appaccount/actsaccounttest/entry/src/main/js/test/OAuthToken.test.js
...actsaccounttest/entry/src/main/js/test/OAuthToken.test.js
+7
-0
account/appaccount/actsaccounttest/entry/src/main/js/test/OnOff.js
...ppaccount/actsaccounttest/entry/src/main/js/test/OnOff.js
+72
-14
未找到文件。
account/appaccount/actsaccountpressure/Test.json
浏览文件 @
ffd5691d
...
@@ -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"
:
"
2
000000"
,
"test-timeout"
:
"
3
000000"
,
"package"
:
"com.example.actsaccountpressure"
,
"package"
:
"com.example.actsaccountpressure"
,
"shell-timeout"
:
"60000"
"shell-timeout"
:
"60000"
},
},
...
...
account/appaccount/actsaccountpressure/entry/src/main/js/default/pages/index/index.js
浏览文件 @
ffd5691d
...
@@ -35,7 +35,7 @@ export default {
...
@@ -35,7 +35,7 @@ export default {
core
.
init
()
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
const
configService
=
core
.
getDefaultService
(
'
config
'
)
this
.
timeout
=
1
5
0000
;
this
.
timeout
=
1
8
0000
;
configService
.
setConfig
(
this
)
configService
.
setConfig
(
this
)
require
(
'
../../../test/List.test
'
)
require
(
'
../../../test/List.test
'
)
...
...
account/appaccount/actsaccountpressure/entry/src/main/js/test/Pressure.test.js
浏览文件 @
ffd5691d
...
@@ -113,8 +113,15 @@ describe('ActsAccountPressure', function () {
...
@@ -113,8 +113,15 @@ describe('ActsAccountPressure', function () {
console
.
debug
(
"
====>creat finish====
"
);
console
.
debug
(
"
====>creat finish====
"
);
let
flag
=
true
;
let
flag
=
true
;
let
count
=
0
;
let
count
=
0
;
for
(
let
i
=
0
;
i
<
STRESSLEVEL
;
i
++
)
{
let
STRESSNUM
;
if
(
STRESSLEVEL
>
ACCOUNTLIMIT
){
STRESSNUM
=
ACCOUNTLIMIT
;
}
else
{
STRESSNUM
=
STRESSLEVEL
;
}
for
(
let
i
=
0
;
i
<
STRESSNUM
;
i
++
)
{
let
accountName
=
"
account_pressure_callback
"
+
i
;
let
accountName
=
"
account_pressure_callback
"
+
i
;
sleep
(
TIMEOUT
);
appAccountManager
.
addAccount
(
accountName
,
(
err
)
=>
{
appAccountManager
.
addAccount
(
accountName
,
(
err
)
=>
{
console
.
debug
(
'
====>addAccount name:
'
+
accountName
);
console
.
debug
(
'
====>addAccount name:
'
+
accountName
);
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
err
.
code
).
assertEqual
(
0
);
...
@@ -124,6 +131,7 @@ describe('ActsAccountPressure', function () {
...
@@ -124,6 +131,7 @@ describe('ActsAccountPressure', function () {
flag
=
false
;
flag
=
false
;
done
();
done
();
}
}
sleep
(
TIMEOUT
);
appAccountManager
.
deleteAccount
(
accountName
,
(
err
)
=>
{
appAccountManager
.
deleteAccount
(
accountName
,
(
err
)
=>
{
console
.
debug
(
'
====>deleteAccount name:
'
+
accountName
);
console
.
debug
(
'
====>deleteAccount name:
'
+
accountName
);
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
err
.
code
).
assertEqual
(
0
);
...
@@ -141,10 +149,8 @@ describe('ActsAccountPressure', function () {
...
@@ -141,10 +149,8 @@ describe('ActsAccountPressure', function () {
done
();
done
();
}
}
count
++
;
count
++
;
sleep
(
TIMEOUT
);
})
})
});
});
sleep
(
TIMEOUT
);
if
(
!
flag
)
{
if
(
!
flag
)
{
done
();
done
();
break
;
break
;
...
@@ -191,9 +197,25 @@ describe('ActsAccountPressure', function () {
...
@@ -191,9 +197,25 @@ describe('ActsAccountPressure', function () {
catch
(
err
){
catch
(
err
){
console
.
debug
(
"
====>add Account that exceed the limit err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
"
====>add Account that exceed the limit err:
"
+
JSON
.
stringify
(
err
));
expect
(
err
.
code
!=
0
).
assertEqual
(
true
);
expect
(
err
.
code
!=
0
).
assertEqual
(
true
);
await
appAccountManager
.
deleteAccount
(
"
account_name_limit
"
);
console
.
debug
(
"
====>deleteAccount start====
"
);
for
(
count
=
0
;
count
<
STRESSNUM
;
count
++
)
{
let
accountName
=
"
account_pressure_limit
"
+
count
;
console
.
debug
(
'
====>deleteAccount name:
'
+
accountName
);
try
{
await
appAccountManager
.
deleteAccount
(
accountName
);
sleep
(
TIMEOUT
);
}
catch
(
err
){
console
.
error
(
"
====>deleteAccount fail err:
"
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
done
();
}
}
}
}
console
.
debug
(
"
====>the number of times to complete the stress test is:
"
+
count
)
console
.
debug
(
"
====>ActsAccountPressure_0300 end====
"
);
done
();
}
}
else
{
console
.
debug
(
"
====>deleteAccount start====
"
);
console
.
debug
(
"
====>deleteAccount start====
"
);
for
(
count
=
0
;
count
<
STRESSNUM
;
count
++
)
{
for
(
count
=
0
;
count
<
STRESSNUM
;
count
++
)
{
let
accountName
=
"
account_pressure_limit
"
+
count
;
let
accountName
=
"
account_pressure_limit
"
+
count
;
...
@@ -211,6 +233,7 @@ describe('ActsAccountPressure', function () {
...
@@ -211,6 +233,7 @@ describe('ActsAccountPressure', function () {
console
.
debug
(
"
====>the number of times to complete the stress test is:
"
+
count
)
console
.
debug
(
"
====>the number of times to complete the stress test is:
"
+
count
)
console
.
debug
(
"
====>ActsAccountPressure_0300 end====
"
);
console
.
debug
(
"
====>ActsAccountPressure_0300 end====
"
);
done
();
done
();
}
});
});
/*
/*
...
...
account/appaccount/actsaccounttest/Test.json
浏览文件 @
ffd5691d
...
@@ -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"
:
"
5
00000"
,
"package"
:
"com.example.actsaccounttest"
,
"package"
:
"com.example.actsaccounttest"
,
"shell-timeout"
:
"60000"
"shell-timeout"
:
"60000"
},
},
...
...
account/appaccount/actsaccounttest/entry/src/main/js/test/AppAccess.test.js
浏览文件 @
ffd5691d
...
@@ -17,6 +17,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
...
@@ -17,6 +17,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
const
TIMEOUT
=
5000
;
const
TIMEOUT
=
5000
;
const
STRCOUNT
=
1025
;
const
STRCOUNT
=
1025
;
const
EACHTIMEOUT
=
500
;
describe
(
'
ActsAccountAppAccess
'
,
function
()
{
describe
(
'
ActsAccountAppAccess
'
,
function
()
{
function
sleep
(
delay
)
{
function
sleep
(
delay
)
{
var
start
=
(
new
Date
()).
getTime
();
var
start
=
(
new
Date
()).
getTime
();
...
@@ -30,7 +31,13 @@ describe('ActsAccountAppAccess', function () {
...
@@ -30,7 +31,13 @@ describe('ActsAccountAppAccess', function () {
sleep
(
TIMEOUT
);
sleep
(
TIMEOUT
);
console
.
debug
(
"
====>beforeAll end====
"
);
console
.
debug
(
"
====>beforeAll end====
"
);
done
();
done
();
});
})
beforeEach
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeEach enter====
"
);
sleep
(
EACHTIMEOUT
);
done
();
})
/*
/*
* @tc.number : ActsAccountAppAccess_0100
* @tc.number : ActsAccountAppAccess_0100
...
...
account/appaccount/actsaccounttest/entry/src/main/js/test/AssociatedData.test.js
浏览文件 @
ffd5691d
...
@@ -16,6 +16,7 @@ import account from '@ohos.account.appAccount'
...
@@ -16,6 +16,7 @@ import account from '@ohos.account.appAccount'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
const
TIMEOUT
=
5000
;
const
TIMEOUT
=
5000
;
const
EACHTIMEOUT
=
500
;
describe
(
'
ActsAccountAssociatedData
'
,
function
()
{
describe
(
'
ActsAccountAssociatedData
'
,
function
()
{
function
sleep
(
delay
)
{
function
sleep
(
delay
)
{
var
start
=
(
new
Date
()).
getTime
();
var
start
=
(
new
Date
()).
getTime
();
...
@@ -29,7 +30,13 @@ describe('ActsAccountAssociatedData', function () {
...
@@ -29,7 +30,13 @@ describe('ActsAccountAssociatedData', function () {
sleep
(
TIMEOUT
);
sleep
(
TIMEOUT
);
console
.
debug
(
"
====>beforeAll end====
"
);
console
.
debug
(
"
====>beforeAll end====
"
);
done
();
done
();
});
})
beforeEach
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeEach enter====
"
);
sleep
(
EACHTIMEOUT
);
done
();
})
/*
/*
* @tc.number : ActsAccountAssociatedData_0100
* @tc.number : ActsAccountAssociatedData_0100
...
...
account/appaccount/actsaccounttest/entry/src/main/js/test/Credential.test.js
浏览文件 @
ffd5691d
...
@@ -16,6 +16,7 @@ import account from '@ohos.account.appAccount'
...
@@ -16,6 +16,7 @@ import account from '@ohos.account.appAccount'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
const
TIMEOUT
=
5000
;
const
TIMEOUT
=
5000
;
const
EACHTIMEOUT
=
500
;
describe
(
'
ActsAccountCredential
'
,
function
()
{
describe
(
'
ActsAccountCredential
'
,
function
()
{
function
sleep
(
delay
)
{
function
sleep
(
delay
)
{
var
start
=
(
new
Date
()).
getTime
();
var
start
=
(
new
Date
()).
getTime
();
...
@@ -29,7 +30,13 @@ describe('ActsAccountCredential', function () {
...
@@ -29,7 +30,13 @@ describe('ActsAccountCredential', function () {
sleep
(
TIMEOUT
);
sleep
(
TIMEOUT
);
console
.
debug
(
"
====>beforeAll end====
"
);
console
.
debug
(
"
====>beforeAll end====
"
);
done
();
done
();
});
})
beforeEach
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeEach enter====
"
);
sleep
(
EACHTIMEOUT
);
done
();
})
/*
/*
* @tc.number : ActsAccountCredential_0100
* @tc.number : ActsAccountCredential_0100
...
...
account/appaccount/actsaccounttest/entry/src/main/js/test/ExtraInfo.test.js
浏览文件 @
ffd5691d
...
@@ -16,6 +16,7 @@ import account from '@ohos.account.appAccount'
...
@@ -16,6 +16,7 @@ import account from '@ohos.account.appAccount'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
const
TIMEOUT
=
5000
;
const
TIMEOUT
=
5000
;
const
EACHTIMEOUT
=
500
;
describe
(
'
ActsAccountSetGetExtraInfo
'
,
function
()
{
describe
(
'
ActsAccountSetGetExtraInfo
'
,
function
()
{
function
sleep
(
delay
)
{
function
sleep
(
delay
)
{
var
start
=
(
new
Date
()).
getTime
();
var
start
=
(
new
Date
()).
getTime
();
...
@@ -29,7 +30,13 @@ describe('ActsAccountSetGetExtraInfo', function () {
...
@@ -29,7 +30,13 @@ describe('ActsAccountSetGetExtraInfo', function () {
sleep
(
TIMEOUT
);
sleep
(
TIMEOUT
);
console
.
debug
(
"
====>beforeAll end====
"
);
console
.
debug
(
"
====>beforeAll end====
"
);
done
();
done
();
});
})
beforeEach
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeEach enter====
"
);
sleep
(
EACHTIMEOUT
);
done
();
})
/*
/*
* @tc.number : ActsAccountSetGetExtraInfo_0100
* @tc.number : ActsAccountSetGetExtraInfo_0100
...
...
account/appaccount/actsaccounttest/entry/src/main/js/test/OAuthToken.test.js
浏览文件 @
ffd5691d
...
@@ -17,6 +17,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
...
@@ -17,6 +17,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
const
TIMEOUT
=
5000
;
const
TIMEOUT
=
5000
;
const
LENGTHLIMIT
=
1024
;
const
LENGTHLIMIT
=
1024
;
const
EACHTIMEOUT
=
500
;
describe
(
'
ActsAccountOAuthToken
'
,
function
()
{
describe
(
'
ActsAccountOAuthToken
'
,
function
()
{
function
sleep
(
delay
)
{
function
sleep
(
delay
)
{
var
start
=
(
new
Date
()).
getTime
();
var
start
=
(
new
Date
()).
getTime
();
...
@@ -32,6 +33,12 @@ describe('ActsAccountOAuthToken', function () {
...
@@ -32,6 +33,12 @@ describe('ActsAccountOAuthToken', function () {
done
();
done
();
});
});
beforeEach
(
async
function
(
done
)
{
console
.
debug
(
"
====>beforeEach enter====
"
);
sleep
(
EACHTIMEOUT
);
done
();
})
/*
/*
* @tc.number : ActsAccountOAuthToken_0100
* @tc.number : ActsAccountOAuthToken_0100
* @tc.name : Test oauth token in callback form
* @tc.name : Test oauth token in callback form
...
...
account/appaccount/actsaccounttest/entry/src/main/js/test/OnOff.js
浏览文件 @
ffd5691d
...
@@ -499,6 +499,7 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -499,6 +499,7 @@ describe('ActsAccountChangeOnOff', async function () {
*/
*/
it
(
'
ActsAccountChangeOnOff_0800
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsAccountChangeOnOff_0800
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsAccountChangeOnOff_0800 start====
"
);
console
.
debug
(
"
====>ActsAccountChangeOnOff_0800 start====
"
);
let
dataMap
=
new
Map
();
var
appAccountManager
=
account
.
createAppAccountManager
();
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat appAccountManager finish
"
);
console
.
debug
(
"
====>creat appAccountManager finish
"
);
console
.
debug
(
"
====>add account ActsAccountChangeOnOff_0800 start
"
);
console
.
debug
(
"
====>add account ActsAccountChangeOnOff_0800 start
"
);
...
@@ -506,8 +507,16 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -506,8 +507,16 @@ describe('ActsAccountChangeOnOff', async function () {
console
.
debug
(
"
====>on ActsAccountChangeOnOff_0800 start
"
);
console
.
debug
(
"
====>on ActsAccountChangeOnOff_0800 start
"
);
function
changeOnCallback
(
data
){
function
changeOnCallback
(
data
){
console
.
debug
(
"
====>receive change 0800 data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>receive change 0800 data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
[
0
].
name
).
assertEqual
(
"
onoff_self
"
);
console
.
debug
(
"
====>data.length:
"
+
data
.
length
);
expect
(
data
[
0
].
owner
).
assertEqual
(
"
com.example.actsaccounttest
"
);
for
(
let
i
=
0
,
len
=
data
.
length
;
i
<
len
;
i
++
)
{
dataMap
.
set
(
data
[
i
].
name
,
data
[
i
].
owner
)
}
expect
(
dataMap
.
has
(
"
onoff_self
"
)).
assertTrue
();
if
(
dataMap
.
has
(
"
onoff_self
"
))
{
let
data
=
dataMap
.
get
(
"
onoff_self
"
);
console
.
debug
(
"
====>the account owner is:
"
+
data
);
expect
(
data
).
assertEqual
(
"
com.example.actsaccounttest
"
);
}
appAccountManager
.
off
(
'
change
'
,
function
(){
appAccountManager
.
off
(
'
change
'
,
function
(){
console
.
debug
(
"
====>off ActsAccountChangeOnOff_0800 finish====
"
);
console
.
debug
(
"
====>off ActsAccountChangeOnOff_0800 finish====
"
);
appAccountManager
.
deleteAccount
(
"
onoff_self
"
,
(
err
)
=>
{
appAccountManager
.
deleteAccount
(
"
onoff_self
"
,
(
err
)
=>
{
...
@@ -545,6 +554,7 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -545,6 +554,7 @@ describe('ActsAccountChangeOnOff', async function () {
*/
*/
it
(
'
ActsAccountChangeOnOff_0900
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsAccountChangeOnOff_0900
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsAccountChangeOnOff_0900 start====
"
);
console
.
debug
(
"
====>ActsAccountChangeOnOff_0900 start====
"
);
let
dataMap
=
new
Map
();
var
appAccountManager
=
account
.
createAppAccountManager
();
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat appAccountManager finish
"
);
console
.
debug
(
"
====>creat appAccountManager finish
"
);
console
.
debug
(
"
====>add first account ActsAccountChangeOnOff_0900 start
"
);
console
.
debug
(
"
====>add first account ActsAccountChangeOnOff_0900 start
"
);
...
@@ -554,10 +564,22 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -554,10 +564,22 @@ describe('ActsAccountChangeOnOff', async function () {
console
.
debug
(
"
====>on ActsAccountChangeOnOff_0900 start
"
);
console
.
debug
(
"
====>on ActsAccountChangeOnOff_0900 start
"
);
function
changeOnCallback
(
data
){
function
changeOnCallback
(
data
){
console
.
debug
(
"
====>receive change 0900 data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>receive change 0900 data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
[
0
].
name
).
assertEqual
(
"
onoff_self_first
"
);
console
.
debug
(
"
====>data.length:
"
+
data
.
length
);
expect
(
data
[
0
].
owner
).
assertEqual
(
"
com.example.actsaccounttest
"
);
for
(
let
i
=
0
,
len
=
data
.
length
;
i
<
len
;
i
++
)
{
expect
(
data
[
1
].
name
).
assertEqual
(
"
onoff_self_second
"
);
dataMap
.
set
(
data
[
i
].
name
,
data
[
i
].
owner
)
expect
(
data
[
1
].
owner
).
assertEqual
(
"
com.example.actsaccounttest
"
);
}
expect
(
dataMap
.
has
(
"
onoff_self_first
"
)).
assertTrue
();
if
(
dataMap
.
has
(
"
onoff_self_first
"
))
{
let
data
=
dataMap
.
get
(
"
onoff_self_first
"
);
console
.
debug
(
"
====>the account owner is:
"
+
data
);
expect
(
data
).
assertEqual
(
"
com.example.actsaccounttest
"
);
}
expect
(
dataMap
.
has
(
"
onoff_self_second
"
)).
assertTrue
();
if
(
dataMap
.
has
(
"
onoff_self_second
"
))
{
let
data
=
dataMap
.
get
(
"
onoff_self_second
"
);
console
.
debug
(
"
====>the account owner is:
"
+
data
);
expect
(
data
).
assertEqual
(
"
com.example.actsaccounttest
"
);
}
appAccountManager
.
off
(
'
change
'
,
function
(){
appAccountManager
.
off
(
'
change
'
,
function
(){
console
.
debug
(
"
====>off ActsAccountChangeOnOff_0900 finish====
"
);
console
.
debug
(
"
====>off ActsAccountChangeOnOff_0900 finish====
"
);
appAccountManager
.
deleteAccount
(
"
onoff_self_first
"
,
(
err
)
=>
{
appAccountManager
.
deleteAccount
(
"
onoff_self_first
"
,
(
err
)
=>
{
...
@@ -598,6 +620,8 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -598,6 +620,8 @@ describe('ActsAccountChangeOnOff', async function () {
*/
*/
it
(
'
ActsAccountChangeOnOff_1000
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsAccountChangeOnOff_1000
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsAccountChangeOnOff_1000 start====
"
);
console
.
debug
(
"
====>ActsAccountChangeOnOff_1000 start====
"
);
let
dataMapFir
=
new
Map
();
let
dataMapSec
=
new
Map
();
var
appAccountManager
=
account
.
createAppAccountManager
();
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat appAccountManager finish
"
);
console
.
debug
(
"
====>creat appAccountManager finish
"
);
console
.
debug
(
"
====>add account ActsAccountChangeOnOff_1000 start
"
);
console
.
debug
(
"
====>add account ActsAccountChangeOnOff_1000 start
"
);
...
@@ -606,14 +630,30 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -606,14 +630,30 @@ describe('ActsAccountChangeOnOff', async function () {
var
twiceSign
=
0
;
var
twiceSign
=
0
;
function
changeOnFirstCallback
(
data
){
function
changeOnFirstCallback
(
data
){
console
.
debug
(
"
====>first receive change 1000 data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>first receive change 1000 data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
[
0
].
name
).
assertEqual
(
"
onoff_twice
"
);
console
.
debug
(
"
====>data.length:
"
+
data
.
length
);
expect
(
data
[
0
].
owner
).
assertEqual
(
"
com.example.actsaccounttest
"
);
for
(
let
i
=
0
,
len
=
data
.
length
;
i
<
len
;
i
++
)
{
dataMapFir
.
set
(
data
[
i
].
name
,
data
[
i
].
owner
)
}
expect
(
dataMapFir
.
has
(
"
onoff_twice
"
)).
assertTrue
();
if
(
dataMapFir
.
has
(
"
onoff_twice
"
))
{
let
data
=
dataMapFir
.
get
(
"
onoff_twice
"
);
console
.
debug
(
"
====>the account owner is:
"
+
data
);
expect
(
data
).
assertEqual
(
"
com.example.actsaccounttest
"
);
}
twiceSign
=
twiceSign
+
1
;
twiceSign
=
twiceSign
+
1
;
}
}
function
changeOnSecondCallback
(
data
){
function
changeOnSecondCallback
(
data
){
console
.
debug
(
"
====>second receive change 1000 data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>second receive change 1000 data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
[
0
].
name
).
assertEqual
(
"
onoff_twice
"
);
console
.
debug
(
"
====>data.length:
"
+
data
.
length
);
expect
(
data
[
0
].
owner
).
assertEqual
(
"
com.example.actsaccounttest
"
);
for
(
let
i
=
0
,
len
=
data
.
length
;
i
<
len
;
i
++
)
{
dataMapSec
.
set
(
data
[
i
].
name
,
data
[
i
].
owner
)
}
expect
(
dataMapSec
.
has
(
"
onoff_twice
"
)).
assertTrue
();
if
(
dataMapSec
.
has
(
"
onoff_twice
"
))
{
let
data
=
dataMapSec
.
get
(
"
onoff_twice
"
);
console
.
debug
(
"
====>the account owner is:
"
+
data
);
expect
(
data
).
assertEqual
(
"
com.example.actsaccounttest
"
);
}
twiceSign
=
twiceSign
+
1
;
twiceSign
=
twiceSign
+
1
;
appAccountManager
.
off
(
'
change
'
,
function
(){
appAccountManager
.
off
(
'
change
'
,
function
(){
console
.
debug
(
"
====>off ActsAccountChangeOnOff_1000 finish====
"
);
console
.
debug
(
"
====>off ActsAccountChangeOnOff_1000 finish====
"
);
...
@@ -654,6 +694,7 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -654,6 +694,7 @@ describe('ActsAccountChangeOnOff', async function () {
*/
*/
it
(
'
ActsAccountChangeOnOff_1100
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsAccountChangeOnOff_1100
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsAccountChangeOnOff_1100 start====
"
);
console
.
debug
(
"
====>ActsAccountChangeOnOff_1100 start====
"
);
let
dataMap
=
new
Map
();
var
appAccountManager
=
account
.
createAppAccountManager
();
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat appAccountManager finish
"
);
console
.
debug
(
"
====>creat appAccountManager finish
"
);
console
.
debug
(
"
====>add account ActsAccountChangeOnOff_1100 start
"
);
console
.
debug
(
"
====>add account ActsAccountChangeOnOff_1100 start
"
);
...
@@ -663,8 +704,16 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -663,8 +704,16 @@ describe('ActsAccountChangeOnOff', async function () {
function
onCallBack
(
data
){
function
onCallBack
(
data
){
console
.
debug
(
"
====>receive change 1100 data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>receive change 1100 data:
"
+
JSON
.
stringify
(
data
));
sameSign
=
sameSign
+
1
;
sameSign
=
sameSign
+
1
;
expect
(
data
[
0
].
name
).
assertEqual
(
"
onoff_same
"
);
console
.
debug
(
"
====>data.length:
"
+
data
.
length
);
expect
(
data
[
0
].
owner
).
assertEqual
(
"
com.example.actsaccounttest
"
);
for
(
let
i
=
0
,
len
=
data
.
length
;
i
<
len
;
i
++
)
{
dataMap
.
set
(
data
[
i
].
name
,
data
[
i
].
owner
)
}
expect
(
dataMap
.
has
(
"
onoff_same
"
)).
assertTrue
();
if
(
dataMap
.
has
(
"
onoff_same
"
))
{
let
data
=
dataMap
.
get
(
"
onoff_same
"
);
console
.
debug
(
"
====>the account owner is:
"
+
data
);
expect
(
data
).
assertEqual
(
"
com.example.actsaccounttest
"
);
}
}
}
try
{
try
{
appAccountManager
.
on
(
'
change
'
,
[
"
com.example.actsaccounttest
"
,
"
com.example.actsaccounttest
"
],
onCallBack
);
appAccountManager
.
on
(
'
change
'
,
[
"
com.example.actsaccounttest
"
,
"
com.example.actsaccounttest
"
],
onCallBack
);
...
@@ -705,6 +754,7 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -705,6 +754,7 @@ describe('ActsAccountChangeOnOff', async function () {
*/
*/
it
(
'
ActsAccountChangeOnOff_1200
'
,
0
,
async
function
(
done
)
{
it
(
'
ActsAccountChangeOnOff_1200
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
====>ActsAccountChangeOnOff_1200 start====
"
);
console
.
debug
(
"
====>ActsAccountChangeOnOff_1200 start====
"
);
let
dataMap
=
new
Map
();
var
appAccountManager
=
account
.
createAppAccountManager
();
var
appAccountManager
=
account
.
createAppAccountManager
();
console
.
debug
(
"
====>creat appAccountManager finish
"
);
console
.
debug
(
"
====>creat appAccountManager finish
"
);
console
.
debug
(
"
====>add account ActsAccountChangeOnOff_1200 start
"
);
console
.
debug
(
"
====>add account ActsAccountChangeOnOff_1200 start
"
);
...
@@ -712,8 +762,16 @@ describe('ActsAccountChangeOnOff', async function () {
...
@@ -712,8 +762,16 @@ describe('ActsAccountChangeOnOff', async function () {
console
.
debug
(
"
====>on ActsAccountChangeOnOff_1200 start
"
);
console
.
debug
(
"
====>on ActsAccountChangeOnOff_1200 start
"
);
function
changeOnCallback
(
data
){
function
changeOnCallback
(
data
){
console
.
debug
(
"
====>receive change 1200 data:
"
+
JSON
.
stringify
(
data
));
console
.
debug
(
"
====>receive change 1200 data:
"
+
JSON
.
stringify
(
data
));
expect
(
data
[
0
].
name
).
assertEqual
(
"
onoff_repeatoff
"
);
console
.
debug
(
"
====>data.length:
"
+
data
.
length
);
expect
(
data
[
0
].
owner
).
assertEqual
(
"
com.example.actsaccounttest
"
);
for
(
let
i
=
0
,
len
=
data
.
length
;
i
<
len
;
i
++
)
{
dataMap
.
set
(
data
[
i
].
name
,
data
[
i
].
owner
)
}
expect
(
dataMap
.
has
(
"
onoff_repeatoff
"
)).
assertTrue
();
if
(
dataMap
.
has
(
"
onoff_repeatoff
"
))
{
let
data
=
dataMap
.
get
(
"
onoff_repeatoff
"
);
console
.
debug
(
"
====>the account owner is:
"
+
data
);
expect
(
data
).
assertEqual
(
"
com.example.actsaccounttest
"
);
}
appAccountManager
.
off
(
'
change
'
,
function
(){
appAccountManager
.
off
(
'
change
'
,
function
(){
console
.
debug
(
"
====>first off ActsAccountChangeOnOff_1200 finish====
"
);
console
.
debug
(
"
====>first off ActsAccountChangeOnOff_1200 finish====
"
);
appAccountManager
.
off
(
'
change
'
,
function
(){
appAccountManager
.
off
(
'
change
'
,
function
(){
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录