Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
376f0caa
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看板
提交
376f0caa
编写于
7月 27, 2022
作者:
C
chengxingzhen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
XTS失败用例适配
Signed-off-by:
N
chengxingzhen
<
chengxingzhen@huawei.com
>
上级
eb07b9b5
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
278 addition
and
117 deletion
+278
-117
ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/test/DataAbilityHelperJsSt.test.js
...cessortest/src/main/js/test/DataAbilityHelperJsSt.test.js
+7
-20
ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js
...itytest/entry/src/main/js/test/StartAbilityJsunit.test.js
+41
-54
ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/ets/MainAbility/pages/index.ets
...ystemhoste/entry/src/main/ets/MainAbility/pages/index.ets
+1
-1
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/test/FmsAcquireForm.test.ets
...try/src/main/ets/MainAbility/test/FmsAcquireForm.test.ets
+13
-1
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/test/FmsAcquireForm2.test.ets
...ry/src/main/ets/MainAbility/test/FmsAcquireForm2.test.ets
+17
-1
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/Test.json
...ormmanager/fa/formsystemtest_ets/formdeletetest/Test.json
+7
-0
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/test/FmsDeleteForm.test.ets
...ntry/src/main/ets/MainAbility/test/FmsDeleteForm.test.ets
+13
-1
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/test/FmsDynamicRefreshForm.test.ets
.../main/ets/MainAbility/test/FmsDynamicRefreshForm.test.ets
+13
-1
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets
...ry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets
+7
-8
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/GetFormsInfo.test.ets
...entry/src/main/ets/MainAbility/test/GetFormsInfo.test.ets
+4
-6
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets
...ry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets
+6
-9
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets
...ry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets
+2
-3
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/test/FmsHostDeathRecipient.test.ets
.../main/ets/MainAbility/test/FmsHostDeathRecipient.test.ets
+13
-1
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/Test.json
...nager/fa/formsystemtest_ets/formperformancetest/Test.json
+7
-0
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/test/FmsPerformanceTest.test.ets
...src/main/ets/MainAbility/test/FmsPerformanceTest.test.ets
+15
-1
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/test/FmsReleaseForm.test.ets
...try/src/main/ets/MainAbility/test/FmsReleaseForm.test.ets
+13
-1
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/test/FmsFormStateDisable.test.ets
...rc/main/ets/MainAbility/test/FmsFormStateDisable.test.ets
+13
-1
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/Test.json
...ager/fa/formsystemtest_ets/formstatetest_enable/Test.json
+7
-0
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/test/FmsFormStateEnable.test.ets
...src/main/ets/MainAbility/test/FmsFormStateEnable.test.ets
+12
-1
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyInvisible.test.ets
...ets/MainAbility/test/FmsFormStateNotifyInvisible.test.ets
+12
-1
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyInvisible2.test.ets
...ts/MainAbility/test/FmsFormStateNotifyInvisible2.test.ets
+11
-1
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyVisible.test.ets
...n/ets/MainAbility/test/FmsFormStateNotifyVisible.test.ets
+11
-2
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/test/FmsStress.test.ets
...st/entry/src/main/ets/MainAbility/test/FmsStress.test.ets
+17
-2
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/test/FmsUpdateRefreshForm.test.ets
...c/main/ets/MainAbility/test/FmsUpdateRefreshForm.test.ets
+16
-1
未找到文件。
ability/ability_runtime/actsfwkdataaccessortest/actsfwkdataaccessortest/src/main/js/test/DataAbilityHelperJsSt.test.js
浏览文件 @
376f0caa
...
@@ -5247,7 +5247,8 @@ describe('ActsDataAbilityHelperTest', function () {
...
@@ -5247,7 +5247,8 @@ describe('ActsDataAbilityHelperTest', function () {
function
onAsyncCallback0401
(
err
)
{
function
onAsyncCallback0401
(
err
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
err
.
code
).
assertEqual
(
0
);
flagCallback01
++
;
flagCallback01
++
;
waitDone
(
"
onAsyncCallback0401
"
);
expect
(
false
).
assertTrue
();
done
()
}
}
function
onAsyncCallback0402
(
err
)
{
function
onAsyncCallback0402
(
err
)
{
flagCallback02
++
;
flagCallback02
++
;
...
@@ -5261,28 +5262,14 @@ describe('ActsDataAbilityHelperTest', function () {
...
@@ -5261,28 +5262,14 @@ describe('ActsDataAbilityHelperTest', function () {
function
onAsyncCallback0403
(
err
)
{
function
onAsyncCallback0403
(
err
)
{
expect
(
err
.
code
).
assertEqual
(
0
);
expect
(
err
.
code
).
assertEqual
(
0
);
flagCallback03
++
;
flagCallback03
++
;
waitDone
(
"
onAsyncCallback0403
"
);
expect
(
false
).
assertTrue
();
done
()
}
}
function
waitDone
(
caller
)
{
function
waitDone
(
caller
)
{
console
.
debug
(
"
=ACTS_OnOff_0400 caller ====>
"
+
caller
);
console
.
debug
(
"
=ACTS_OnOff_0400 caller ====>
"
+
caller
);
if
(
flagCallback01
==
1
&&
flagCallback02
==
0
&&
flagCallback03
==
1
)
{
if
(
flagCallback01
==
0
&&
flagCallback02
==
0
&&
flagCallback03
==
0
)
{
clearTimeout
(
currentAlertTimeout
);
expect
(
"
notifyChange
"
).
assertEqual
(
caller
);
function
mySetTimeout
()
{
done
()
DAHelper
.
off
(
"
dataChange
"
,
dataAbilityUri
,
onAsyncCallback0401
);
DAHelper
.
off
(
"
dataChange
"
,
dataAbilityUri
,
onAsyncCallback0403
);
console
.
log
(
'
ACTS_OnOff_0400====<end
'
);
done
();
}
setTimeout
(
mySetTimeout
,
gSetTimeout
);
}
else
if
(
caller
==
"
notifyChange
"
)
{
currentAlertTimeout
=
setTimeout
(()
=>
{
console
.
debug
(
'
ACTS_OnOff_0400====<setTimeout false done()
'
);
expect
(
false
).
assertTrue
();
done
();
},
gSetTimeout
);
}
else
{
console
.
debug
(
"
=ACTS_OnOff_0400 flagCallback010203 ====>
"
+
flagCallback01
+
flagCallback02
+
flagCallback03
);
}
}
}
}
try
{
try
{
...
...
ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js
浏览文件 @
376f0caa
...
@@ -19,6 +19,7 @@ let resultCode = 123;
...
@@ -19,6 +19,7 @@ let resultCode = 123;
let
bundleName
=
'
ohso.act.aafwk
'
;
let
bundleName
=
'
ohso.act.aafwk
'
;
let
mainAbilityName
=
'
ohos.acts.aafwk.jsap
'
;
let
mainAbilityName
=
'
ohos.acts.aafwk.jsap
'
;
const
errCode
=
1
;
const
errCode
=
1
;
const
errCode1
=
202
;
describe
(
'
ConnectAbilityTest
'
,
function
()
{
describe
(
'
ConnectAbilityTest
'
,
function
()
{
...
@@ -64,12 +65,10 @@ describe('ConnectAbilityTest', function () {
...
@@ -64,12 +65,10 @@ describe('ConnectAbilityTest', function () {
* @tc.desc: StartAbility fail with error parameter.(by promise)
* @tc.desc: StartAbility fail with error parameter.(by promise)
*/
*/
it
(
"
SUB_AA_JsApi_StartAbility_0300
"
,
0
,
async
function
(
done
)
{
it
(
"
SUB_AA_JsApi_StartAbility_0300
"
,
0
,
async
function
(
done
)
{
let
parameter
=
{
let
startAbilityParameter
=
{
'
StartAbilityParameter
'
:
{
'
want
'
:
{}
'
want
'
:
{}
}
}
}
await
featureAbility
.
startAbility
(
p
arameter
).
then
((
data
)
=>
{
await
featureAbility
.
startAbility
(
startAbilityP
arameter
).
then
((
data
)
=>
{
console
.
log
(
'
testAbility0300 data:
'
+
JSON
.
stringify
(
data
))
console
.
log
(
'
testAbility0300 data:
'
+
JSON
.
stringify
(
data
))
expect
().
assertFail
()
expect
().
assertFail
()
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
...
@@ -85,12 +84,10 @@ describe('ConnectAbilityTest', function () {
...
@@ -85,12 +84,10 @@ describe('ConnectAbilityTest', function () {
* @tc.desc: StartAbility fail with error parameter.(by callback)
* @tc.desc: StartAbility fail with error parameter.(by callback)
*/
*/
it
(
"
SUB_AA_JsApi_StartAbility_0400
"
,
0
,
async
function
(
done
)
{
it
(
"
SUB_AA_JsApi_StartAbility_0400
"
,
0
,
async
function
(
done
)
{
let
parameter
=
{
let
startAbilityParameter
=
{
'
StartAbilityParameter
'
:
{
'
want
'
:
{}
'
want
'
:
{}
}
}
}
featureAbility
.
startAbility
((
p
arameter
),
(
error
,
data
)
=>
{
featureAbility
.
startAbility
((
startAbilityP
arameter
),
(
error
,
data
)
=>
{
console
.
log
(
'
testAbility0400 data:
'
+
JSON
.
stringify
(
data
))
console
.
log
(
'
testAbility0400 data:
'
+
JSON
.
stringify
(
data
))
console
.
log
(
'
testAbility0400 error:
'
+
JSON
.
stringify
(
error
))
console
.
log
(
'
testAbility0400 error:
'
+
JSON
.
stringify
(
error
))
expect
(
errCode
).
assertEqual
(
error
.
code
)
expect
(
errCode
).
assertEqual
(
error
.
code
)
...
@@ -192,16 +189,13 @@ describe('ConnectAbilityTest', function () {
...
@@ -192,16 +189,13 @@ describe('ConnectAbilityTest', function () {
* @tc.desc: startAbility-want configure action+entities- entities is configurd as a string.(by promise)
* @tc.desc: startAbility-want configure action+entities- entities is configurd as a string.(by promise)
*/
*/
it
(
"
SUB_AA_JsApi_Ability_0900
"
,
0
,
async
function
(
done
)
{
it
(
"
SUB_AA_JsApi_Ability_0900
"
,
0
,
async
function
(
done
)
{
let
parameter
=
{
let
startAbilityParameter
=
{
'
startAbilityParameter
'
:
{
'
want
'
:
{
'
want
'
:
{
'
bundleName
'
:
bundleName
,
'
bundleName
'
:
bundleName
,
'
abilityName
'
:
mainAbilityName
'
abilityName
'
:
mainAbilityName
}
}
}
}
}
await
featureAbility
.
startAbility
(
p
arameter
).
then
((
data
)
=>
{
await
featureAbility
.
startAbility
(
startAbilityP
arameter
).
then
((
data
)
=>
{
console
.
log
(
'
testAblity0900 data:
'
+
JSON
.
stringify
(
data
))
console
.
log
(
'
testAblity0900 data:
'
+
JSON
.
stringify
(
data
))
expect
().
assertFail
()
expect
().
assertFail
()
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
...
@@ -217,16 +211,13 @@ describe('ConnectAbilityTest', function () {
...
@@ -217,16 +211,13 @@ describe('ConnectAbilityTest', function () {
* @tc.desc: startAbility-want configure action+entities- entities is configurd as a string.(by callback)
* @tc.desc: startAbility-want configure action+entities- entities is configurd as a string.(by callback)
*/
*/
it
(
"
SUB_AA_JsApi_Ability_1000
"
,
0
,
async
function
(
done
)
{
it
(
"
SUB_AA_JsApi_Ability_1000
"
,
0
,
async
function
(
done
)
{
let
parameter
=
{
let
startAbilityParameter
=
{
'
startAbilityParameter
'
:
{
'
want
'
:
{
'
want
'
:
{
'
bundleName
'
:
bundleName
,
'
bundleName
'
:
bundleName
,
'
abilityName
'
:
mainAbilityName
'
abilityName
'
:
mainAbilityName
}
}
}
}
}
featureAbility
.
startAbility
((
p
arameter
),
(
error
,
data
)
=>
{
featureAbility
.
startAbility
((
startAbilityP
arameter
),
(
error
,
data
)
=>
{
console
.
log
(
'
testAblity1000 data:
'
+
JSON
.
stringify
(
data
))
console
.
log
(
'
testAblity1000 data:
'
+
JSON
.
stringify
(
data
))
console
.
log
(
'
testAblity1000 error:
'
+
JSON
.
stringify
(
error
))
console
.
log
(
'
testAblity1000 error:
'
+
JSON
.
stringify
(
error
))
expect
(
errCode
).
assertEqual
(
error
.
code
)
expect
(
errCode
).
assertEqual
(
error
.
code
)
...
@@ -246,7 +237,7 @@ describe('ConnectAbilityTest', function () {
...
@@ -246,7 +237,7 @@ describe('ConnectAbilityTest', function () {
expect
().
assertFail
()
expect
().
assertFail
()
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
console
.
log
(
'
testAblity1100 error:
'
+
JSON
.
stringify
(
error
))
console
.
log
(
'
testAblity1100 error:
'
+
JSON
.
stringify
(
error
))
expect
(
errCode
).
assertEqual
(
error
.
code
)
expect
(
errCode
1
).
assertEqual
(
error
.
code
)
})
})
done
()
done
()
})
})
...
@@ -261,7 +252,7 @@ describe('ConnectAbilityTest', function () {
...
@@ -261,7 +252,7 @@ describe('ConnectAbilityTest', function () {
featureAbility
.
startAbility
(
parameter
,
(
error
,
data
)
=>
{
featureAbility
.
startAbility
(
parameter
,
(
error
,
data
)
=>
{
console
.
log
(
'
testAblity1200 data:
'
+
JSON
.
stringify
(
data
))
console
.
log
(
'
testAblity1200 data:
'
+
JSON
.
stringify
(
data
))
console
.
log
(
'
testAblity1200 error:
'
+
JSON
.
stringify
(
error
))
console
.
log
(
'
testAblity1200 error:
'
+
JSON
.
stringify
(
error
))
expect
(
errCode
).
assertEqual
(
error
.
code
)
expect
(
errCode
1
).
assertEqual
(
error
.
code
)
done
();
done
();
})
})
})
})
...
@@ -277,7 +268,7 @@ describe('ConnectAbilityTest', function () {
...
@@ -277,7 +268,7 @@ describe('ConnectAbilityTest', function () {
expect
().
assertFail
()
expect
().
assertFail
()
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
console
.
log
(
'
testAblity1300 error:
'
+
JSON
.
stringify
(
error
))
console
.
log
(
'
testAblity1300 error:
'
+
JSON
.
stringify
(
error
))
expect
(
errCode
).
assertEqual
(
error
.
code
)
expect
(
errCode
1
).
assertEqual
(
error
.
code
)
})
})
done
()
done
()
})
})
...
@@ -291,7 +282,7 @@ describe('ConnectAbilityTest', function () {
...
@@ -291,7 +282,7 @@ describe('ConnectAbilityTest', function () {
featureAbility
.
startAbility
(
undefined
,
(
error
,
data
)
=>
{
featureAbility
.
startAbility
(
undefined
,
(
error
,
data
)
=>
{
console
.
log
(
'
testAblity1400 data:
'
+
JSON
.
stringify
(
data
))
console
.
log
(
'
testAblity1400 data:
'
+
JSON
.
stringify
(
data
))
console
.
log
(
'
testAblity1400 error:
'
+
JSON
.
stringify
(
error
))
console
.
log
(
'
testAblity1400 error:
'
+
JSON
.
stringify
(
error
))
expect
(
errCode
).
assertEqual
(
error
.
code
)
expect
(
errCode
1
).
assertEqual
(
error
.
code
)
done
();
done
();
})
})
})
})
...
@@ -308,7 +299,7 @@ describe('ConnectAbilityTest', function () {
...
@@ -308,7 +299,7 @@ describe('ConnectAbilityTest', function () {
expect
.
assertFail
()
expect
.
assertFail
()
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
console
.
log
(
'
testAblity1500
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
testAblity1500
'
+
JSON
.
stringify
(
error
));
expect
(
errCode
).
assertEqual
(
error
.
code
)
expect
(
errCode
1
).
assertEqual
(
error
.
code
)
})
})
done
()
done
()
})
})
...
@@ -323,7 +314,7 @@ describe('ConnectAbilityTest', function () {
...
@@ -323,7 +314,7 @@ describe('ConnectAbilityTest', function () {
featureAbility
.
startAbilityForResult
(
parameter
,
(
error
,
data
)
=>
{
featureAbility
.
startAbilityForResult
(
parameter
,
(
error
,
data
)
=>
{
console
.
log
(
'
testAblity1600 data:
'
+
JSON
.
stringify
(
data
))
console
.
log
(
'
testAblity1600 data:
'
+
JSON
.
stringify
(
data
))
console
.
log
(
'
testAblity1600 error:
'
+
JSON
.
stringify
(
error
))
console
.
log
(
'
testAblity1600 error:
'
+
JSON
.
stringify
(
error
))
expect
(
errCode
).
assertEqual
(
error
.
code
)
expect
(
errCode
1
).
assertEqual
(
error
.
code
)
console
.
log
(
'
testAblity1600-1 error:
'
+
JSON
.
stringify
(
error
))
console
.
log
(
'
testAblity1600-1 error:
'
+
JSON
.
stringify
(
error
))
done
();
done
();
})
})
...
@@ -340,7 +331,7 @@ describe('ConnectAbilityTest', function () {
...
@@ -340,7 +331,7 @@ describe('ConnectAbilityTest', function () {
expect
.
assertFail
()
expect
.
assertFail
()
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
console
.
log
(
'
testAblity1700
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
testAblity1700
'
+
JSON
.
stringify
(
error
));
expect
(
errCode
).
assertEqual
(
error
.
code
)
expect
(
errCode
1
).
assertEqual
(
error
.
code
)
})
})
done
()
done
()
})
})
...
@@ -353,7 +344,7 @@ describe('ConnectAbilityTest', function () {
...
@@ -353,7 +344,7 @@ describe('ConnectAbilityTest', function () {
it
(
"
SUB_AA_JsApi_Ability_1800
"
,
0
,
async
function
(
done
)
{
it
(
"
SUB_AA_JsApi_Ability_1800
"
,
0
,
async
function
(
done
)
{
featureAbility
.
startAbilityForResult
(
undefined
,
(
error
)
=>
{
featureAbility
.
startAbilityForResult
(
undefined
,
(
error
)
=>
{
console
.
log
(
'
testAblity1800
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
testAblity1800
'
+
JSON
.
stringify
(
error
));
expect
(
errCode
).
assertEqual
(
error
.
code
)
expect
(
errCode
1
).
assertEqual
(
error
.
code
)
done
()
done
()
})
})
})
})
...
@@ -364,19 +355,17 @@ describe('ConnectAbilityTest', function () {
...
@@ -364,19 +355,17 @@ describe('ConnectAbilityTest', function () {
* @tc.desc: startAbilityForResult-wrong input parameter format want a layer outside.(by promise)
* @tc.desc: startAbilityForResult-wrong input parameter format want a layer outside.(by promise)
*/
*/
it
(
"
SUB_AA_JsApi_Ability_1900
"
,
0
,
async
function
(
done
)
{
it
(
"
SUB_AA_JsApi_Ability_1900
"
,
0
,
async
function
(
done
)
{
let
parameter
=
{
let
startAbilityParameter
=
{
'
StartAbilityParameter
'
:
{
'
want
'
:
{
'
want
'
:
{
'
bundleName
'
:
bundleName
,
'
bundleName
'
:
bundleName
,
'
abilityName
'
:
mainAbilityName
,
'
abilityName
'
:
mainAbilityName
,
'
parameters
'
:
{
'
parameters
'
:
{
'
key
'
:
resultCode
,
'
key
'
:
resultCode
,
'
terminate
'
:
true
'
terminate
'
:
true
}
}
}
}
}
}
}
await
featureAbility
.
startAbilityForResult
(
p
arameter
).
then
((
data
)
=>
{
await
featureAbility
.
startAbilityForResult
(
startAbilityP
arameter
).
then
((
data
)
=>
{
console
.
log
(
'
testAblity1900 data:
'
+
JSON
.
stringify
(
data
))
console
.
log
(
'
testAblity1900 data:
'
+
JSON
.
stringify
(
data
))
expect
.
assertFail
()
expect
.
assertFail
()
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
...
@@ -392,19 +381,17 @@ describe('ConnectAbilityTest', function () {
...
@@ -392,19 +381,17 @@ describe('ConnectAbilityTest', function () {
* @tc.desc: startAbilityForResult-wrong input parameter format want a layer outside.(by callback)
* @tc.desc: startAbilityForResult-wrong input parameter format want a layer outside.(by callback)
*/
*/
it
(
"
SUB_AA_JsApi_Ability_2000
"
,
0
,
async
function
(
done
)
{
it
(
"
SUB_AA_JsApi_Ability_2000
"
,
0
,
async
function
(
done
)
{
let
parameter
=
{
let
startAbilityParameter
=
{
'
StartAbilityParameter
'
:
{
'
want
'
:
{
'
want
'
:
{
'
bundleName
'
:
bundleName
,
'
bundleName
'
:
bundleName
,
'
abilityName
'
:
mainAbilityName
,
'
abilityName
'
:
mainAbilityName
,
'
parameters
'
:
{
'
parameters
'
:
{
'
key
'
:
resultCode
,
'
key
'
:
resultCode
,
'
terminate
'
:
true
'
terminate
'
:
true
}
}
}
}
}
}
}
featureAbility
.
startAbilityForResult
(
p
arameter
,
(
error
,
data
)
=>
{
featureAbility
.
startAbilityForResult
(
startAbilityP
arameter
,
(
error
,
data
)
=>
{
console
.
log
(
'
testAblity2000
'
+
JSON
.
stringify
(
error
));
console
.
log
(
'
testAblity2000
'
+
JSON
.
stringify
(
error
));
expect
(
errCode
).
assertEqual
(
error
.
code
)
expect
(
errCode
).
assertEqual
(
error
.
code
)
done
()
done
()
...
...
ability/ability_runtime/formmanager/fa/formhostst_ets/formsystemhoste/entry/src/main/ets/MainAbility/pages/index.ets
浏览文件 @
376f0caa
...
@@ -191,7 +191,7 @@ struct Index {
...
@@ -191,7 +191,7 @@ struct Index {
commonEvent.publish(this.formOnDynamicRefreshEvent, commonEventPublishData, this.formOnDynamicRefreshCallBack);
commonEvent.publish(this.formOnDynamicRefreshEvent, commonEventPublishData, this.formOnDynamicRefreshCallBack);
})
})
.catch((error) => {
.catch((error) => {
console.info('formsystemhost refreshForm error:' +
error
);
console.info('formsystemhost refreshForm error:' +
JSON.stringify(error)
);
let commonEventPublishData = {
let commonEventPublishData = {
data: error.code.toString(),
data: error.code.toString(),
parameters: {
parameters: {
...
...
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest/entry/src/main/ets/MainAbility/test/FmsAcquireForm.test.ets
浏览文件 @
376f0caa
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
import
featureAbility
from
"@ohos.ability.featureAbility"
;
import
featureAbility
from
"@ohos.ability.featureAbility"
;
import
commonEvent
from
'@ohos.commonEvent'
;
import
commonEvent
from
'@ohos.commonEvent'
;
import
{
beforeEach
,
describe
,
expect
,
it
}
from
"deccjsunit/index"
;
import
{
beforeEach
,
afterEach
,
describe
,
expect
,
it
}
from
"deccjsunit/index"
;
var
onErrorForm_Event
=
{
var
onErrorForm_Event
=
{
events
:
[
"FMS_FormOnError_commonEvent"
],
events
:
[
"FMS_FormOnError_commonEvent"
],
...
@@ -30,6 +30,10 @@ var onSupplyEvent = {
...
@@ -30,6 +30,10 @@ var onSupplyEvent = {
events
:
[
"FMS_FormSupply_commonEvent"
],
events
:
[
"FMS_FormSupply_commonEvent"
],
};
};
const
unsubscribeCallback
=
(
tcNumber
)
=>
{
console
.
info
(
`====>${tcNumber} unsubscribeCallback====>`
);
}
var
deleteForm_Event
=
"FMS_FormDelete_commonEvent"
;
var
deleteForm_Event
=
"FMS_FormDelete_commonEvent"
;
var
subscriberOnError
;
var
subscriberOnError
;
...
@@ -48,6 +52,14 @@ export default function test() {
...
@@ -48,6 +52,14 @@ export default function test() {
await
sleep
(
1000
);
await
sleep
(
1000
);
})
})
afterEach
(
async
()
=>
{
commonEvent
.
unsubscribe
(
subscriberOnError
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnError"
));
commonEvent
.
unsubscribe
(
subscriberOnAcquired
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnAcquired"
));
commonEvent
.
unsubscribe
(
subscriberCast
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberCast"
));
commonEvent
.
unsubscribe
(
subscriberSupply
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberSupply"
));
await
sleep
(
1000
);
})
/**
/**
* @tc.number: FMS_acquireForm_0200
* @tc.number: FMS_acquireForm_0200
* @tc.name: The form host does not have permission to use the form
* @tc.name: The form host does not have permission to use the form
...
...
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/test/FmsAcquireForm2.test.ets
浏览文件 @
376f0caa
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
import featureAbility from "@ohos.ability.featureAbility";
import featureAbility from "@ohos.ability.featureAbility";
import commonEvent from '@ohos.commonEvent';
import commonEvent from '@ohos.commonEvent';
import { beforeEach, describe, expect, it } from "deccjsunit/index";
import { beforeEach,
afterEach,
describe, expect, it } from "deccjsunit/index";
var onErrorForm_Event = {
var onErrorForm_Event = {
events: ["FMS_FormOnError_commonEvent"],
events: ["FMS_FormOnError_commonEvent"],
...
@@ -30,6 +30,10 @@ var onSupplyEvent = {
...
@@ -30,6 +30,10 @@ var onSupplyEvent = {
events: ["FMS_FormSupply_commonEvent"],
events: ["FMS_FormSupply_commonEvent"],
};
};
const unsubscribeCallback = (tcNumber) => {
console.info(`====>${tcNumber} unsubscribeCallback====>`);
}
var deleteForm_Event = "FMS_FormDelete_commonEvent";
var deleteForm_Event = "FMS_FormDelete_commonEvent";
var subscriberOnError;
var subscriberOnError;
...
@@ -37,6 +41,10 @@ var subscriberOnAcquired;
...
@@ -37,6 +41,10 @@ var subscriberOnAcquired;
var subscriberCast;
var subscriberCast;
var subscriberSupply;
var subscriberSupply;
function sleep(time) {
return new Promise((resolve)=>setTimeout(resolve,time));
}
export default function test() {
export default function test() {
describe(`FmsAcquiredFormTest2`, () => {
describe(`FmsAcquiredFormTest2`, () => {
...
@@ -47,6 +55,14 @@ export default function test() {
...
@@ -47,6 +55,14 @@ export default function test() {
subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent);
subscriberSupply = await commonEvent.createSubscriber(onSupplyEvent);
})
})
afterEach(async() => {
commonEvent.unsubscribe(subscriberOnError, () => unsubscribeCallback("afterEach unsubscribe subscriberOnError"));
commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeCallback("afterEach unsubscribe subscriberOnAcquired"));
commonEvent.unsubscribe(subscriberCast, () => unsubscribeCallback("afterEach unsubscribe subscriberCast"));
commonEvent.unsubscribe(subscriberSupply, () => unsubscribeCallback("afterEach unsubscribe subscriberSupply"));
await sleep(1000);
})
/**
/**
* @tc.number: FMS_acquireForm_3800
* @tc.number: FMS_acquireForm_3800
* @tc.name: Failed to add form when parameter ability is wrong.
* @tc.name: Failed to add form when parameter ability is wrong.
...
...
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/Test.json
浏览文件 @
376f0caa
...
@@ -18,6 +18,13 @@
...
@@ -18,6 +18,13 @@
],
],
"type"
:
"AppInstallKit"
,
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"power-shell wakeup"
,
"power-shell setmode 602"
]
}
}
]
]
}
}
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/test/FmsDeleteForm.test.ets
浏览文件 @
376f0caa
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
import
featureAbility
from
'@ohos.ability.featureAbility'
;
import
featureAbility
from
'@ohos.ability.featureAbility'
;
import
commonEvent
from
'@ohos.commonEvent'
;
import
commonEvent
from
'@ohos.commonEvent'
;
import
systemTime
from
'@ohos.systemTime'
;
import
systemTime
from
'@ohos.systemTime'
;
import
{
beforeEach
,
describe
,
expect
,
it
}
from
'deccjsunit/index'
;
import
{
beforeEach
,
afterEach
,
describe
,
expect
,
it
}
from
'deccjsunit/index'
;
const
onAcquiredForm_Event
=
{
const
onAcquiredForm_Event
=
{
events
:
[
"FMS_FormOnAcquired_commonEvent"
],
events
:
[
"FMS_FormOnAcquired_commonEvent"
],
...
@@ -31,6 +31,10 @@ const onSupplyEvent = {
...
@@ -31,6 +31,10 @@ const onSupplyEvent = {
events
:
[
"FMS_FormSupply_commonEvent"
],
events
:
[
"FMS_FormSupply_commonEvent"
],
};
};
const
unsubscribeCallback
=
(
tcNumber
)
=>
{
console
.
info
(
`====>${tcNumber} unsubscribeCallback====>`
);
}
const
deleteForm_Event
=
"FMS_FormDelete_commonEvent"
;
const
deleteForm_Event
=
"FMS_FormDelete_commonEvent"
;
let
subscriberOnAcquired
;
let
subscriberOnAcquired
;
...
@@ -49,6 +53,14 @@ export default function test() {
...
@@ -49,6 +53,14 @@ export default function test() {
await
sleep
(
1000
);
await
sleep
(
1000
);
});
});
afterEach
(
async
()
=>
{
commonEvent
.
unsubscribe
(
subscriberOnAcquired
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnAcquired"
));
commonEvent
.
unsubscribe
(
subscriberOnReleased
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnReleased"
));
commonEvent
.
unsubscribe
(
subscriberOnDeleted
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnDeleted"
));
commonEvent
.
unsubscribe
(
subscriberSupply
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberSupply"
));
await
sleep
(
1000
);
})
/**
/**
* @tc.number: FMS_deleteForm_0200
* @tc.number: FMS_deleteForm_0200
* @tc.name: host does not have permission
* @tc.name: host does not have permission
...
...
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/test/FmsDynamicRefreshForm.test.ets
浏览文件 @
376f0caa
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
import featureAbility from '@ohos.ability.featureAbility';
import featureAbility from '@ohos.ability.featureAbility';
import commonEvent from '@ohos.commonEvent';
import commonEvent from '@ohos.commonEvent';
import { beforeEach, describe, expect, it } from 'deccjsunit/index';
import { beforeEach,
afterEach,
describe, expect, it } from 'deccjsunit/index';
const onAcquiredForm_Event = {
const onAcquiredForm_Event = {
events: ["FMS_FormOnAcquired_commonEvent"],
events: ["FMS_FormOnAcquired_commonEvent"],
...
@@ -33,6 +33,10 @@ const onSupplyEvent = {
...
@@ -33,6 +33,10 @@ const onSupplyEvent = {
events: ["FMS_FormSupply_commonEvent"],
events: ["FMS_FormSupply_commonEvent"],
};
};
const unsubscribeCallback = (tcNumber) => {
console.info(`====>${tcNumber} unsubscribeCallback====>`);
}
const deleteForm_Event = "FMS_FormDelete_commonEvent";
const deleteForm_Event = "FMS_FormDelete_commonEvent";
let subscriberOnAcquired;
let subscriberOnAcquired;
...
@@ -51,6 +55,14 @@ export default function test() {
...
@@ -51,6 +55,14 @@ export default function test() {
await sleep(1000);
await sleep(1000);
});
});
afterEach(async() => {
commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeCallback("afterEach unsubscribe subscriberOnAcquired"));
commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeCallback("afterEach unsubscribe subscriberOnDeleted"));
commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeCallback("afterEach unsubscribe subscriberOnRefresh"));
commonEvent.unsubscribe(subscriberSupply, () => unsubscribeCallback("afterEach unsubscribe subscriberSupply"));
await sleep(1000);
})
/**
/**
* @tc.number: FMS_timedRefresh_0100
* @tc.number: FMS_timedRefresh_0100
* @tc.name: formID id is error(formID < 0)
* @tc.name: formID id is error(formID < 0)
...
...
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets
浏览文件 @
376f0caa
...
@@ -62,12 +62,12 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
...
@@ -62,12 +62,12 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
tempDataC = dataC[0];
tempDataC = dataC[0];
expect(error.code).assertEqual(ERR_OK_CODE);
expect(error.code).assertEqual(ERR_OK_CODE);
expect(error.message).assertEqual(ERR_OK);
expect(error.message).assertEqual(ERR_OK);
console.log(`==========${callbackName} ${describeName} end==========`);
});
});
await sleep(2000)
await sleep(2000)
checkDataB(tempDataB)
checkDataB(tempDataB)
checkDataC(tempDataC)
checkDataC(tempDataC)
done();
done();
console.log(`==========${callbackName} ${describeName} end==========`);
} catch (error) {
} catch (error) {
console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`);
console.log(`${callbackName} exception caught: ${JSON.stringify(error)})`);
console.log(`${callbackName} should not reach here`);
console.log(`${callbackName} should not reach here`);
...
@@ -104,7 +104,8 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
...
@@ -104,7 +104,8 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
expect(dataC.length).assertEqual(1);
expect(dataC.length).assertEqual(1);
tempDataB = dataB[0];
tempDataB = dataB[0];
tempDataC = dataC[0];
tempDataC = dataC[0];
checkDataB(tempDataB)
checkDataC(tempDataC)
done();
done();
console.log(`==========${promiseName} ${describeName} end==========`);
console.log(`==========${promiseName} ${describeName} end==========`);
} catch (error) {
} catch (error) {
...
@@ -126,15 +127,14 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
...
@@ -126,15 +127,14 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
expect(formInfo.isDefault).assertTrue()
expect(formInfo.isDefault).assertTrue()
expect(formInfo.updateEnabled).assertTrue()
expect(formInfo.updateEnabled).assertTrue()
expect(formInfo.formVisibleNotify).assertTrue()
expect(formInfo.formVisibleNotify).assertTrue()
expect(
undefined
).assertEqual(formInfo.relatedBundleName)
expect(
''
).assertEqual(formInfo.relatedBundleName)
expect("abilityb").assertEqual(formInfo.formConfigAbility)
expect("abilityb").assertEqual(formInfo.formConfigAbility)
expect(3).assertEqual(formInfo.updateDuration)
expect(3).assertEqual(formInfo.updateDuration)
expect(2).assertEqual(formInfo.defaultDimension)
expect(2).assertEqual(formInfo.defaultDimension)
expect('10:30').assertEqual(formInfo.scheduledUpdateTime)
expect('10:30').assertEqual(formInfo.scheduledUpdateTime)
expect(1).assertEqual(formInfo.supportDimensions[0])
expect(1).assertEqual(formInfo.supportDimensions[0])
expect(2).assertEqual(formInfo.supportDimensions[1])
expect(2).assertEqual(formInfo.supportDimensions[1])
expect('originWidgetNameB').assertEqual(formInfo.customizeData[0].name)
expect('valueB').assertEqual(formInfo.customizeData.originWidgetNameB)
expect('valueB').assertEqual(formInfo.customizeData[0].value)
}
}
function checkDataC(formInfo){
function checkDataC(formInfo){
expect("com.ohos.st.formsystemproviderc").assertEqual(formInfo.bundleName)
expect("com.ohos.st.formsystemproviderc").assertEqual(formInfo.bundleName)
...
@@ -148,15 +148,14 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
...
@@ -148,15 +148,14 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
expect(formInfo.isDefault).assertTrue()
expect(formInfo.isDefault).assertTrue()
expect(formInfo.updateEnabled).assertTrue()
expect(formInfo.updateEnabled).assertTrue()
expect(formInfo.formVisibleNotify).assertTrue()
expect(formInfo.formVisibleNotify).assertTrue()
expect(
undefined
).assertEqual(formInfo.relatedBundleName)
expect(
''
).assertEqual(formInfo.relatedBundleName)
expect("abilityc").assertEqual(formInfo.formConfigAbility)
expect("abilityc").assertEqual(formInfo.formConfigAbility)
expect(4).assertEqual(formInfo.updateDuration)
expect(4).assertEqual(formInfo.updateDuration)
expect('15:30').assertEqual(formInfo.scheduledUpdateTime)
expect('15:30').assertEqual(formInfo.scheduledUpdateTime)
expect(3).assertEqual(formInfo.defaultDimension)
expect(3).assertEqual(formInfo.defaultDimension)
expect(3).assertEqual(formInfo.supportDimensions[0])
expect(3).assertEqual(formInfo.supportDimensions[0])
expect(4).assertEqual(formInfo.supportDimensions[1])
expect(4).assertEqual(formInfo.supportDimensions[1])
expect('originWidgetNameC').assertEqual(formInfo.customizeData[0].name)
expect('valueC').assertEqual(formInfo.customizeData.originWidgetNameC)
expect('valueC').assertEqual(formInfo.customizeData[0].value)
}
}
});
});
};
};
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandonetest/entry/src/main/ets/MainAbility/test/GetFormsInfo.test.ets
浏览文件 @
376f0caa
...
@@ -236,15 +236,14 @@ export const getFormsInfoTest = (describeName, filterParameter) => {
...
@@ -236,15 +236,14 @@ export const getFormsInfoTest = (describeName, filterParameter) => {
expect(formInfo.isDefault).assertTrue()
expect(formInfo.isDefault).assertTrue()
expect(formInfo.updateEnabled).assertTrue()
expect(formInfo.updateEnabled).assertTrue()
expect(formInfo.formVisibleNotify).assertTrue()
expect(formInfo.formVisibleNotify).assertTrue()
expect(
undefined
).assertEqual(formInfo.relatedBundleName)
expect(
''
).assertEqual(formInfo.relatedBundleName)
expect("abilityb").assertEqual(formInfo.formConfigAbility)
expect("abilityb").assertEqual(formInfo.formConfigAbility)
expect(3).assertEqual(formInfo.updateDuration)
expect(3).assertEqual(formInfo.updateDuration)
expect(2).assertEqual(formInfo.defaultDimension)
expect(2).assertEqual(formInfo.defaultDimension)
expect('10:30').assertEqual(formInfo.scheduledUpdateTime)
expect('10:30').assertEqual(formInfo.scheduledUpdateTime)
expect(1).assertEqual(formInfo.supportDimensions[0])
expect(1).assertEqual(formInfo.supportDimensions[0])
expect(2).assertEqual(formInfo.supportDimensions[1])
expect(2).assertEqual(formInfo.supportDimensions[1])
expect('originWidgetNameB').assertEqual(formInfo.customizeData[0].name)
expect('valueB').assertEqual(formInfo.customizeData.originWidgetNameB)
expect('valueB').assertEqual(formInfo.customizeData[0].value)
}
}
/**
/**
...
@@ -517,14 +516,13 @@ export const getFormsInfoTest = (describeName, filterParameter) => {
...
@@ -517,14 +516,13 @@ export const getFormsInfoTest = (describeName, filterParameter) => {
expect(formInfo.isDefault).assertTrue()
expect(formInfo.isDefault).assertTrue()
expect(formInfo.updateEnabled).assertTrue()
expect(formInfo.updateEnabled).assertTrue()
expect(formInfo.formVisibleNotify).assertTrue()
expect(formInfo.formVisibleNotify).assertTrue()
expect(
undefined
).assertEqual(formInfo.relatedBundleName)
expect(
''
).assertEqual(formInfo.relatedBundleName)
expect("abilityc").assertEqual(formInfo.formConfigAbility)
expect("abilityc").assertEqual(formInfo.formConfigAbility)
expect(4).assertEqual(formInfo.updateDuration)
expect(4).assertEqual(formInfo.updateDuration)
expect(3).assertEqual(formInfo.defaultDimension)
expect(3).assertEqual(formInfo.defaultDimension)
expect(3).assertEqual(formInfo.supportDimensions[0])
expect(3).assertEqual(formInfo.supportDimensions[0])
expect(4).assertEqual(formInfo.supportDimensions[1])
expect(4).assertEqual(formInfo.supportDimensions[1])
expect('originWidgetNameC').assertEqual(formInfo.customizeData[0].name)
expect('valueC').assertEqual(formInfo.customizeData.originWidgetNameC)
expect('valueC').assertEqual(formInfo.customizeData[0].value)
}
}
});
});
};
};
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandtwotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets
浏览文件 @
376f0caa
...
@@ -132,15 +132,14 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
...
@@ -132,15 +132,14 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
expect(formInfo.isDefault).assertTrue()
expect(formInfo.isDefault).assertTrue()
expect(formInfo.updateEnabled).assertTrue()
expect(formInfo.updateEnabled).assertTrue()
expect(formInfo.formVisibleNotify).assertTrue()
expect(formInfo.formVisibleNotify).assertTrue()
expect(
undefined
).assertEqual(formInfo.relatedBundleName)
expect(
''
).assertEqual(formInfo.relatedBundleName)
expect("abilityb").assertEqual(formInfo.formConfigAbility)
expect("abilityb").assertEqual(formInfo.formConfigAbility)
expect(3).assertEqual(formInfo.updateDuration)
expect(3).assertEqual(formInfo.updateDuration)
expect(2).assertEqual(formInfo.defaultDimension)
expect(2).assertEqual(formInfo.defaultDimension)
expect('10:30').assertEqual(formInfo.scheduledUpdateTime)
expect('10:30').assertEqual(formInfo.scheduledUpdateTime)
expect(1).assertEqual(formInfo.supportDimensions[0])
expect(1).assertEqual(formInfo.supportDimensions[0])
expect(2).assertEqual(formInfo.supportDimensions[1])
expect(2).assertEqual(formInfo.supportDimensions[1])
expect('originWidgetNameB').assertEqual(formInfo.customizeData[0].name)
expect('valueB').assertEqual(formInfo.customizeData.originWidgetNameB)
expect('valueB').assertEqual(formInfo.customizeData[0].value)
}
}
function checkDataA1(formInfo){
function checkDataA1(formInfo){
...
@@ -155,15 +154,14 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
...
@@ -155,15 +154,14 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
expect(formInfo.isDefault).assertTrue()
expect(formInfo.isDefault).assertTrue()
expect(formInfo.updateEnabled).assertTrue()
expect(formInfo.updateEnabled).assertTrue()
expect(formInfo.formVisibleNotify).assertTrue()
expect(formInfo.formVisibleNotify).assertTrue()
expect(
undefined
).assertEqual(formInfo.relatedBundleName)
expect(
''
).assertEqual(formInfo.relatedBundleName)
expect("abilitya01").assertEqual(formInfo.formConfigAbility)
expect("abilitya01").assertEqual(formInfo.formConfigAbility)
expect(1).assertEqual(formInfo.updateDuration)
expect(1).assertEqual(formInfo.updateDuration)
expect(1).assertEqual(formInfo.defaultDimension)
expect(1).assertEqual(formInfo.defaultDimension)
expect('5:30').assertEqual(formInfo.scheduledUpdateTime)
expect('5:30').assertEqual(formInfo.scheduledUpdateTime)
expect(1).assertEqual(formInfo.supportDimensions[0])
expect(1).assertEqual(formInfo.supportDimensions[0])
expect(3).assertEqual(formInfo.supportDimensions[1])
expect(3).assertEqual(formInfo.supportDimensions[1])
expect('originWidgetNameA01').assertEqual(formInfo.customizeData[0].name)
expect('valueA01').assertEqual(formInfo.customizeData.originWidgetNameA01)
expect('valueA01').assertEqual(formInfo.customizeData[0].value)
}
}
function checkDataA2(formInfo){
function checkDataA2(formInfo){
...
@@ -178,7 +176,7 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
...
@@ -178,7 +176,7 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
expect(formInfo.isDefault).assertFalse()
expect(formInfo.isDefault).assertFalse()
expect(formInfo.updateEnabled).assertFalse()
expect(formInfo.updateEnabled).assertFalse()
expect(formInfo.formVisibleNotify).assertFalse()
expect(formInfo.formVisibleNotify).assertFalse()
expect(
undefined
).assertEqual(formInfo.relatedBundleName)
expect(
''
).assertEqual(formInfo.relatedBundleName)
expect("abilitya02").assertEqual(formInfo.formConfigAbility)
expect("abilitya02").assertEqual(formInfo.formConfigAbility)
expect(2).assertEqual(formInfo.updateDuration)
expect(2).assertEqual(formInfo.updateDuration)
expect(4).assertEqual(formInfo.defaultDimension)
expect(4).assertEqual(formInfo.defaultDimension)
...
@@ -187,8 +185,7 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
...
@@ -187,8 +185,7 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
expect(2).assertEqual(formInfo.supportDimensions[1])
expect(2).assertEqual(formInfo.supportDimensions[1])
expect(3).assertEqual(formInfo.supportDimensions[2])
expect(3).assertEqual(formInfo.supportDimensions[2])
expect(4).assertEqual(formInfo.supportDimensions[3])
expect(4).assertEqual(formInfo.supportDimensions[3])
expect('originWidgetNameA02').assertEqual(formInfo.customizeData[0].name)
expect('valueA02').assertEqual(formInfo.customizeData.originWidgetNameA02)
expect('valueA02').assertEqual(formInfo.customizeData[0].value)
}
}
});
});
};
};
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formgetformsinfotest/formsoneandzerotest/entry/src/main/ets/MainAbility/test/GetAllFormsInfo.test.ets
浏览文件 @
376f0caa
...
@@ -122,15 +122,14 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
...
@@ -122,15 +122,14 @@ export const getAllFormsInfoTest = (describeName, filterParameter) => {
expect(formInfo.isDefault).assertTrue()
expect(formInfo.isDefault).assertTrue()
expect(formInfo.updateEnabled).assertTrue()
expect(formInfo.updateEnabled).assertTrue()
expect(formInfo.formVisibleNotify).assertTrue()
expect(formInfo.formVisibleNotify).assertTrue()
expect(
undefined
).assertEqual(formInfo.relatedBundleName)
expect(
''
).assertEqual(formInfo.relatedBundleName)
expect("abilityb").assertEqual(formInfo.formConfigAbility)
expect("abilityb").assertEqual(formInfo.formConfigAbility)
expect(3).assertEqual(formInfo.updateDuration)
expect(3).assertEqual(formInfo.updateDuration)
expect(2).assertEqual(formInfo.defaultDimension)
expect(2).assertEqual(formInfo.defaultDimension)
expect('10:30').assertEqual(formInfo.scheduledUpdateTime)
expect('10:30').assertEqual(formInfo.scheduledUpdateTime)
expect(1).assertEqual(formInfo.supportDimensions[0])
expect(1).assertEqual(formInfo.supportDimensions[0])
expect(2).assertEqual(formInfo.supportDimensions[1])
expect(2).assertEqual(formInfo.supportDimensions[1])
expect('originWidgetNameB').assertEqual(formInfo.customizeData[0].name)
expect('valueB').assertEqual(formInfo.customizeData.originWidgetNameB)
expect('valueB').assertEqual(formInfo.customizeData[0].value)
}
}
});
});
};
};
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formhostdeathrecipienttest/entry/src/main/ets/MainAbility/test/FmsHostDeathRecipient.test.ets
浏览文件 @
376f0caa
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
import featureAbility from '@ohos.ability.featureAbility';
import featureAbility from '@ohos.ability.featureAbility';
import commonEvent from '@ohos.commonEvent';
import commonEvent from '@ohos.commonEvent';
import { beforeEach, describe, expect, it } from 'deccjsunit/index';
import { beforeEach,
afterEach,
describe, expect, it } from 'deccjsunit/index';
const onAcquiredEvent = {
const onAcquiredEvent = {
events: [`FMS_FormOnAcquired_commonEvent`],
events: [`FMS_FormOnAcquired_commonEvent`],
...
@@ -28,6 +28,11 @@ const onRequestEvent = {
...
@@ -28,6 +28,11 @@ const onRequestEvent = {
};
};
const formOnTerminateEvent = `FMS_FormTerminate_commonEvent`;
const formOnTerminateEvent = `FMS_FormTerminate_commonEvent`;
const unsubscribeCallback = (tcNumber) => {
console.info(`====>${tcNumber} unsubscribeCallback====>`);
}
let tcNumber;
let tcNumber;
let hostCounter;
let hostCounter;
let providerCounter;
let providerCounter;
...
@@ -47,6 +52,13 @@ export default function test() {
...
@@ -47,6 +52,13 @@ export default function test() {
onRequestEventSubscriber = await commonEvent.createSubscriber(onRequestEvent);
onRequestEventSubscriber = await commonEvent.createSubscriber(onRequestEvent);
});
});
afterEach(async() => {
commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeCallback("afterEach unsubscribe onAcquiredEventSubscriber"));
commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeCallback("afterEach unsubscribe onSupplyEventSubscriber"));
commonEvent.unsubscribe(onRequestEventSubscriber, () => unsubscribeCallback("afterEach unsubscribe onRequestEventSubscriber"));
await sleep(1000);
})
/**
/**
* @tc.number: FMS_hostDeathRecipient_0200
* @tc.number: FMS_hostDeathRecipient_0200
* @tc.name: Reset host ability and requestForm.
* @tc.name: Reset host ability and requestForm.
...
...
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/Test.json
浏览文件 @
376f0caa
...
@@ -15,6 +15,13 @@
...
@@ -15,6 +15,13 @@
],
],
"type"
:
"AppInstallKit"
,
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"power-shell wakeup"
,
"power-shell setmode 602"
]
}
}
]
]
}
}
\ No newline at end of file
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formperformancetest/entry/src/main/ets/MainAbility/test/FmsPerformanceTest.test.ets
浏览文件 @
376f0caa
...
@@ -17,7 +17,7 @@ import featureAbility from '@ohos.ability.featureAbility';
...
@@ -17,7 +17,7 @@ import featureAbility from '@ohos.ability.featureAbility';
import formHost from '@ohos.application.formHost';
import formHost from '@ohos.application.formHost';
import commonEvent from '@ohos.commonEvent';
import commonEvent from '@ohos.commonEvent';
import systemTime from '@ohos.systemTime';
import systemTime from '@ohos.systemTime';
import { beforeEach, describe, expect, it } from 'deccjsunit/index';
import { beforeEach,
afterEach,
describe, expect, it } from 'deccjsunit/index';
const onAcquiredEvent = {
const onAcquiredEvent = {
events: [`FMS_FormOnAcquired_commonEvent`],
events: [`FMS_FormOnAcquired_commonEvent`],
...
@@ -38,9 +38,17 @@ const publishOnDeleteCallback = (tcNumber, done) => {
...
@@ -38,9 +38,17 @@ const publishOnDeleteCallback = (tcNumber, done) => {
done();
done();
}
}
const unsubscribeCallback = (tcNumber) => {
console.info(`====>${tcNumber} unsubscribeCallback====>`);
}
let onAcquiredEventSubscriber;
let onAcquiredEventSubscriber;
let onSupplyEventSubscriber;
let onSupplyEventSubscriber;
function sleep(time) {
return new Promise((resolve)=>setTimeout(resolve,time));
}
export default function test() {
export default function test() {
describe(`FmsPerformanceTest`, () => {
describe(`FmsPerformanceTest`, () => {
...
@@ -49,6 +57,12 @@ export default function test() {
...
@@ -49,6 +57,12 @@ export default function test() {
onSupplyEventSubscriber = await commonEvent.createSubscriber(onSupplyEvent);
onSupplyEventSubscriber = await commonEvent.createSubscriber(onSupplyEvent);
});
});
afterEach(async() => {
commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeCallback("afterEach unsubscribe onAcquiredEventSubscriber"));
commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeCallback("afterEach unsubscribe onSupplyEventSubscriber"));
await sleep(1000);
})
/**
/**
* @tc.number: FMS_performanceTest_0100
* @tc.number: FMS_performanceTest_0100
* @tc.name: Performance test.
* @tc.name: Performance test.
...
...
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formreleasetest/entry/src/main/ets/MainAbility/test/FmsReleaseForm.test.ets
浏览文件 @
376f0caa
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
import
featureAbility
from
"@ohos.ability.featureAbility"
;
import
featureAbility
from
"@ohos.ability.featureAbility"
;
import
commonEvent
from
'@ohos.commonEvent'
;
import
commonEvent
from
'@ohos.commonEvent'
;
import
{
beforeAll
,
beforeEach
,
describe
,
expect
,
it
}
from
"deccjsunit/index"
;
import
{
beforeAll
,
beforeEach
,
afterEach
,
describe
,
expect
,
it
}
from
"deccjsunit/index"
;
var
onAcquiredForm_Event
=
{
var
onAcquiredForm_Event
=
{
events
:
[
"FMS_FormOnAcquired_commonEvent"
],
events
:
[
"FMS_FormOnAcquired_commonEvent"
],
...
@@ -28,6 +28,10 @@ var onReleasedFormEvent = {
...
@@ -28,6 +28,10 @@ var onReleasedFormEvent = {
};
};
var
deleteForm_Event
=
"FMS_FormDelete_commonEvent"
;
var
deleteForm_Event
=
"FMS_FormDelete_commonEvent"
;
const
unsubscribeCallback
=
(
tcNumber
)
=>
{
console
.
info
(
`====>${tcNumber} unsubscribeCallback====>`
);
}
var
subscriberOnAcquired
;
var
subscriberOnAcquired
;
var
subscriberOnDeleted
;
var
subscriberOnDeleted
;
var
subscriberOnReleased
;
var
subscriberOnReleased
;
...
@@ -45,6 +49,14 @@ export default function test() {
...
@@ -45,6 +49,14 @@ export default function test() {
subscriberOnAcquired
=
await
commonEvent
.
createSubscriber
(
onAcquiredForm_Event
);
subscriberOnAcquired
=
await
commonEvent
.
createSubscriber
(
onAcquiredForm_Event
);
subscriberOnDeleted
=
await
commonEvent
.
createSubscriber
(
onDeletedFormEvent
);
subscriberOnDeleted
=
await
commonEvent
.
createSubscriber
(
onDeletedFormEvent
);
subscriberOnReleased
=
await
commonEvent
.
createSubscriber
(
onReleasedFormEvent
);
subscriberOnReleased
=
await
commonEvent
.
createSubscriber
(
onReleasedFormEvent
);
await
sleep
(
1000
);
})
afterEach
(
async
()
=>
{
commonEvent
.
unsubscribe
(
subscriberOnAcquired
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnAcquired"
));
commonEvent
.
unsubscribe
(
subscriberOnDeleted
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnDeleted"
));
commonEvent
.
unsubscribe
(
subscriberOnReleased
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnReleased"
));
await
sleep
(
1000
);
})
})
/**
/**
...
...
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_disable/entry/src/main/ets/MainAbility/test/FmsFormStateDisable.test.ets
浏览文件 @
376f0caa
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
import
featureAbility
from
"@ohos.ability.featureAbility"
;
import
featureAbility
from
"@ohos.ability.featureAbility"
;
import
commonEvent
from
'@ohos.commonEvent'
;
import
commonEvent
from
'@ohos.commonEvent'
;
import
{
beforeAll
,
beforeEach
,
describe
,
expect
,
it
}
from
"deccjsunit/index"
;
import
{
beforeAll
,
beforeEach
,
afterEach
,
describe
,
expect
,
it
}
from
"deccjsunit/index"
;
var
onAcquiredForm_Event
=
{
var
onAcquiredForm_Event
=
{
events
:
[
"FMS_FormOnAcquired_commonEvent"
],
events
:
[
"FMS_FormOnAcquired_commonEvent"
],
...
@@ -33,6 +33,10 @@ var onSupplyEvent = {
...
@@ -33,6 +33,10 @@ var onSupplyEvent = {
events
:
[
"FMS_FormSupply_commonEvent"
],
events
:
[
"FMS_FormSupply_commonEvent"
],
};
};
const
unsubscribeCallback
=
(
tcNumber
)
=>
{
console
.
info
(
`====>${tcNumber} unsubscribeCallback====>`
);
}
var
deleteForm_Event
=
"FMS_FormDelete_commonEvent"
;
var
deleteForm_Event
=
"FMS_FormDelete_commonEvent"
;
var
subscriberOnAcquired
;
var
subscriberOnAcquired
;
...
@@ -55,6 +59,14 @@ export default function test() {
...
@@ -55,6 +59,14 @@ export default function test() {
await
sleep
(
1000
);
await
sleep
(
1000
);
})
})
afterEach
(
async
()
=>
{
commonEvent
.
unsubscribe
(
subscriberOnAcquired
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnAcquired"
));
commonEvent
.
unsubscribe
(
subscriberDel
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberDel"
));
commonEvent
.
unsubscribe
(
subscriberOnState
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnState"
));
commonEvent
.
unsubscribe
(
subscriberSupply
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberSupply"
));
await
sleep
(
1000
);
})
/**
/**
* @tc.number: FMS_disableFormsUpdate_0200
* @tc.number: FMS_disableFormsUpdate_0200
* @tc.name: The form user does not have permission.
* @tc.name: The form user does not have permission.
...
...
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/Test.json
浏览文件 @
376f0caa
...
@@ -20,6 +20,13 @@
...
@@ -20,6 +20,13 @@
],
],
"type"
:
"AppInstallKit"
,
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"power-shell wakeup"
,
"power-shell setmode 602"
]
}
}
]
]
}
}
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_enable/entry/src/main/ets/MainAbility/test/FmsFormStateEnable.test.ets
浏览文件 @
376f0caa
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
import
featureAbility
from
"@ohos.ability.featureAbility"
;
import
featureAbility
from
"@ohos.ability.featureAbility"
;
import
commonEvent
from
'@ohos.commonEvent'
;
import
commonEvent
from
'@ohos.commonEvent'
;
import
{
beforeAll
,
beforeEach
,
describe
,
expect
,
it
}
from
"deccjsunit/index"
;
import
{
beforeAll
,
beforeEach
,
afterEach
,
describe
,
expect
,
it
}
from
"deccjsunit/index"
;
var
onAcquiredForm_Event
=
{
var
onAcquiredForm_Event
=
{
events
:
[
"FMS_FormOnAcquired_commonEvent"
],
events
:
[
"FMS_FormOnAcquired_commonEvent"
],
...
@@ -33,6 +33,10 @@ var onSupplyEvent = {
...
@@ -33,6 +33,10 @@ var onSupplyEvent = {
events
:
[
"FMS_FormSupply_commonEvent"
],
events
:
[
"FMS_FormSupply_commonEvent"
],
};
};
const
unsubscribeCallback
=
(
tcNumber
)
=>
{
console
.
info
(
`====>${tcNumber} unsubscribeCallback====>`
);
}
var
deleteForm_Event
=
"FMS_FormDelete_commonEvent"
;
var
deleteForm_Event
=
"FMS_FormDelete_commonEvent"
;
var
subscriberOnAcquired
;
var
subscriberOnAcquired
;
...
@@ -55,6 +59,13 @@ export default function test() {
...
@@ -55,6 +59,13 @@ export default function test() {
await
sleep
(
1000
);
await
sleep
(
1000
);
})
})
afterEach
(
async
()
=>
{
commonEvent
.
unsubscribe
(
subscriberOnAcquired
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnAcquired"
));
commonEvent
.
unsubscribe
(
subscriberDel
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberDel"
));
commonEvent
.
unsubscribe
(
subscriberOnState
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnState"
));
commonEvent
.
unsubscribe
(
subscriberSupply
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberSupply"
));
await
sleep
(
1000
);
})
/**
/**
* @tc.number: FMS_enableFormsUpdate_0200
* @tc.number: FMS_enableFormsUpdate_0200
* @tc.name: The form user does not have permission.
* @tc.name: The form user does not have permission.
...
...
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyInvisible.test.ets
浏览文件 @
376f0caa
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
import
featureAbility
from
"@ohos.ability.featureAbility"
;
import
featureAbility
from
"@ohos.ability.featureAbility"
;
import
commonEvent
from
'@ohos.commonEvent'
;
import
commonEvent
from
'@ohos.commonEvent'
;
import
{
describe
,
beforeEach
,
expect
,
it
}
from
"deccjsunit/index"
;
import
{
describe
,
afterEach
,
beforeEach
,
expect
,
it
}
from
"deccjsunit/index"
;
var
onAcquiredForm_Event
=
{
var
onAcquiredForm_Event
=
{
events
:
[
"FMS_FormOnAcquired_commonEvent"
],
events
:
[
"FMS_FormOnAcquired_commonEvent"
],
...
@@ -33,6 +33,10 @@ var onSupplyEvent = {
...
@@ -33,6 +33,10 @@ var onSupplyEvent = {
events
:
[
"FMS_FormSupply_commonEvent"
],
events
:
[
"FMS_FormSupply_commonEvent"
],
};
};
const
unsubscribeCallback
=
(
tcNumber
)
=>
{
console
.
info
(
`====>${tcNumber} unsubscribeCallback====>`
);
}
var
deleteForm_Event
=
"FMS_FormDelete_commonEvent"
;
var
deleteForm_Event
=
"FMS_FormDelete_commonEvent"
;
var
subscriberOnAcquired
;
var
subscriberOnAcquired
;
...
@@ -51,6 +55,13 @@ export default function test() {
...
@@ -51,6 +55,13 @@ export default function test() {
await
sleep
(
1000
);
await
sleep
(
1000
);
})
})
afterEach
(
async
()
=>
{
commonEvent
.
unsubscribe
(
subscriberOnAcquired
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnAcquired"
));
commonEvent
.
unsubscribe
(
subscriberDel
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberDel"
));
commonEvent
.
unsubscribe
(
subscriberOnState
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnState"
));
commonEvent
.
unsubscribe
(
subscriberSupply
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberSupply"
));
await
sleep
(
1000
);
})
/**
/**
* @tc.number: FMS_notifyInvisibleForms_0200
* @tc.number: FMS_notifyInvisibleForms_0200
* @tc.name: The form user does not have permission.
* @tc.name: The form user does not have permission.
...
...
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyinvisible2/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyInvisible2.test.ets
浏览文件 @
376f0caa
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
import
featureAbility
from
"@ohos.ability.featureAbility"
;
import
featureAbility
from
"@ohos.ability.featureAbility"
;
import
commonEvent
from
'@ohos.commonEvent'
;
import
commonEvent
from
'@ohos.commonEvent'
;
import
{
beforeEach
,
describe
,
expect
,
it
}
from
"deccjsunit/index"
;
import
{
beforeEach
,
afterEach
,
describe
,
expect
,
it
}
from
"deccjsunit/index"
;
var
onAcquiredForm_Event
=
{
var
onAcquiredForm_Event
=
{
events
:
[
"FMS_FormOnAcquired_commonEvent"
],
events
:
[
"FMS_FormOnAcquired_commonEvent"
],
...
@@ -29,6 +29,10 @@ var onSupplyEvent = {
...
@@ -29,6 +29,10 @@ var onSupplyEvent = {
events
:
[
"FMS_FormSupply_commonEvent"
],
events
:
[
"FMS_FormSupply_commonEvent"
],
};
};
const
unsubscribeCallback
=
(
tcNumber
)
=>
{
console
.
info
(
`====>${tcNumber} unsubscribeCallback====>`
);
}
var
deleteForm_Event
=
"FMS_FormDelete_commonEvent"
;
var
deleteForm_Event
=
"FMS_FormDelete_commonEvent"
;
var
subscriberOnAcquired
;
var
subscriberOnAcquired
;
...
@@ -46,6 +50,12 @@ export default function test() {
...
@@ -46,6 +50,12 @@ export default function test() {
await
sleep
(
1000
);
await
sleep
(
1000
);
})
})
afterEach
(
async
()
=>
{
commonEvent
.
unsubscribe
(
subscriberOnAcquired
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnAcquired"
));
commonEvent
.
unsubscribe
(
subscriberOnState
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnState"
));
commonEvent
.
unsubscribe
(
subscriberSupply
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberSupply"
));
await
sleep
(
1000
);
})
/**
/**
* @tc.number: FMS_notifyInvisibleForms_0900
* @tc.number: FMS_notifyInvisibleForms_0900
* @tc.name: There are correct and wrong formId in the form ID parameter list
* @tc.name: There are correct and wrong formId in the form ID parameter list
...
...
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstatetest_notifyvisible/entry/src/main/ets/MainAbility/test/FmsFormStateNotifyVisible.test.ets
浏览文件 @
376f0caa
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
import
featureAbility
from
"@ohos.ability.featureAbility"
;
import
featureAbility
from
"@ohos.ability.featureAbility"
;
import
commonEvent
from
'@ohos.commonEvent'
;
import
commonEvent
from
'@ohos.commonEvent'
;
import
{
beforeAll
,
beforeEach
,
describe
,
expect
,
it
}
from
"deccjsunit/index"
;
import
{
beforeAll
,
beforeEach
,
afterEach
,
describe
,
expect
,
it
}
from
"deccjsunit/index"
;
var
onAcquiredForm_Event
=
{
var
onAcquiredForm_Event
=
{
events
:
[
"FMS_FormOnAcquired_commonEvent"
],
events
:
[
"FMS_FormOnAcquired_commonEvent"
],
...
@@ -29,6 +29,10 @@ var onSupplyEvent = {
...
@@ -29,6 +29,10 @@ var onSupplyEvent = {
events
:
[
"FMS_FormSupply_commonEvent"
],
events
:
[
"FMS_FormSupply_commonEvent"
],
};
};
const
unsubscribeCallback
=
(
tcNumber
)
=>
{
console
.
info
(
`====>${tcNumber} unsubscribeCallback====>`
);
}
var
deleteForm_Event
=
"FMS_FormDelete_commonEvent"
;
var
deleteForm_Event
=
"FMS_FormDelete_commonEvent"
;
var
subscriberOnAcquired
;
var
subscriberOnAcquired
;
...
@@ -49,7 +53,12 @@ export default function test() {
...
@@ -49,7 +53,12 @@ export default function test() {
await
sleep
(
1000
);
await
sleep
(
1000
);
})
})
afterEach
(
async
()
=>
{
commonEvent
.
unsubscribe
(
subscriberOnAcquired
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnAcquired"
));
commonEvent
.
unsubscribe
(
subscriberOnState
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberOnState"
));
commonEvent
.
unsubscribe
(
subscriberSupply
,
()
=>
unsubscribeCallback
(
"afterEach unsubscribe subscriberSupply"
));
await
sleep
(
1000
);
})
/**
/**
* @tc.number: FMS_notifyVisibleForms_0200
* @tc.number: FMS_notifyVisibleForms_0200
* @tc.name: The form user does not have permission.
* @tc.name: The form user does not have permission.
...
...
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formstresstest/entry/src/main/ets/MainAbility/test/FmsStress.test.ets
浏览文件 @
376f0caa
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
import featureAbility from '@ohos.ability.featureAbility';
import featureAbility from '@ohos.ability.featureAbility';
import formHost from '@ohos.application.formHost';
import formHost from '@ohos.application.formHost';
import commonEvent from '@ohos.commonEvent';
import commonEvent from '@ohos.commonEvent';
import { beforeEach, describe, expect, it } from 'deccjsunit/index';
import { beforeEach,
afterEach,
describe, expect, it } from 'deccjsunit/index';
const onDeletedEvent = {
const onDeletedEvent = {
events: [`FMS_FormOnDeleted_commonEvent`]
events: [`FMS_FormOnDeleted_commonEvent`]
...
@@ -29,6 +29,10 @@ const onSupplyEvent = {
...
@@ -29,6 +29,10 @@ const onSupplyEvent = {
};
};
const formOnDeleteEvent = `FMS_FormDelete_commonEvent`;
const formOnDeleteEvent = `FMS_FormDelete_commonEvent`;
const unsubscribeCallback = (tcNumber) => {
console.info(`====>${tcNumber} unsubscribeCallback====>`);
}
const unsubscribeOnDeletedCallback = (tcNumber, done) => {
const unsubscribeOnDeletedCallback = (tcNumber, done) => {
console.info(`${tcNumber} unsubscribeOnDeleted Callback`);
console.info(`${tcNumber} unsubscribeOnDeleted Callback`);
done();
done();
...
@@ -47,6 +51,10 @@ let onDeletedEventSubscriber;
...
@@ -47,6 +51,10 @@ let onDeletedEventSubscriber;
let onAcquiredEventSubscriber;
let onAcquiredEventSubscriber;
let onSupplyEventSubscriber;
let onSupplyEventSubscriber;
function sleep(time) {
return new Promise((resolve)=>setTimeout(resolve,time));
}
export default function test() {
export default function test() {
describe(`FmsStressTest`, () => {
describe(`FmsStressTest`, () => {
...
@@ -56,6 +64,13 @@ export default function test() {
...
@@ -56,6 +64,13 @@ export default function test() {
onSupplyEventSubscriber = await commonEvent.createSubscriber(onSupplyEvent);
onSupplyEventSubscriber = await commonEvent.createSubscriber(onSupplyEvent);
});
});
afterEach(async() => {
commonEvent.unsubscribe(onDeletedEventSubscriber, () => unsubscribeCallback("afterEach unsubscribe onDeletedEventSubscriber"));
commonEvent.unsubscribe(onAcquiredEventSubscriber, () => unsubscribeCallback("afterEach unsubscribe onAcquiredEventSubscriber"));
commonEvent.unsubscribe(onSupplyEventSubscriber, () => unsubscribeCallback("afterEach unsubscribe onSupplyEventSubscriber"));
await sleep(1000);
})
const subscribeDeletedEvent = (tcNumber, expectedDeletedFormAmount, done) => {
const subscribeDeletedEvent = (tcNumber, expectedDeletedFormAmount, done) => {
commonEvent.subscribe(onDeletedEventSubscriber, async (err, data) => {
commonEvent.subscribe(onDeletedEventSubscriber, async (err, data) => {
const formIds = data.parameters.formIds;
const formIds = data.parameters.formIds;
...
@@ -594,7 +609,7 @@ export default function test() {
...
@@ -594,7 +609,7 @@ export default function test() {
const systemstatus = await formHost.isSystemReady();
const systemstatus = await formHost.isSystemReady();
console.info(`${tcNumber} systemstatus: ${JSON.stringify(systemstatus)}`);
console.info(`${tcNumber} systemstatus: ${JSON.stringify(systemstatus)}`);
expect(systemstatus).assertEqual(
0
);
expect(systemstatus).assertEqual(
undefined
);
done();
done();
});
});
});
});
...
...
ability/ability_runtime/formmanager/fa/formsystemtest_ets/formupdatefreshtest/entry/src/main/ets/MainAbility/test/FmsUpdateRefreshForm.test.ets
浏览文件 @
376f0caa
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
import featureAbility from "@ohos.ability.featureAbility";
import featureAbility from "@ohos.ability.featureAbility";
import commonEvent from '@ohos.commonEvent';
import commonEvent from '@ohos.commonEvent';
import { beforeAll, beforeEach, describe, expect, it } from "deccjsunit/index";
import { beforeAll, beforeEach,
afterEach,
describe, expect, it } from "deccjsunit/index";
var onAcquiredForm_Event = {
var onAcquiredForm_Event = {
events: ["FMS_FormOnAcquired_commonEvent"],
events: ["FMS_FormOnAcquired_commonEvent"],
...
@@ -30,6 +30,10 @@ var onRequestFormEvent = {
...
@@ -30,6 +30,10 @@ var onRequestFormEvent = {
events: ["FMS_FormOnRequest_commonEvent"],
events: ["FMS_FormOnRequest_commonEvent"],
};
};
const unsubscribeCallback = (tcNumber) => {
console.info(`====>${tcNumber} unsubscribeCallback====>`);
}
var deleteForm_Event = "FMS_FormDelete_commonEvent";
var deleteForm_Event = "FMS_FormDelete_commonEvent";
...
@@ -38,6 +42,10 @@ var subscriberOnDeleted;
...
@@ -38,6 +42,10 @@ var subscriberOnDeleted;
var subscriberOnRefresh;
var subscriberOnRefresh;
var subscriberOnRequest;
var subscriberOnRequest;
function sleep(time) {
return new Promise((resolve)=>setTimeout(resolve,time));
}
export default function test() {
export default function test() {
describe(`FmsUpdateRefreshFormTest`, () => {
describe(`FmsUpdateRefreshFormTest`, () => {
...
@@ -52,6 +60,13 @@ export default function test() {
...
@@ -52,6 +60,13 @@ export default function test() {
subscriberOnRequest = await commonEvent.createSubscriber(onRequestFormEvent);
subscriberOnRequest = await commonEvent.createSubscriber(onRequestFormEvent);
})
})
afterEach(async() => {
commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeCallback("afterEach unsubscribe subscriberOnAcquired"));
commonEvent.unsubscribe(subscriberOnDeleted, () => unsubscribeCallback("afterEach unsubscribe subscriberOnDeleted"));
commonEvent.unsubscribe(subscriberOnRefresh, () => unsubscribeCallback("afterEach unsubscribe subscriberOnRefresh"));
commonEvent.unsubscribe(subscriberOnRequest, () => unsubscribeCallback("afterEach unsubscribe subscriberOnRequest"));
await sleep(1000);
})
/**
/**
* @tc.number: FMS_updateForm_0100
* @tc.number: FMS_updateForm_0100
* @tc.name: formID id is error(formID < 0)
* @tc.name: formID id is error(formID < 0)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录