Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
d6d677f6
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看板
提交
d6d677f6
编写于
11月 27, 2021
作者:
Z
zhaoyuan17
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix sound&vibra visible config etc.
Signed-off-by:
N
zhaoyuan17
<
zhaoyuan17@huawei.com
>
上级
72172efa
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
873 addition
and
148 deletion
+873
-148
aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/test/ActsGetWantAllTest.js
...twantalltest/entry/src/main/js/test/ActsGetWantAllTest.js
+742
-0
notification/ans_standard/publish_test/BUILD.gn
notification/ans_standard/publish_test/BUILD.gn
+9
-4
notification/ans_standard/publish_test/publishsound/entry/src/main/config.json
...dard/publish_test/publishsound/entry/src/main/config.json
+61
-71
notification/ans_standard/publish_test/publishvibra/entry/src/main/config.json
...dard/publish_test/publishvibra/entry/src/main/config.json
+61
-73
未找到文件。
aafwk/aafwk_standard/want/actsgetwantalltest/entry/src/main/js/test/ActsGetWantAllTest.js
浏览文件 @
d6d677f6
...
...
@@ -241,4 +241,746 @@ describe('ActsGetWantTest', function () {
done
();
})
})
// @tc.number: ACTS_GetWant_0600
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it
(
'
ACTS_GetWant_0600
'
,
0
,
async
function
(
done
)
{
featureAbility
.
startAbilityForResult
({
want
:
{
deviceId
:
""
,
bundleName
:
"
com.example.actsgetwantalltesthap
"
,
abilityName
:
"
com.example.actsgetwantalltesthap.MainAbility
"
,
action
:
"
action1
"
,
entities
:
[
"
entity1
"
],
type
:
"
MIMETYPE
"
,
uri
:
"
key={true,true,false}
"
,
flags
:
wantConstant
.
Flags
.
FLAG_AUTH_READ_URI_PERMISSION
,
parameters
:
{
mykey0
:
0.1
,
mykey1
:
[
0.1
,
0.2
,
0.0000000003
],
mykey2
:
"
[a, b, c]
"
,
mykey3
:
"
str
"
,
mykey4
:
[
false
,
true
,
false
],
mykey5
:
[
"
str
"
,
"
STR
"
,
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
],
},
},
},
(
err
,
data
)
=>
{
console
.
info
(
'
====> ACTS_StartAbilityForResult_0600 start ability=====>
'
+
JSON
.
stringify
(
data
))
expect
(
data
.
want
.
deviceId
).
assertEqual
(
""
);
expect
(
data
.
want
.
bundleName
).
assertEqual
(
"
com.example.actsgetwantalltesthap
"
);
expect
(
data
.
want
.
abilityName
).
assertEqual
(
"
com.example.actsgetwantalltesthap.MainAbility
"
);
expect
(
data
.
want
.
action
).
assertEqual
(
"
action1
"
);
expect
(
data
.
want
.
entities
[
0
]).
assertEqual
(
"
entity1
"
);
expect
(
data
.
want
.
type
).
assertEqual
(
"
MIMETYPE
"
);
expect
(
data
.
want
.
uri
).
assertEqual
(
"
key={true,true,false}
"
);
expect
(
data
.
want
.
flags
).
assertEqual
(
wantConstant
.
Flags
.
FLAG_AUTH_READ_URI_PERMISSION
);
expect
(
data
.
want
.
parameters
.
mykey0
).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
0
]).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
1
]).
assertEqual
(
0.2
);
expect
(
data
.
want
.
parameters
.
mykey1
[
2
]).
assertEqual
(
0.0000000003
);
expect
(
data
.
want
.
parameters
.
mykey2
).
assertEqual
(
"
[a, b, c]
"
);
expect
(
data
.
want
.
parameters
.
mykey3
).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey4
[
0
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey4
[
1
]).
assertEqual
(
true
);
expect
(
data
.
want
.
parameters
.
mykey4
[
2
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey5
[
0
]).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
1
]).
assertEqual
(
"
STR
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
2
]).
assertEqual
(
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
);
console
.
info
(
'
====> before done=====>
'
)
done
();
})
})
// @tc.number: ACTS_GetWant_0700
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it
(
'
ACTS_GetWant_0700
'
,
0
,
async
function
(
done
)
{
featureAbility
.
startAbilityForResult
({
want
:
{
deviceId
:
""
,
bundleName
:
"
com.example.actsgetwantalltesthap
"
,
abilityName
:
"
com.example.actsgetwantalltesthap.MainAbility
"
,
action
:
"
action1
"
,
entities
:
[
"
entity1
"
],
type
:
"
MIMETYPE
"
,
uri
:
"
key={true,true,false}
"
,
flags
:
wantConstant
.
Flags
.
FLAG_AUTH_WRITE_URI_PERMISSION
,
parameters
:
{
mykey0
:
0.1
,
mykey1
:
[
0.1
,
0.2
,
0.0000000003
],
mykey2
:
"
[a, b, c]
"
,
mykey3
:
"
str
"
,
mykey4
:
[
false
,
true
,
false
],
mykey5
:
[
"
str
"
,
"
STR
"
,
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
],
},
},
},
(
err
,
data
)
=>
{
console
.
info
(
'
====> ACTS_StartAbilityForResult_0700 start ability=====>
'
+
JSON
.
stringify
(
data
))
expect
(
data
.
want
.
deviceId
).
assertEqual
(
""
);
expect
(
data
.
want
.
bundleName
).
assertEqual
(
"
com.example.actsgetwantalltesthap
"
);
expect
(
data
.
want
.
abilityName
).
assertEqual
(
"
com.example.actsgetwantalltesthap.MainAbility
"
);
expect
(
data
.
want
.
action
).
assertEqual
(
"
action1
"
);
expect
(
data
.
want
.
entities
[
0
]).
assertEqual
(
"
entity1
"
);
expect
(
data
.
want
.
type
).
assertEqual
(
"
MIMETYPE
"
);
expect
(
data
.
want
.
uri
).
assertEqual
(
"
key={true,true,false}
"
);
expect
(
data
.
want
.
flags
).
assertEqual
(
wantConstant
.
Flags
.
FLAG_AUTH_WRITE_URI_PERMISSION
);
expect
(
data
.
want
.
parameters
.
mykey0
).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
0
]).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
1
]).
assertEqual
(
0.2
);
expect
(
data
.
want
.
parameters
.
mykey1
[
2
]).
assertEqual
(
0.0000000003
);
expect
(
data
.
want
.
parameters
.
mykey2
).
assertEqual
(
"
[a, b, c]
"
);
expect
(
data
.
want
.
parameters
.
mykey3
).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey4
[
0
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey4
[
1
]).
assertEqual
(
true
);
expect
(
data
.
want
.
parameters
.
mykey4
[
2
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey5
[
0
]).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
1
]).
assertEqual
(
"
STR
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
2
]).
assertEqual
(
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
);
console
.
info
(
'
====> before done=====>
'
)
done
();
})
})
// @tc.number: ACTS_GetWant_0800
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it
(
'
ACTS_GetWant_0800
'
,
0
,
async
function
(
done
)
{
featureAbility
.
startAbilityForResult
({
want
:
{
deviceId
:
""
,
bundleName
:
"
com.example.actsgetwantalltesthap
"
,
abilityName
:
"
com.example.actsgetwantalltesthap.MainAbility
"
,
action
:
"
action1
"
,
entities
:
[
"
entity1
"
],
type
:
"
MIMETYPE
"
,
uri
:
"
key={true,true,false}
"
,
flags
:
wantConstant
.
Flags
.
FLAG_ABILITY_CONTINUATION
,
parameters
:
{
mykey0
:
0.1
,
mykey1
:
[
0.1
,
0.2
,
0.0000000003
],
mykey2
:
"
[a, b, c]
"
,
mykey3
:
"
str
"
,
mykey4
:
[
false
,
true
,
false
],
mykey5
:
[
"
str
"
,
"
STR
"
,
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
],
},
},
},
(
err
,
data
)
=>
{
console
.
info
(
'
====> ACTS_StartAbilityForResult_0800 start ability=====>
'
+
JSON
.
stringify
(
data
))
expect
(
data
.
want
.
deviceId
).
assertEqual
(
""
);
expect
(
data
.
want
.
bundleName
).
assertEqual
(
"
com.example.actsgetwantalltesthap
"
);
expect
(
data
.
want
.
abilityName
).
assertEqual
(
"
com.example.actsgetwantalltesthap.MainAbility
"
);
expect
(
data
.
want
.
action
).
assertEqual
(
"
action1
"
);
expect
(
data
.
want
.
entities
[
0
]).
assertEqual
(
"
entity1
"
);
expect
(
data
.
want
.
type
).
assertEqual
(
"
MIMETYPE
"
);
expect
(
data
.
want
.
uri
).
assertEqual
(
"
key={true,true,false}
"
);
expect
(
data
.
want
.
flags
).
assertEqual
(
wantConstant
.
Flags
.
FLAG_ABILITY_CONTINUATION
);
expect
(
data
.
want
.
parameters
.
mykey0
).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
0
]).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
1
]).
assertEqual
(
0.2
);
expect
(
data
.
want
.
parameters
.
mykey1
[
2
]).
assertEqual
(
0.0000000003
);
expect
(
data
.
want
.
parameters
.
mykey2
).
assertEqual
(
"
[a, b, c]
"
);
expect
(
data
.
want
.
parameters
.
mykey3
).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey4
[
0
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey4
[
1
]).
assertEqual
(
true
);
expect
(
data
.
want
.
parameters
.
mykey4
[
2
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey5
[
0
]).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
1
]).
assertEqual
(
"
STR
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
2
]).
assertEqual
(
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
);
console
.
info
(
'
====> before done=====>
'
)
done
();
})
})
// @tc.number: ACTS_GetWant_0900
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it
(
'
ACTS_GetWant_0900
'
,
0
,
async
function
(
done
)
{
featureAbility
.
startAbilityForResult
({
want
:
{
deviceId
:
""
,
bundleName
:
"
com.example.actsgetwantalltesthap
"
,
abilityName
:
"
com.example.actsgetwantalltesthap.MainAbility
"
,
action
:
"
action1
"
,
entities
:
[
"
entity1
"
],
type
:
"
MIMETYPE
"
,
uri
:
"
key={true,true,false}
"
,
flags
:
wantConstant
.
Flags
.
FLAG_NOT_OHOS_COMPONENT
,
parameters
:
{
mykey0
:
0.1
,
mykey1
:
[
0.1
,
0.2
,
0.0000000003
],
mykey2
:
"
[a, b, c]
"
,
mykey3
:
"
str
"
,
mykey4
:
[
false
,
true
,
false
],
mykey5
:
[
"
str
"
,
"
STR
"
,
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
],
},
},
},
(
err
,
data
)
=>
{
console
.
info
(
'
====> ACTS_StartAbilityForResult_0900 start ability=====>
'
+
JSON
.
stringify
(
data
))
expect
(
data
.
want
.
deviceId
).
assertEqual
(
""
);
expect
(
data
.
want
.
bundleName
).
assertEqual
(
"
com.example.actsgetwantalltesthap
"
);
expect
(
data
.
want
.
abilityName
).
assertEqual
(
"
com.example.actsgetwantalltesthap.MainAbility
"
);
expect
(
data
.
want
.
action
).
assertEqual
(
"
action1
"
);
expect
(
data
.
want
.
entities
[
0
]).
assertEqual
(
"
entity1
"
);
expect
(
data
.
want
.
type
).
assertEqual
(
"
MIMETYPE
"
);
expect
(
data
.
want
.
uri
).
assertEqual
(
"
key={true,true,false}
"
);
expect
(
data
.
want
.
flags
).
assertEqual
(
wantConstant
.
Flags
.
FLAG_NOT_OHOS_COMPONENT
);
expect
(
data
.
want
.
parameters
.
mykey0
).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
0
]).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
1
]).
assertEqual
(
0.2
);
expect
(
data
.
want
.
parameters
.
mykey1
[
2
]).
assertEqual
(
0.0000000003
);
expect
(
data
.
want
.
parameters
.
mykey2
).
assertEqual
(
"
[a, b, c]
"
);
expect
(
data
.
want
.
parameters
.
mykey3
).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey4
[
0
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey4
[
1
]).
assertEqual
(
true
);
expect
(
data
.
want
.
parameters
.
mykey4
[
2
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey5
[
0
]).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
1
]).
assertEqual
(
"
STR
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
2
]).
assertEqual
(
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
);
console
.
info
(
'
====> before done=====>
'
)
done
();
})
})
// @tc.number: ACTS_GetWant_1000
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it
(
'
ACTS_GetWant_1000
'
,
0
,
async
function
(
done
)
{
featureAbility
.
startAbilityForResult
({
want
:
{
deviceId
:
""
,
bundleName
:
"
com.example.actsgetwantalltesthap
"
,
abilityName
:
"
com.example.actsgetwantalltesthap.MainAbility
"
,
action
:
"
action1
"
,
entities
:
[
"
entity1
"
],
type
:
"
MIMETYPE
"
,
uri
:
"
key={true,true,false}
"
,
flags
:
wantConstant
.
Flags
.
FLAG_AUTH_PERSISTABLE_URI_PERMISSION
,
parameters
:
{
mykey0
:
0.1
,
mykey1
:
[
0.1
,
0.2
,
0.0000000003
],
mykey2
:
"
[a, b, c]
"
,
mykey3
:
"
str
"
,
mykey4
:
[
false
,
true
,
false
],
mykey5
:
[
"
str
"
,
"
STR
"
,
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
],
},
},
},
(
err
,
data
)
=>
{
console
.
info
(
'
====> ACTS_StartAbilityForResult_1000 start ability=====>
'
+
JSON
.
stringify
(
data
))
expect
(
data
.
want
.
deviceId
).
assertEqual
(
""
);
expect
(
data
.
want
.
bundleName
).
assertEqual
(
"
com.example.actsgetwantalltesthap
"
);
expect
(
data
.
want
.
abilityName
).
assertEqual
(
"
com.example.actsgetwantalltesthap.MainAbility
"
);
expect
(
data
.
want
.
action
).
assertEqual
(
"
action1
"
);
expect
(
data
.
want
.
entities
[
0
]).
assertEqual
(
"
entity1
"
);
expect
(
data
.
want
.
type
).
assertEqual
(
"
MIMETYPE
"
);
expect
(
data
.
want
.
uri
).
assertEqual
(
"
key={true,true,false}
"
);
expect
(
data
.
want
.
flags
).
assertEqual
(
wantConstant
.
Flags
.
FLAG_AUTH_PERSISTABLE_URI_PERMISSION
);
expect
(
data
.
want
.
parameters
.
mykey0
).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
0
]).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
1
]).
assertEqual
(
0.2
);
expect
(
data
.
want
.
parameters
.
mykey1
[
2
]).
assertEqual
(
0.0000000003
);
expect
(
data
.
want
.
parameters
.
mykey2
).
assertEqual
(
"
[a, b, c]
"
);
expect
(
data
.
want
.
parameters
.
mykey3
).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey4
[
0
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey4
[
1
]).
assertEqual
(
true
);
expect
(
data
.
want
.
parameters
.
mykey4
[
2
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey5
[
0
]).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
1
]).
assertEqual
(
"
STR
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
2
]).
assertEqual
(
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
);
console
.
info
(
'
====> before done=====>
'
)
done
();
})
})
// @tc.number: ACTS_GetWant_1100
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it
(
'
ACTS_GetWant_1100
'
,
0
,
async
function
(
done
)
{
featureAbility
.
startAbilityForResult
({
want
:
{
deviceId
:
""
,
bundleName
:
"
com.example.actsgetwantalltesthap
"
,
abilityName
:
"
com.example.actsgetwantalltesthap.MainAbility
"
,
action
:
"
action1
"
,
entities
:
[
"
entity1
"
],
type
:
"
MIMETYPE
"
,
uri
:
"
key={true,true,false}
"
,
flags
:
wantConstant
.
Flags
.
FLAG_AUTH_PREFIX_URI_PERMISSION
,
parameters
:
{
mykey0
:
0.1
,
mykey1
:
[
0.1
,
0.2
,
0.0000000003
],
mykey2
:
"
[a, b, c]
"
,
mykey3
:
"
str
"
,
mykey4
:
[
false
,
true
,
false
],
mykey5
:
[
"
str
"
,
"
STR
"
,
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
],
},
},
},
(
err
,
data
)
=>
{
console
.
info
(
'
====> ACTS_StartAbilityForResult_1100 start ability=====>
'
+
JSON
.
stringify
(
data
))
expect
(
data
.
want
.
deviceId
).
assertEqual
(
""
);
expect
(
data
.
want
.
bundleName
).
assertEqual
(
"
com.example.actsgetwantalltesthap
"
);
expect
(
data
.
want
.
abilityName
).
assertEqual
(
"
com.example.actsgetwantalltesthap.MainAbility
"
);
expect
(
data
.
want
.
action
).
assertEqual
(
"
action1
"
);
expect
(
data
.
want
.
entities
[
0
]).
assertEqual
(
"
entity1
"
);
expect
(
data
.
want
.
type
).
assertEqual
(
"
MIMETYPE
"
);
expect
(
data
.
want
.
uri
).
assertEqual
(
"
key={true,true,false}
"
);
expect
(
data
.
want
.
flags
).
assertEqual
(
wantConstant
.
Flags
.
FLAG_AUTH_PREFIX_URI_PERMISSION
);
expect
(
data
.
want
.
parameters
.
mykey0
).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
0
]).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
1
]).
assertEqual
(
0.2
);
expect
(
data
.
want
.
parameters
.
mykey1
[
2
]).
assertEqual
(
0.0000000003
);
expect
(
data
.
want
.
parameters
.
mykey2
).
assertEqual
(
"
[a, b, c]
"
);
expect
(
data
.
want
.
parameters
.
mykey3
).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey4
[
0
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey4
[
1
]).
assertEqual
(
true
);
expect
(
data
.
want
.
parameters
.
mykey4
[
2
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey5
[
0
]).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
1
]).
assertEqual
(
"
STR
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
2
]).
assertEqual
(
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
);
console
.
info
(
'
====> before done=====>
'
)
done
();
})
})
// @tc.number: ACTS_GetWant_1200
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it
(
'
ACTS_GetWant_1200
'
,
0
,
async
function
(
done
)
{
featureAbility
.
startAbilityForResult
({
want
:
{
deviceId
:
""
,
bundleName
:
"
com.example.actsgetwantalltesthap
"
,
abilityName
:
"
com.example.actsgetwantalltesthap.MainAbility
"
,
action
:
"
action1
"
,
entities
:
[
"
entity1
"
],
type
:
"
MIMETYPE
"
,
uri
:
"
key={true,true,false}
"
,
flags
:
wantConstant
.
Flags
.
FLAG_ABILITYSLICE_MULTI_DEVICE
,
parameters
:
{
mykey0
:
0.1
,
mykey1
:
[
0.1
,
0.2
,
0.0000000003
],
mykey2
:
"
[a, b, c]
"
,
mykey3
:
"
str
"
,
mykey4
:
[
false
,
true
,
false
],
mykey5
:
[
"
str
"
,
"
STR
"
,
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
],
},
},
},
(
err
,
data
)
=>
{
console
.
info
(
'
====> ACTS_StartAbilityForResult_1200 start ability=====>
'
+
JSON
.
stringify
(
data
))
expect
(
data
.
want
.
deviceId
).
assertEqual
(
""
);
expect
(
data
.
want
.
bundleName
).
assertEqual
(
"
com.example.actsgetwantalltesthap
"
);
expect
(
data
.
want
.
abilityName
).
assertEqual
(
"
com.example.actsgetwantalltesthap.MainAbility
"
);
expect
(
data
.
want
.
action
).
assertEqual
(
"
action1
"
);
expect
(
data
.
want
.
entities
[
0
]).
assertEqual
(
"
entity1
"
);
expect
(
data
.
want
.
type
).
assertEqual
(
"
MIMETYPE
"
);
expect
(
data
.
want
.
uri
).
assertEqual
(
"
key={true,true,false}
"
);
expect
(
data
.
want
.
flags
).
assertEqual
(
wantConstant
.
Flags
.
FLAG_ABILITYSLICE_MULTI_DEVICE
);
expect
(
data
.
want
.
parameters
.
mykey0
).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
0
]).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
1
]).
assertEqual
(
0.2
);
expect
(
data
.
want
.
parameters
.
mykey1
[
2
]).
assertEqual
(
0.0000000003
);
expect
(
data
.
want
.
parameters
.
mykey2
).
assertEqual
(
"
[a, b, c]
"
);
expect
(
data
.
want
.
parameters
.
mykey3
).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey4
[
0
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey4
[
1
]).
assertEqual
(
true
);
expect
(
data
.
want
.
parameters
.
mykey4
[
2
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey5
[
0
]).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
1
]).
assertEqual
(
"
STR
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
2
]).
assertEqual
(
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
);
console
.
info
(
'
====> before done=====>
'
)
done
();
})
})
// @tc.number: ACTS_GetWant_1300
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it
(
'
ACTS_GetWant_1300
'
,
0
,
async
function
(
done
)
{
featureAbility
.
startAbilityForResult
({
want
:
{
deviceId
:
""
,
bundleName
:
"
com.example.actsgetwantalltesthap
"
,
abilityName
:
"
com.example.actsgetwantalltesthap.MainAbility
"
,
action
:
"
action1
"
,
entities
:
[
"
entity1
"
],
type
:
"
MIMETYPE
"
,
uri
:
"
key={true,true,false}
"
,
flags
:
wantConstant
.
Flags
.
FLAG_START_FOREGROUND_ABILITY
,
parameters
:
{
mykey0
:
0.1
,
mykey1
:
[
0.1
,
0.2
,
0.0000000003
],
mykey2
:
"
[a, b, c]
"
,
mykey3
:
"
str
"
,
mykey4
:
[
false
,
true
,
false
],
mykey5
:
[
"
str
"
,
"
STR
"
,
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
],
},
},
},
(
err
,
data
)
=>
{
console
.
info
(
'
====> ACTS_StartAbilityForResult_1300 start ability=====>
'
+
JSON
.
stringify
(
data
))
expect
(
data
.
want
.
deviceId
).
assertEqual
(
""
);
expect
(
data
.
want
.
bundleName
).
assertEqual
(
"
com.example.actsgetwantalltesthap
"
);
expect
(
data
.
want
.
abilityName
).
assertEqual
(
"
com.example.actsgetwantalltesthap.MainAbility
"
);
expect
(
data
.
want
.
action
).
assertEqual
(
"
action1
"
);
expect
(
data
.
want
.
entities
[
0
]).
assertEqual
(
"
entity1
"
);
expect
(
data
.
want
.
type
).
assertEqual
(
"
MIMETYPE
"
);
expect
(
data
.
want
.
uri
).
assertEqual
(
"
key={true,true,false}
"
);
expect
(
data
.
want
.
flags
).
assertEqual
(
wantConstant
.
Flags
.
FLAG_START_FOREGROUND_ABILITY
);
expect
(
data
.
want
.
parameters
.
mykey0
).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
0
]).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
1
]).
assertEqual
(
0.2
);
expect
(
data
.
want
.
parameters
.
mykey1
[
2
]).
assertEqual
(
0.0000000003
);
expect
(
data
.
want
.
parameters
.
mykey2
).
assertEqual
(
"
[a, b, c]
"
);
expect
(
data
.
want
.
parameters
.
mykey3
).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey4
[
0
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey4
[
1
]).
assertEqual
(
true
);
expect
(
data
.
want
.
parameters
.
mykey4
[
2
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey5
[
0
]).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
1
]).
assertEqual
(
"
STR
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
2
]).
assertEqual
(
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
);
console
.
info
(
'
====> before done=====>
'
)
done
();
})
})
// @tc.number: ACTS_GetWant_1400
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it
(
'
ACTS_GetWant_1400
'
,
0
,
async
function
(
done
)
{
featureAbility
.
startAbilityForResult
({
want
:
{
deviceId
:
""
,
bundleName
:
"
com.example.actsgetwantalltesthap
"
,
abilityName
:
"
com.example.actsgetwantalltesthap.MainAbility
"
,
action
:
"
action1
"
,
entities
:
[
"
entity1
"
],
type
:
"
MIMETYPE
"
,
uri
:
"
key={true,true,false}
"
,
flags
:
wantConstant
.
Flags
.
FLAG_ABILITY_CONTINUATION_REVERSIBLE
,
parameters
:
{
mykey0
:
0.1
,
mykey1
:
[
0.1
,
0.2
,
0.0000000003
],
mykey2
:
"
[a, b, c]
"
,
mykey3
:
"
str
"
,
mykey4
:
[
false
,
true
,
false
],
mykey5
:
[
"
str
"
,
"
STR
"
,
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
],
},
},
},
(
err
,
data
)
=>
{
console
.
info
(
'
====> ACTS_StartAbilityForResult_1400 start ability=====>
'
+
JSON
.
stringify
(
data
))
expect
(
data
.
want
.
deviceId
).
assertEqual
(
""
);
expect
(
data
.
want
.
bundleName
).
assertEqual
(
"
com.example.actsgetwantalltesthap
"
);
expect
(
data
.
want
.
abilityName
).
assertEqual
(
"
com.example.actsgetwantalltesthap.MainAbility
"
);
expect
(
data
.
want
.
action
).
assertEqual
(
"
action1
"
);
expect
(
data
.
want
.
entities
[
0
]).
assertEqual
(
"
entity1
"
);
expect
(
data
.
want
.
type
).
assertEqual
(
"
MIMETYPE
"
);
expect
(
data
.
want
.
uri
).
assertEqual
(
"
key={true,true,false}
"
);
expect
(
data
.
want
.
flags
).
assertEqual
(
wantConstant
.
Flags
.
FLAG_ABILITY_CONTINUATION_REVERSIBLE
);
expect
(
data
.
want
.
parameters
.
mykey0
).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
0
]).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
1
]).
assertEqual
(
0.2
);
expect
(
data
.
want
.
parameters
.
mykey1
[
2
]).
assertEqual
(
0.0000000003
);
expect
(
data
.
want
.
parameters
.
mykey2
).
assertEqual
(
"
[a, b, c]
"
);
expect
(
data
.
want
.
parameters
.
mykey3
).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey4
[
0
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey4
[
1
]).
assertEqual
(
true
);
expect
(
data
.
want
.
parameters
.
mykey4
[
2
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey5
[
0
]).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
1
]).
assertEqual
(
"
STR
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
2
]).
assertEqual
(
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
);
console
.
info
(
'
====> before done=====>
'
)
done
();
})
})
// @tc.number: ACTS_GetWant_1500
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it
(
'
ACTS_GetWant_1500
'
,
0
,
async
function
(
done
)
{
featureAbility
.
startAbilityForResult
({
want
:
{
deviceId
:
""
,
bundleName
:
"
com.example.actsgetwantalltesthap
"
,
abilityName
:
"
com.example.actsgetwantalltesthap.MainAbility
"
,
action
:
"
action1
"
,
entities
:
[
"
entity1
"
],
type
:
"
MIMETYPE
"
,
uri
:
"
key={true,true,false}
"
,
flags
:
wantConstant
.
Flags
.
FLAG_INSTALL_ON_DEMAND
,
parameters
:
{
mykey0
:
0.1
,
mykey1
:
[
0.1
,
0.2
,
0.0000000003
],
mykey2
:
"
[a, b, c]
"
,
mykey3
:
"
str
"
,
mykey4
:
[
false
,
true
,
false
],
mykey5
:
[
"
str
"
,
"
STR
"
,
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
],
},
},
},
(
err
,
data
)
=>
{
console
.
info
(
'
====> ACTS_StartAbilityForResult_1500 start ability=====>
'
+
JSON
.
stringify
(
data
))
expect
(
data
.
want
.
deviceId
).
assertEqual
(
""
);
expect
(
data
.
want
.
bundleName
).
assertEqual
(
"
com.example.actsgetwantalltesthap
"
);
expect
(
data
.
want
.
abilityName
).
assertEqual
(
"
com.example.actsgetwantalltesthap.MainAbility
"
);
expect
(
data
.
want
.
action
).
assertEqual
(
"
action1
"
);
expect
(
data
.
want
.
entities
[
0
]).
assertEqual
(
"
entity1
"
);
expect
(
data
.
want
.
type
).
assertEqual
(
"
MIMETYPE
"
);
expect
(
data
.
want
.
uri
).
assertEqual
(
"
key={true,true,false}
"
);
expect
(
data
.
want
.
flags
).
assertEqual
(
wantConstant
.
Flags
.
FLAG_INSTALL_ON_DEMAND
);
expect
(
data
.
want
.
parameters
.
mykey0
).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
0
]).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
1
]).
assertEqual
(
0.2
);
expect
(
data
.
want
.
parameters
.
mykey1
[
2
]).
assertEqual
(
0.0000000003
);
expect
(
data
.
want
.
parameters
.
mykey2
).
assertEqual
(
"
[a, b, c]
"
);
expect
(
data
.
want
.
parameters
.
mykey3
).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey4
[
0
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey4
[
1
]).
assertEqual
(
true
);
expect
(
data
.
want
.
parameters
.
mykey4
[
2
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey5
[
0
]).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
1
]).
assertEqual
(
"
STR
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
2
]).
assertEqual
(
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
);
console
.
info
(
'
====> before done=====>
'
)
done
();
})
})
// @tc.number: ACTS_GetWant_1600
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it
(
'
ACTS_GetWant_1600
'
,
0
,
async
function
(
done
)
{
featureAbility
.
startAbilityForResult
({
want
:
{
deviceId
:
""
,
bundleName
:
"
com.example.actsgetwantalltesthap
"
,
abilityName
:
"
com.example.actsgetwantalltesthap.MainAbility
"
,
action
:
"
action1
"
,
entities
:
[
"
entity1
"
],
type
:
"
MIMETYPE
"
,
uri
:
"
key={true,true,false}
"
,
flags
:
wantConstant
.
Flags
.
FLAG_INSTALL_WITH_BACKGROUND_MODE
,
parameters
:
{
mykey0
:
0.1
,
mykey1
:
[
0.1
,
0.2
,
0.0000000003
],
mykey2
:
"
[a, b, c]
"
,
mykey3
:
"
str
"
,
mykey4
:
[
false
,
true
,
false
],
mykey5
:
[
"
str
"
,
"
STR
"
,
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
],
},
},
},
(
err
,
data
)
=>
{
console
.
info
(
'
====> ACTS_StartAbilityForResult_1600 start ability=====>
'
+
JSON
.
stringify
(
data
))
expect
(
data
.
want
.
deviceId
).
assertEqual
(
""
);
expect
(
data
.
want
.
bundleName
).
assertEqual
(
"
com.example.actsgetwantalltesthap
"
);
expect
(
data
.
want
.
abilityName
).
assertEqual
(
"
com.example.actsgetwantalltesthap.MainAbility
"
);
expect
(
data
.
want
.
action
).
assertEqual
(
"
action1
"
);
expect
(
data
.
want
.
entities
[
0
]).
assertEqual
(
"
entity1
"
);
expect
(
data
.
want
.
type
).
assertEqual
(
"
MIMETYPE
"
);
expect
(
data
.
want
.
uri
).
assertEqual
(
"
key={true,true,false}
"
);
expect
(
data
.
want
.
flags
).
assertEqual
(
wantConstant
.
Flags
.
FLAG_INSTALL_WITH_BACKGROUND_MODE
);
expect
(
data
.
want
.
parameters
.
mykey0
).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
0
]).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
1
]).
assertEqual
(
0.2
);
expect
(
data
.
want
.
parameters
.
mykey1
[
2
]).
assertEqual
(
0.0000000003
);
expect
(
data
.
want
.
parameters
.
mykey2
).
assertEqual
(
"
[a, b, c]
"
);
expect
(
data
.
want
.
parameters
.
mykey3
).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey4
[
0
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey4
[
1
]).
assertEqual
(
true
);
expect
(
data
.
want
.
parameters
.
mykey4
[
2
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey5
[
0
]).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
1
]).
assertEqual
(
"
STR
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
2
]).
assertEqual
(
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
);
console
.
info
(
'
====> before done=====>
'
)
done
();
})
})
// @tc.number: ACTS_GetWant_1700
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it
(
'
ACTS_GetWant_1700
'
,
0
,
async
function
(
done
)
{
featureAbility
.
startAbilityForResult
({
want
:
{
deviceId
:
""
,
bundleName
:
"
com.example.actsgetwantalltesthap
"
,
abilityName
:
"
com.example.actsgetwantalltesthap.MainAbility
"
,
action
:
"
action1
"
,
entities
:
[
"
entity1
"
],
type
:
"
MIMETYPE
"
,
uri
:
"
key={true,true,false}
"
,
flags
:
wantConstant
.
Flags
.
FLAG_ABILITY_CLEAR_MISSION
,
parameters
:
{
mykey0
:
0.1
,
mykey1
:
[
0.1
,
0.2
,
0.0000000003
],
mykey2
:
"
[a, b, c]
"
,
mykey3
:
"
str
"
,
mykey4
:
[
false
,
true
,
false
],
mykey5
:
[
"
str
"
,
"
STR
"
,
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
],
},
},
},
(
err
,
data
)
=>
{
console
.
info
(
'
====> ACTS_StartAbilityForResult_1700 start ability=====>
'
+
JSON
.
stringify
(
data
))
expect
(
data
.
want
.
deviceId
).
assertEqual
(
""
);
expect
(
data
.
want
.
bundleName
).
assertEqual
(
"
com.example.actsgetwantalltesthap
"
);
expect
(
data
.
want
.
abilityName
).
assertEqual
(
"
com.example.actsgetwantalltesthap.MainAbility
"
);
expect
(
data
.
want
.
action
).
assertEqual
(
"
action1
"
);
expect
(
data
.
want
.
entities
[
0
]).
assertEqual
(
"
entity1
"
);
expect
(
data
.
want
.
type
).
assertEqual
(
"
MIMETYPE
"
);
expect
(
data
.
want
.
uri
).
assertEqual
(
"
key={true,true,false}
"
);
expect
(
data
.
want
.
flags
).
assertEqual
(
wantConstant
.
Flags
.
FLAG_ABILITY_CLEAR_MISSION
);
expect
(
data
.
want
.
parameters
.
mykey0
).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
0
]).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
1
]).
assertEqual
(
0.2
);
expect
(
data
.
want
.
parameters
.
mykey1
[
2
]).
assertEqual
(
0.0000000003
);
expect
(
data
.
want
.
parameters
.
mykey2
).
assertEqual
(
"
[a, b, c]
"
);
expect
(
data
.
want
.
parameters
.
mykey3
).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey4
[
0
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey4
[
1
]).
assertEqual
(
true
);
expect
(
data
.
want
.
parameters
.
mykey4
[
2
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey5
[
0
]).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
1
]).
assertEqual
(
"
STR
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
2
]).
assertEqual
(
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
);
console
.
info
(
'
====> before done=====>
'
)
done
();
})
})
// @tc.number: ACTS_GetWant_1800
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it
(
'
ACTS_GetWant_1800
'
,
0
,
async
function
(
done
)
{
featureAbility
.
startAbilityForResult
({
want
:
{
deviceId
:
""
,
bundleName
:
"
com.example.actsgetwantalltesthap
"
,
abilityName
:
"
com.example.actsgetwantalltesthap.MainAbility
"
,
action
:
"
action1
"
,
entities
:
[
"
entity1
"
],
type
:
"
MIMETYPE
"
,
uri
:
"
key={true,true,false}
"
,
flags
:
wantConstant
.
Flags
.
FLAG_ABILITY_NEW_MISSION
,
parameters
:
{
mykey0
:
0.1
,
mykey1
:
[
0.1
,
0.2
,
0.0000000003
],
mykey2
:
"
[a, b, c]
"
,
mykey3
:
"
str
"
,
mykey4
:
[
false
,
true
,
false
],
mykey5
:
[
"
str
"
,
"
STR
"
,
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
],
},
},
},
(
err
,
data
)
=>
{
console
.
info
(
'
====> ACTS_StartAbilityForResult_1800 start ability=====>
'
+
JSON
.
stringify
(
data
))
expect
(
data
.
want
.
deviceId
).
assertEqual
(
""
);
expect
(
data
.
want
.
bundleName
).
assertEqual
(
"
com.example.actsgetwantalltesthap
"
);
expect
(
data
.
want
.
abilityName
).
assertEqual
(
"
com.example.actsgetwantalltesthap.MainAbility
"
);
expect
(
data
.
want
.
action
).
assertEqual
(
"
action1
"
);
expect
(
data
.
want
.
entities
[
0
]).
assertEqual
(
"
entity1
"
);
expect
(
data
.
want
.
type
).
assertEqual
(
"
MIMETYPE
"
);
expect
(
data
.
want
.
uri
).
assertEqual
(
"
key={true,true,false}
"
);
expect
(
data
.
want
.
flags
).
assertEqual
(
wantConstant
.
Flags
.
FLAG_ABILITY_NEW_MISSION
);
expect
(
data
.
want
.
parameters
.
mykey0
).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
0
]).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
1
]).
assertEqual
(
0.2
);
expect
(
data
.
want
.
parameters
.
mykey1
[
2
]).
assertEqual
(
0.0000000003
);
expect
(
data
.
want
.
parameters
.
mykey2
).
assertEqual
(
"
[a, b, c]
"
);
expect
(
data
.
want
.
parameters
.
mykey3
).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey4
[
0
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey4
[
1
]).
assertEqual
(
true
);
expect
(
data
.
want
.
parameters
.
mykey4
[
2
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey5
[
0
]).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
1
]).
assertEqual
(
"
STR
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
2
]).
assertEqual
(
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
);
console
.
info
(
'
====> before done=====>
'
)
done
();
})
})
// @tc.number: ACTS_GetWant_1900
// @tc.name: getWant : get want in current ability
// @tc.desc:Start the ability through startabilityforresult,
// and then use terminateselfwithresult to return the data
it
(
'
ACTS_GetWant_1900
'
,
0
,
async
function
(
done
)
{
featureAbility
.
startAbilityForResult
({
want
:
{
deviceId
:
""
,
bundleName
:
"
com.example.actsgetwantalltesthap
"
,
abilityName
:
"
com.example.actsgetwantalltesthap.MainAbility
"
,
action
:
"
action1
"
,
entities
:
[
"
entity1
"
],
type
:
"
MIMETYPE
"
,
uri
:
"
key={true,true,false}
"
,
flags
:
wantConstant
.
Flags
.
FLAG_ABILITY_MISSION_TOP
,
parameters
:
{
mykey0
:
0.1
,
mykey1
:
[
0.1
,
0.2
,
0.0000000003
],
mykey2
:
"
[a, b, c]
"
,
mykey3
:
"
str
"
,
mykey4
:
[
false
,
true
,
false
],
mykey5
:
[
"
str
"
,
"
STR
"
,
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
],
},
},
},
(
err
,
data
)
=>
{
console
.
info
(
'
====> ACTS_StartAbilityForResult_1900 start ability=====>
'
+
JSON
.
stringify
(
data
))
expect
(
data
.
want
.
deviceId
).
assertEqual
(
""
);
expect
(
data
.
want
.
bundleName
).
assertEqual
(
"
com.example.actsgetwantalltesthap
"
);
expect
(
data
.
want
.
abilityName
).
assertEqual
(
"
com.example.actsgetwantalltesthap.MainAbility
"
);
expect
(
data
.
want
.
action
).
assertEqual
(
"
action1
"
);
expect
(
data
.
want
.
entities
[
0
]).
assertEqual
(
"
entity1
"
);
expect
(
data
.
want
.
type
).
assertEqual
(
"
MIMETYPE
"
);
expect
(
data
.
want
.
uri
).
assertEqual
(
"
key={true,true,false}
"
);
expect
(
data
.
want
.
flags
).
assertEqual
(
wantConstant
.
Flags
.
FLAG_ABILITY_MISSION_TOP
);
expect
(
data
.
want
.
parameters
.
mykey0
).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
0
]).
assertEqual
(
0.1
);
expect
(
data
.
want
.
parameters
.
mykey1
[
1
]).
assertEqual
(
0.2
);
expect
(
data
.
want
.
parameters
.
mykey1
[
2
]).
assertEqual
(
0.0000000003
);
expect
(
data
.
want
.
parameters
.
mykey2
).
assertEqual
(
"
[a, b, c]
"
);
expect
(
data
.
want
.
parameters
.
mykey3
).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey4
[
0
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey4
[
1
]).
assertEqual
(
true
);
expect
(
data
.
want
.
parameters
.
mykey4
[
2
]).
assertEqual
(
false
);
expect
(
data
.
want
.
parameters
.
mykey5
[
0
]).
assertEqual
(
"
str
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
1
]).
assertEqual
(
"
STR
"
);
expect
(
data
.
want
.
parameters
.
mykey5
[
2
]).
assertEqual
(
"
helloopenharmonyhelloopenharmonyhelloopenharmony
"
);
console
.
info
(
'
====> before done=====>
'
)
done
();
})
})
})
notification/ans_standard/publish_test/BUILD.gn
浏览文件 @
d6d677f6
...
...
@@ -16,15 +16,20 @@ group("publish_test") {
testonly = true
if (is_standard_system) {
deps = [
#
"actsanspublishcontroltest:ActsAnsPublishControlTest",
#
"badgedisplayed:badgedisplayed",
#
"enablenotification:enablenotification",
"actsanspublishcontroltest:ActsAnsPublishControlTest",
"badgedisplayed:badgedisplayed",
"enablenotification:enablenotification",
"getactive:getactive",
"getwantagentinfo:ActsAnsGetWantAgentInfoTest",
#"publishcontentype:publishcontentype",
#"subscribe:subscribe",
#"unsubscribe:ActsAnsUnSubscriberTest",
"ansactscancelgroup:ActsAnsCancelGroup",
"ansactsremovegroup:ActsAnsRemoveGroup",
"donotdisturbmode:ActsAnsDoNotDisturbTest",
"publishsound:ActsAnsPublishSoundTest",
"publishvibra:ActsAnsPublishVibraTest",
"unsubscribe:ActsAnsUnSubscriberTest",
"wantagent:wantagent",
]
}
...
...
notification/ans_standard/publish_test/publishsound/entry/src/main/config.json
浏览文件 @
d6d677f6
{
"app"
:
{
"bundleName"
:
"com.example.actsanspublishsoundtest"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1
,
"name"
:
"1.0"
},
"apiVersion"
:
{
"compatible"
:
5
,
"target"
:
5
,
"releaseType"
:
"Beta1"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.actsanspublishsoundtest"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"phone"
],
"reqPermissions"
:
[{
"name"
:
"ohos.permission.NOTIFICATION_CONTROLLER"
,
"reason"
:
"install bundle"
,
"usedScene"
:
{
"ability"
:
[
"KitFramework"
],
"when"
:
"always"
}
}],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"com.example.actsanspublishsoundtest.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:app_name"
,
"type"
:
"page"
,
"isVisible"
:
"true"
,
"launchType"
:
"standard"
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
\ No newline at end of file
{
"app"
:
{
"bundleName"
:
"com.example.actsanspublishsoundtest"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1
,
"name"
:
"1.0"
},
"apiVersion"
:
{
"compatible"
:
4
,
"target"
:
5
,
"releaseType"
:
"Beta1"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.actsanspublishsoundtest"
,
"name"
:
".actsansnotificationcancel"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"com.example.actsanspublishsoundtest.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:app_name"
,
"type"
:
"page"
,
"launchType"
:
"standard"
,
"visible"
:
true
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
notification/ans_standard/publish_test/publishvibra/entry/src/main/config.json
浏览文件 @
d6d677f6
{
"app"
:
{
"bundleName"
:
"com.example.actsanspublishvibratest"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1
,
"name"
:
"1.0"
},
"apiVersion"
:
{
"compatible"
:
5
,
"target"
:
5
,
"releaseType"
:
"Beta1"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.actsanspublishvibratest"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"phone"
],
"reqPermissions"
:
[
{
"name"
:
"ohos.permission.NOTIFICATION_CONTROLLER"
,
"reason"
:
"install bundle"
,
"usedScene"
:
{
"ability"
:
[
"KitFramework"
],
"when"
:
"always"
}
}
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"com.example.actsanspublishvibratest.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:app_name"
,
"type"
:
"page"
,
"isVisible"
:
"true"
,
"launchType"
:
"standard"
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
\ No newline at end of file
{
"app"
:
{
"bundleName"
:
"com.example.actsanspublishvibratest"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1
,
"name"
:
"1.0"
},
"apiVersion"
:
{
"compatible"
:
4
,
"target"
:
5
,
"releaseType"
:
"Beta1"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.actsanspublishvibratest"
,
"name"
:
".actsansnotificationcancel"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"com.example.actsanspublishvibratest.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:app_name"
,
"type"
:
"page"
,
"launchType"
:
"standard"
,
"visible"
:
true
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录