Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
bb3d4d59
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bb3d4d59
编写于
3月 16, 2022
作者:
Z
zhijianwen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ans新增自动化用例
Signed-off-by:
N
zhijianwen
<
zhijianwen@huawei.com
>
上级
96f97804
变更
46
展开全部
隐藏空白更改
内联
并排
Showing
46 changed file
with
3988 addition
and
0 deletion
+3988
-0
notification/ans_standard/publish_test/BUILD.gn
notification/ans_standard/publish_test/BUILD.gn
+3
-0
notification/ans_standard/publish_test/actsansgetallactive/BUILD.gn
...on/ans_standard/publish_test/actsansgetallactive/BUILD.gn
+31
-0
notification/ans_standard/publish_test/actsansgetallactive/Test.json
...n/ans_standard/publish_test/actsansgetallactive/Test.json
+18
-0
notification/ans_standard/publish_test/actsansgetallactive/entry/.gitignore
...tandard/publish_test/actsansgetallactive/entry/.gitignore
+1
-0
notification/ans_standard/publish_test/actsansgetallactive/entry/src/main/config.json
...blish_test/actsansgetallactive/entry/src/main/config.json
+65
-0
notification/ans_standard/publish_test/actsansgetallactive/entry/src/main/js/default/app.js
...test/actsansgetallactive/entry/src/main/js/default/app.js
+22
-0
notification/ans_standard/publish_test/actsansgetallactive/entry/src/main/js/default/i18n/en-US.json
...ansgetallactive/entry/src/main/js/default/i18n/en-US.json
+6
-0
notification/ans_standard/publish_test/actsansgetallactive/entry/src/main/js/default/i18n/zh-CN.json
...ansgetallactive/entry/src/main/js/default/i18n/zh-CN.json
+6
-0
notification/ans_standard/publish_test/actsansgetallactive/entry/src/main/js/default/pages/index/index.css
...allactive/entry/src/main/js/default/pages/index/index.css
+9
-0
notification/ans_standard/publish_test/actsansgetallactive/entry/src/main/js/default/pages/index/index.hml
...allactive/entry/src/main/js/default/pages/index/index.hml
+8
-0
notification/ans_standard/publish_test/actsansgetallactive/entry/src/main/js/default/pages/index/index.js
...tallactive/entry/src/main/js/default/pages/index/index.js
+47
-0
notification/ans_standard/publish_test/actsansgetallactive/entry/src/main/js/resources/base/element/string.json
...tive/entry/src/main/js/resources/base/element/string.json
+12
-0
notification/ans_standard/publish_test/actsansgetallactive/entry/src/main/js/resources/base/media/icon.png
...allactive/entry/src/main/js/resources/base/media/icon.png
+0
-0
notification/ans_standard/publish_test/actsansgetallactive/entry/src/main/js/test/List.test.js
...t/actsansgetallactive/entry/src/main/js/test/List.test.js
+15
-0
notification/ans_standard/publish_test/actsansgetallactive/entry/src/main/js/test/getAllActive.js
...ctsansgetallactive/entry/src/main/js/test/getAllActive.js
+436
-0
notification/ans_standard/publish_test/actsansgetallactive/signature/openharmony_sx.p7b
...ish_test/actsansgetallactive/signature/openharmony_sx.p7b
+0
-0
notification/ans_standard/publish_test/publish/BUILD.gn
notification/ans_standard/publish_test/publish/BUILD.gn
+31
-0
notification/ans_standard/publish_test/publish/Test.json
notification/ans_standard/publish_test/publish/Test.json
+18
-0
notification/ans_standard/publish_test/publish/entry/.gitignore
...cation/ans_standard/publish_test/publish/entry/.gitignore
+1
-0
notification/ans_standard/publish_test/publish/entry/src/main/config.json
..._standard/publish_test/publish/entry/src/main/config.json
+62
-0
notification/ans_standard/publish_test/publish/entry/src/main/js/default/app.js
...ard/publish_test/publish/entry/src/main/js/default/app.js
+22
-0
notification/ans_standard/publish_test/publish/entry/src/main/js/default/i18n/en-US.json
...sh_test/publish/entry/src/main/js/default/i18n/en-US.json
+6
-0
notification/ans_standard/publish_test/publish/entry/src/main/js/default/i18n/zh-CN.json
...sh_test/publish/entry/src/main/js/default/i18n/zh-CN.json
+6
-0
notification/ans_standard/publish_test/publish/entry/src/main/js/default/pages/index/index.css
...t/publish/entry/src/main/js/default/pages/index/index.css
+9
-0
notification/ans_standard/publish_test/publish/entry/src/main/js/default/pages/index/index.hml
...t/publish/entry/src/main/js/default/pages/index/index.hml
+5
-0
notification/ans_standard/publish_test/publish/entry/src/main/js/default/pages/index/index.js
...st/publish/entry/src/main/js/default/pages/index/index.js
+47
-0
notification/ans_standard/publish_test/publish/entry/src/main/js/resources/base/element/string.json
...lish/entry/src/main/js/resources/base/element/string.json
+12
-0
notification/ans_standard/publish_test/publish/entry/src/main/js/resources/base/media/icon.png
...t/publish/entry/src/main/js/resources/base/media/icon.png
+0
-0
notification/ans_standard/publish_test/publish/entry/src/main/js/test/List.test.js
.../publish_test/publish/entry/src/main/js/test/List.test.js
+15
-0
notification/ans_standard/publish_test/publish/entry/src/main/js/test/publish.js
...rd/publish_test/publish/entry/src/main/js/test/publish.js
+2391
-0
notification/ans_standard/publish_test/publish/signature/openharmony_sx.p7b
...tandard/publish_test/publish/signature/openharmony_sx.p7b
+0
-0
notification/ans_standard/publish_test/sub/BUILD.gn
notification/ans_standard/publish_test/sub/BUILD.gn
+31
-0
notification/ans_standard/publish_test/sub/Test.json
notification/ans_standard/publish_test/sub/Test.json
+18
-0
notification/ans_standard/publish_test/sub/entry/.gitignore
notification/ans_standard/publish_test/sub/entry/.gitignore
+1
-0
notification/ans_standard/publish_test/sub/entry/src/main/config.json
.../ans_standard/publish_test/sub/entry/src/main/config.json
+62
-0
notification/ans_standard/publish_test/sub/entry/src/main/js/default/app.js
...tandard/publish_test/sub/entry/src/main/js/default/app.js
+22
-0
notification/ans_standard/publish_test/sub/entry/src/main/js/default/i18n/en-US.json
...ublish_test/sub/entry/src/main/js/default/i18n/en-US.json
+6
-0
notification/ans_standard/publish_test/sub/entry/src/main/js/default/i18n/zh-CN.json
...ublish_test/sub/entry/src/main/js/default/i18n/zh-CN.json
+6
-0
notification/ans_standard/publish_test/sub/entry/src/main/js/default/pages/index/index.css
..._test/sub/entry/src/main/js/default/pages/index/index.css
+9
-0
notification/ans_standard/publish_test/sub/entry/src/main/js/default/pages/index/index.hml
..._test/sub/entry/src/main/js/default/pages/index/index.hml
+5
-0
notification/ans_standard/publish_test/sub/entry/src/main/js/default/pages/index/index.js
...h_test/sub/entry/src/main/js/default/pages/index/index.js
+47
-0
notification/ans_standard/publish_test/sub/entry/src/main/js/resources/base/element/string.json
.../sub/entry/src/main/js/resources/base/element/string.json
+12
-0
notification/ans_standard/publish_test/sub/entry/src/main/js/resources/base/media/icon.png
..._test/sub/entry/src/main/js/resources/base/media/icon.png
+0
-0
notification/ans_standard/publish_test/sub/entry/src/main/js/test/List.test.js
...dard/publish_test/sub/entry/src/main/js/test/List.test.js
+15
-0
notification/ans_standard/publish_test/sub/entry/src/main/js/test/Subscriber.js
...ard/publish_test/sub/entry/src/main/js/test/Subscriber.js
+450
-0
notification/ans_standard/publish_test/sub/signature/openharmony_sx.p7b
...ns_standard/publish_test/sub/signature/openharmony_sx.p7b
+0
-0
未找到文件。
notification/ans_standard/publish_test/BUILD.gn
浏览文件 @
bb3d4d59
...
...
@@ -26,11 +26,14 @@ group("publish_test") {
#"publishcontentype:publishcontentype",
#"subscribe:subscribe",
"activebtn:activebtn",
"actsansgetallactive:ActsAnsGetAllActiveTestXts",
"ansactscancelgroup:ActsAnsCancelGroupTest",
"ansactsremovegroup:ActsAnsRemoveGroupTest",
"donotdisturbmode:ActsAnsDoNotDisturbTest",
"publish:ActsAnsNotificationPublishXts",
"publishsound:ActsAnsPublishSoundTest",
"publishvibra:ActsAnsPublishVibraTest",
"sub:ActsAnsSubTestXts",
"unsubscribe:ActsAnsUnSubscriberTest",
"wantagent:wantagent",
]
...
...
notification/ans_standard/publish_test/actsansgetallactive/BUILD.gn
0 → 100644
浏览文件 @
bb3d4d59
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAnsGetAllActiveTestXts") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAnsGetAllActiveTestXts"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
notification/ans_standard/publish_test/actsansgetallactive/Test.json
0 → 100644
浏览文件 @
bb3d4d59
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"180000"
,
"package"
:
"com.example.actsansgetallactivetest"
,
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsAnsGetAllActiveTestXts.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
notification/ans_standard/publish_test/actsansgetallactive/entry/.gitignore
0 → 100644
浏览文件 @
bb3d4d59
/build
notification/ans_standard/publish_test/actsansgetallactive/entry/src/main/config.json
0 → 100644
浏览文件 @
bb3d4d59
{
"app"
:
{
"bundleName"
:
"com.example.actsansgetallactivetest"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1
,
"name"
:
"1.0"
},
"apiVersion"
:
{
"compatible"
:
5
,
"target"
:
5
,
"releaseType"
:
"Beta1"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.actsansgetallactivetest"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"phone"
],
"reqPermissions"
:
[{
"name"
:
"ohos.permission.NOTIFICATION_CONTROLLER"
}],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"com.example.actsansgetallactivetest.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:app_name"
,
"type"
:
"page"
,
"isVisible"
:
"true"
,
"launchType"
:
"standard"
,
"visible"
:
true
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
notification/ans_standard/publish_test/actsansgetallactive/entry/src/main/js/default/app.js
0 → 100644
浏览文件 @
bb3d4d59
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export
default
{
onCreate
()
{
console
.
info
(
'
AceApplication onCreate
'
);
},
onDestroy
()
{
console
.
info
(
'
AceApplication onDestroy
'
);
}
};
notification/ans_standard/publish_test/actsansgetallactive/entry/src/main/js/default/i18n/en-US.json
0 → 100644
浏览文件 @
bb3d4d59
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
notification/ans_standard/publish_test/actsansgetallactive/entry/src/main/js/default/i18n/zh-CN.json
0 → 100644
浏览文件 @
bb3d4d59
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
notification/ans_standard/publish_test/actsansgetallactive/entry/src/main/js/default/pages/index/index.css
0 → 100644
浏览文件 @
bb3d4d59
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
100px
;
}
notification/ans_standard/publish_test/actsansgetallactive/entry/src/main/js/default/pages/index/index.hml
0 → 100644
浏览文件 @
bb3d4d59
<div class="container">
<text class="title">
currentApp
</text>
<text class="title">
ForGetAllActive
</text>
</div>
notification/ans_standard/publish_test/actsansgetallactive/entry/src/main/js/default/pages/index/index.js
0 → 100644
浏览文件 @
bb3d4d59
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
file
from
'
@system.file
'
import
{
Core
,
ExpectExtend
}
from
'
deccjsunit/index
'
const
injectRef
=
Object
.
getPrototypeOf
(
global
)
||
global
injectRef
.
regeneratorRuntime
=
require
(
'
@babel/runtime/regenerator
'
)
export
default
{
data
:
{
title
:
""
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
},
onShow
()
{
console
.
info
(
'
onShow finish
'
)
const
core
=
Core
.
getInstance
()
const
expectExtend
=
new
ExpectExtend
({
'
id
'
:
'
extend
'
})
core
.
addService
(
'
expect
'
,
expectExtend
)
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
configService
.
setConfig
(
this
)
require
(
'
../../../test/List.test
'
)
core
.
execute
()
},
onReady
()
{
console
.
info
(
'
onReady
'
);
},
}
notification/ans_standard/publish_test/actsansgetallactive/entry/src/main/js/resources/base/element/string.json
0 → 100644
浏览文件 @
bb3d4d59
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"getAllActive"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
notification/ans_standard/publish_test/actsansgetallactive/entry/src/main/js/resources/base/media/icon.png
0 → 100644
浏览文件 @
bb3d4d59
6.6 KB
notification/ans_standard/publish_test/actsansgetallactive/entry/src/main/js/test/List.test.js
0 → 100644
浏览文件 @
bb3d4d59
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require
(
'
./getAllActive.js
'
)
\ No newline at end of file
notification/ans_standard/publish_test/actsansgetallactive/entry/src/main/js/test/getAllActive.js
0 → 100644
浏览文件 @
bb3d4d59
此差异已折叠。
点击以展开。
notification/ans_standard/publish_test/actsansgetallactive/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
bb3d4d59
文件已添加
notification/ans_standard/publish_test/publish/BUILD.gn
0 → 100644
浏览文件 @
bb3d4d59
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAnsNotificationPublishXts") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAnsNotificationPublishXts"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
notification/ans_standard/publish_test/publish/Test.json
0 → 100644
浏览文件 @
bb3d4d59
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"180000"
,
"package"
:
"com.example.actsanspublishtest"
,
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsAnsNotificationPublishXts.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
notification/ans_standard/publish_test/publish/entry/.gitignore
0 → 100644
浏览文件 @
bb3d4d59
/build
notification/ans_standard/publish_test/publish/entry/src/main/config.json
0 → 100644
浏览文件 @
bb3d4d59
{
"app"
:
{
"bundleName"
:
"com.example.actsanspublishtest"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1
,
"name"
:
"1.0"
},
"apiVersion"
:
{
"compatible"
:
5
,
"target"
:
5
,
"releaseType"
:
"Beta1"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.actsanspublishtest"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"com.example.actsanspublishtest.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:app_name"
,
"type"
:
"page"
,
"isVisible"
:
"true"
,
"launchType"
:
"standard"
,
"visible"
:
true
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
notification/ans_standard/publish_test/publish/entry/src/main/js/default/app.js
0 → 100644
浏览文件 @
bb3d4d59
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export
default
{
onCreate
()
{
console
.
info
(
'
AceApplication onCreate
'
);
},
onDestroy
()
{
console
.
info
(
'
AceApplication onDestroy
'
);
}
};
notification/ans_standard/publish_test/publish/entry/src/main/js/default/i18n/en-US.json
0 → 100644
浏览文件 @
bb3d4d59
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
notification/ans_standard/publish_test/publish/entry/src/main/js/default/i18n/zh-CN.json
0 → 100644
浏览文件 @
bb3d4d59
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
notification/ans_standard/publish_test/publish/entry/src/main/js/default/pages/index/index.css
0 → 100644
浏览文件 @
bb3d4d59
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
100px
;
}
notification/ans_standard/publish_test/publish/entry/src/main/js/default/pages/index/index.hml
0 → 100644
浏览文件 @
bb3d4d59
<div class="container">
<text class="title">
发布Icon通知
</text>
</div>
notification/ans_standard/publish_test/publish/entry/src/main/js/default/pages/index/index.js
0 → 100644
浏览文件 @
bb3d4d59
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
file
from
'
@system.file
'
import
{
Core
,
ExpectExtend
}
from
'
deccjsunit/index
'
const
injectRef
=
Object
.
getPrototypeOf
(
global
)
||
global
injectRef
.
regeneratorRuntime
=
require
(
'
@babel/runtime/regenerator
'
)
export
default
{
data
:
{
title
:
""
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
},
onShow
()
{
console
.
info
(
'
onShow finish
'
)
const
core
=
Core
.
getInstance
()
const
expectExtend
=
new
ExpectExtend
({
'
id
'
:
'
extend
'
})
core
.
addService
(
'
expect
'
,
expectExtend
)
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
configService
.
setConfig
(
this
)
require
(
'
../../../test/List.test
'
)
core
.
execute
()
},
onReady
()
{
console
.
info
(
'
onReady
'
);
},
}
notification/ans_standard/publish_test/publish/entry/src/main/js/resources/base/element/string.json
0 → 100644
浏览文件 @
bb3d4d59
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"pubIcon"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
notification/ans_standard/publish_test/publish/entry/src/main/js/resources/base/media/icon.png
0 → 100644
浏览文件 @
bb3d4d59
6.6 KB
notification/ans_standard/publish_test/publish/entry/src/main/js/test/List.test.js
0 → 100644
浏览文件 @
bb3d4d59
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require
(
'
./publish.js
'
)
\ No newline at end of file
notification/ans_standard/publish_test/publish/entry/src/main/js/test/publish.js
0 → 100644
浏览文件 @
bb3d4d59
此差异已折叠。
点击以展开。
notification/ans_standard/publish_test/publish/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
bb3d4d59
文件已添加
notification/ans_standard/publish_test/sub/BUILD.gn
0 → 100644
浏览文件 @
bb3d4d59
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAnsSubTestXts") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAnsSubTestXts"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./entry/src/main/js/resources" ]
hap_profile = "./entry/src/main/config.json"
}
notification/ans_standard/publish_test/sub/Test.json
0 → 100644
浏览文件 @
bb3d4d59
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"180000"
,
"package"
:
"com.example.actsanssubtest"
,
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsAnsSubTestXts.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
notification/ans_standard/publish_test/sub/entry/.gitignore
0 → 100644
浏览文件 @
bb3d4d59
/build
notification/ans_standard/publish_test/sub/entry/src/main/config.json
0 → 100644
浏览文件 @
bb3d4d59
{
"app"
:
{
"bundleName"
:
"com.example.actsanssubtest"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1
,
"name"
:
"1.0"
},
"apiVersion"
:
{
"compatible"
:
5
,
"target"
:
5
,
"releaseType"
:
"Beta1"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.actsanssubtest"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"com.example.actsanssubtest.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:app_name"
,
"type"
:
"page"
,
"isVisible"
:
"true"
,
"launchType"
:
"standard"
,
"visible"
:
true
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
notification/ans_standard/publish_test/sub/entry/src/main/js/default/app.js
0 → 100644
浏览文件 @
bb3d4d59
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export
default
{
onCreate
()
{
console
.
info
(
'
AceApplication onCreate
'
);
},
onDestroy
()
{
console
.
info
(
'
AceApplication onDestroy
'
);
}
};
notification/ans_standard/publish_test/sub/entry/src/main/js/default/i18n/en-US.json
0 → 100644
浏览文件 @
bb3d4d59
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
notification/ans_standard/publish_test/sub/entry/src/main/js/default/i18n/zh-CN.json
0 → 100644
浏览文件 @
bb3d4d59
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
notification/ans_standard/publish_test/sub/entry/src/main/js/default/pages/index/index.css
0 → 100644
浏览文件 @
bb3d4d59
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
100px
;
}
notification/ans_standard/publish_test/sub/entry/src/main/js/default/pages/index/index.hml
0 → 100644
浏览文件 @
bb3d4d59
<div class="container">
<text class="title">
订阅发布
</text>
</div>
notification/ans_standard/publish_test/sub/entry/src/main/js/default/pages/index/index.js
0 → 100644
浏览文件 @
bb3d4d59
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
file
from
'
@system.file
'
import
{
Core
,
ExpectExtend
}
from
'
deccjsunit/index
'
const
injectRef
=
Object
.
getPrototypeOf
(
global
)
||
global
injectRef
.
regeneratorRuntime
=
require
(
'
@babel/runtime/regenerator
'
)
export
default
{
data
:
{
title
:
""
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
},
onShow
()
{
console
.
info
(
'
onShow finish
'
)
const
core
=
Core
.
getInstance
()
const
expectExtend
=
new
ExpectExtend
({
'
id
'
:
'
extend
'
})
core
.
addService
(
'
expect
'
,
expectExtend
)
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
configService
.
setConfig
(
this
)
require
(
'
../../../test/List.test
'
)
core
.
execute
()
},
onReady
()
{
console
.
info
(
'
onReady
'
);
},
}
notification/ans_standard/publish_test/sub/entry/src/main/js/resources/base/element/string.json
0 → 100644
浏览文件 @
bb3d4d59
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"Subscriber"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
notification/ans_standard/publish_test/sub/entry/src/main/js/resources/base/media/icon.png
0 → 100644
浏览文件 @
bb3d4d59
6.6 KB
notification/ans_standard/publish_test/sub/entry/src/main/js/test/List.test.js
0 → 100644
浏览文件 @
bb3d4d59
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
require
(
'
./Subscriber.js
'
)
\ No newline at end of file
notification/ans_standard/publish_test/sub/entry/src/main/js/test/Subscriber.js
0 → 100644
浏览文件 @
bb3d4d59
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
import
notify
from
'
@ohos.notification
'
;
var
timeout
=
1000
;
describe
(
'
ActsAnsSubTestXts
'
,
function
()
{
console
.
info
(
"
==ActsAnsSubscriberTest start==>
"
);
//ActsSubscriber_test_0100
var
subInfoa
=
{
onConnect
:
connectCallbacka
,
onDisconnect
:
disconnectCallbacka
,
}
function
connectCallbacka
()
{
console
.
debug
(
"
==>connectCallbacka code==>
"
);
}
function
subscribeCallbacka
(
err
)
{
console
.
debug
(
"
==>subscribeCallbacka code==>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
0
);
}
function
unSubscribeCallbacka
(
err
){
console
.
debug
(
"
==>unSubscribeCallbacka code==>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
0
);
}
function
disconnectCallbacka
(){
console
.
debug
(
"
==>disconnectCallbacka code==>
"
);
}
//ActsSubscriber_test_0200
function
connectCallbackb
()
{
console
.
debug
(
"
==>connectCallbackb code==>
"
);
}
function
subscribeCallbackb
(
err
)
{
console
.
debug
(
"
==>subscribeCallbackb code==>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
0
);
}
function
subscribeCallbackc
(
err
)
{
console
.
debug
(
"
==>subscribeCallbackc code==>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
0
);
}
function
unSubscribeCallbackb
(
err
){
console
.
debug
(
"
==>unSubscribeCallbackb code==>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
0
);
}
function
disconnectCallbackb
(){
console
.
debug
(
"
==>disconnectCallbackb code==>
"
);
}
//ActsSubscriber_test_0300
function
connectCallbackc
()
{
console
.
debug
(
"
==>connectCallbackc code==>
"
);
}
function
connectCallbackd
()
{
console
.
debug
(
"
==>connectCallbackd code==>
"
);
}
function
subscribeCallbackd
(
err
)
{
console
.
debug
(
"
==>subscribeCallbackd code==>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
0
);
}
function
subscribeCallbacke
(
err
)
{
console
.
debug
(
"
==>subscribeCallbacke code==>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
0
);
}
function
unSubscribeCallbackc
(
err
){
console
.
debug
(
"
==>unSubscribeCallbackc code==>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
0
);
}
function
unSubscribeCallbackd
(
err
){
console
.
debug
(
"
==>unSubscribeCallbackd code==>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
0
);
}
function
disconnectCallbackc
(){
console
.
debug
(
"
==>disconnectCallbackc code==>
"
);
}
function
disconnectCallbackd
(){
console
.
debug
(
"
==>disconnectCallbackd code==>
"
);
}
//ActsSubscriber_test_0400
function
connectCallbackf
()
{
console
.
debug
(
"
==>connectCallbackf code==>
"
);
}
function
connectCallbackg
()
{
console
.
debug
(
"
==>connectCallbackg code==>
"
);
}
function
subscribeCallbackg
(
err
)
{
console
.
debug
(
"
==>subscribeCallbackg code==>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
0
);
}
function
subscribeCallbackh
(
err
)
{
console
.
debug
(
"
==>subscribeCallbackh code==>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
0
);
}
function
subscribeCallbacki
(
err
)
{
console
.
debug
(
"
==>subscribeCallbacki code==>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
0
);
}
function
unSubscribeCallbackf
(
err
){
console
.
debug
(
"
==>unSubscribeCallbackf code==>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
0
);
}
function
unSubscribeCallbackg
(
err
){
console
.
debug
(
"
==>unSubscribeCallbackg code==>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
0
);
}
function
disconnectCallbackf
(){
console
.
debug
(
"
==>disconnectCallbackf code==>
"
);
}
function
disconnectCallbackg
(){
console
.
debug
(
"
==>disconnectCallbackg code==>
"
);
}
//ActsSubscriber_test_0500
var
subInfob
=
{
onConnect
:
connectCallbacki
,
onDisconnect
:
disconnectCallbacki
,
}
function
connectCallbacki
()
{
console
.
debug
(
"
==>connectCallbacki code==>
"
);
}
function
subscribeCallbackl
(
err
)
{
console
.
debug
(
"
==>subscribeCallbackl code==>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
0
);
}
function
unSubscribeCallbacki
(
err
){
console
.
debug
(
"
==>unSubscribeCallbacki code==>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
0
);
}
function
disconnectCallbacki
(){
console
.
debug
(
"
==>disconnectCallbacki code==>
"
);
}
//ActsSubscriber_test_0600
var
subInfoc
=
{
onConnecte
:
connectCallbackj
,
onDisconnect
:
disconnectCallbackj
,
}
function
connectCallbackj
()
{
console
.
debug
(
"
==>connectCallbackj code==>
"
);
}
function
unSubscribeCallbackj
(
err
){
console
.
debug
(
"
==>unSubscribeCallbackj code==>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
0
);
}
function
disconnectCallbackj
(){
console
.
debug
(
"
==>disconnectCallbackj code==>
"
);
}
//ActsSubscriber_test_0700
var
subInfod
=
{
onConnect
:
connectCallbackm
,
onDisconnect
:
disconnectCallbackl
,
}
function
connectCallbackm
()
{
console
.
debug
(
"
==>connectCallbackm code==>
"
);
}
function
subscribeCallbackn
(
err
)
{
console
.
debug
(
"
==>subscribeCallbackn code==>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
0
);
}
function
unSubscribeCallbackl
(
err
){
console
.
debug
(
"
==>unSubscribeCallbackl code==>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
0
);
}
function
disconnectCallbackl
(){
console
.
debug
(
"
==>disconnectCallbackl code==>
"
);
}
//ActsSubscriber_test_0800
var
subInfoe
=
{
onConnect
:
connectCallbackn
,
onDisconnect
:
disconnectCallbackm
,
}
function
connectCallbackn
()
{
console
.
debug
(
"
==>connectCallbackn code==>
"
);
}
function
unSubscribeCallbackm
(
err
){
console
.
debug
(
"
==>unSubscribeCallbackm code==>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
0
);
}
function
disconnectCallbackm
(){
console
.
debug
(
"
==>disconnectCallbackm code==>
"
);
}
//ActsSubscriber_test_1300
function
connectCallbackl
(){
console
.
debug
(
"
==>connectCallbackl code==>
"
);
}
function
subscribeCallbacko
(
err
){
console
.
debug
(
"
==>subscribeCallbacko code==>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
0
);
}
function
unSubscribeCallbackn
(
err
){
console
.
debug
(
"
==>unSubscribeCallbackn code==>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
0
);
}
function
disconnectCallbackn
(){
console
.
debug
(
"
==>disconnectCallbackn code==>
"
);
}
//ActsSubscriber_test_1400
function
connectCallbacko
(){
console
.
debug
(
"
==>connectCallbacko code==>
"
);
}
function
subscribeCallbackp
(
err
){
console
.
debug
(
"
==>subscribeCallbackp code==>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
0
);
}
function
unSubscribeCallbacko
(
err
){
console
.
debug
(
"
==>unSubscribeCallbacko code==>
"
+
err
.
code
);
expect
(
err
.
code
).
assertEqual
(
0
);
}
function
disconnectCallbacko
(){
console
.
debug
(
"
==>disconnectCallbacko code==>
"
);
}
/*
* @tc.number: ActsSubscriber_test_xts_0100
* @tc.name: subscribe()
* @tc.desc: verify the function of subscribe
*/
it
(
'
ActsSubscriber_test_xts_0100
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
==ActsSubscriber_test_0100==begin==>
"
);
await
notify
.
subscribe
(
subInfoa
,
subscribeCallbacka
);
await
notify
.
unsubscribe
(
subInfoa
,
unSubscribeCallbacka
);
console
.
debug
(
"
==ActsSubscriber_test_0100==end==>
"
);
done
();
})
/*
* @tc.number: ActsSubscriber_test_xts_0200
* @tc.name: subscribe()
* @tc.desc: verify the function of subscribe
*/
it
(
'
ActsSubscriber_test_xts_0200
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
==ActsSubscriber_test_0200==begin==>
"
);
var
subInfo
=
{
onConnect
:
connectCallbackb
,
onDisconnect
:
disconnectCallbackb
,
}
await
notify
.
subscribe
(
subInfo
,
subscribeCallbackb
);
await
notify
.
subscribe
(
subInfo
,
subscribeCallbackc
);
await
notify
.
unsubscribe
(
subInfo
,
unSubscribeCallbackb
);
console
.
debug
(
"
==ActsSubscriber_test_0200==end==>
"
);
done
();
})
/*
* @tc.number: ActsSubscriber_test_xts_0300
* @tc.name: subscribe()
* @tc.desc: verify the function of subscribe
*/
it
(
'
ActsSubscriber_test_xts_0300
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
==ActsSubscriber_test_0300==begin==>
"
);
var
subInfo
=
{
onConnect
:
connectCallbackc
,
onDisconnect
:
disconnectCallbackc
,
}
var
subInfo2
=
{
onConnect
:
connectCallbackd
,
onDisconnect
:
disconnectCallbackd
,
}
await
notify
.
subscribe
(
subInfo
,
subscribeCallbackd
);
await
notify
.
subscribe
(
subInfo2
,
subscribeCallbacke
);
await
notify
.
unsubscribe
(
subInfo
,
unSubscribeCallbackc
);
await
notify
.
unsubscribe
(
subInfo2
,
unSubscribeCallbackd
);
console
.
debug
(
"
==ActsSubscriber_test_0300==end==>
"
);
done
();
})
/*
* @tc.number: ActsSubscriber_test_xts_0400
* @tc.name: subscribe()
* @tc.desc: verify the function of subscribe
*/
it
(
'
ActsSubscriber_test_xts_0400
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
==ActsSubscriber_test_0500==begin==>
"
);
var
subInfo
=
{
onConnect
:
connectCallbackf
,
onDisconnect
:
disconnectCallbackf
,
}
var
subInfo2
=
{
onConnect
:
connectCallbackg
,
onDisconnect
:
disconnectCallbackg
,
}
await
notify
.
subscribe
(
subInfo
,
subscribeCallbackg
);
await
notify
.
subscribe
(
subInfo
,
subscribeCallbackh
);
await
notify
.
subscribe
(
subInfo2
,
subscribeCallbacki
);
await
notify
.
unsubscribe
(
subInfo
,
unSubscribeCallbackf
);
await
notify
.
unsubscribe
(
subInfo2
,
unSubscribeCallbackg
);
console
.
debug
(
"
==ActsSubscriber_test_0500==end==>
"
);
done
();
})
/*
* @tc.number: ActsSubscriber_test_xts_0500
* @tc.name: subscribe()
* @tc.desc: verify the function of subscribe
*/
it
(
'
ActsSubscriber_test_xts_0500
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
==ActsSubscriber_test_0500==begin==>
"
);
await
notify
.
subscribe
(
subInfob
,
{
bundleNames
:[
"
com.example.actsanspublishtest
"
]},
subscribeCallbackl
);
await
notify
.
unsubscribe
(
subInfob
,
unSubscribeCallbacki
);
console
.
debug
(
"
==ActsSubscriber_test_0500==end3==>
"
);
done
();
})
/*
* @tc.number: ActsSubscriber_test_xts_0600
* @tc.name: subscribe()
* @tc.desc: verify the function of subscribe
*/
it
(
'
ActsSubscriber_test_xts_0600
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
==ActsSubscriber_test_0600==begin==>
"
);
await
notify
.
subscribe
(
subInfoc
,
{
bundleNames
:[
"
com.example.actsanspublishtest
"
]}).
then
(
async
()
=>
{
console
.
log
(
"
ActsSubscriber_test_0600=======promise
"
)
await
notify
.
unsubscribe
(
subInfoc
,
unSubscribeCallbackj
)
});
console
.
debug
(
"
==ActsSubscriber_test_0600==end==>
"
);
done
();
})
/*
* @tc.number: ActsSubscriber_test_xts_0700
* @tc.name: subscribe()
* @tc.desc: verify the function of subscribe
*/
it
(
'
ActsSubscriber_test_xts_0700
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
==ActsSubscriber_test_0700==begin==>
"
);
await
notify
.
subscribe
(
subInfod
,
{
bundleNames
:[
"
com.example.actsanspublishtest
"
,
"
com.example.actsanspublishtest
"
]},
subscribeCallbackn
);
console
.
debug
(
"
==ActsSubscriber_test_0700==end==>
"
);
await
notify
.
unsubscribe
(
subInfod
,
unSubscribeCallbackl
);
done
();
})
/*
* @tc.number: ActsSubscriber_test_xts_0800
* @tc.name: subscribe()
* @tc.desc: verify the function of subscribe
*/
it
(
'
ActsSubscriber_test_xts_0800
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
==ActsSubscriber_test_0900==begin==>
"
);
await
notify
.
subscribe
(
subInfoe
,
{
bundleNames
:[
"
com.example.actsanspublishtest
"
,
"
com.example.actsanspublishtest
"
]}).
then
(
async
()
=>
{
console
.
log
(
"
ActsSubscriber_test_0900=======promise
"
)
await
notify
.
unsubscribe
(
subInfoe
,
unSubscribeCallbackm
)
});
console
.
debug
(
"
==ActsSubscriber_test_0900==end==>
"
);
done
();
})
/*
* @tc.number: ActsSubscriber_test_xts_0900
* @tc.name: subscribe()
* @tc.desc: verify the function of subscribe
*/
it
(
'
ActsSubscriber_test_xts_0900
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
==ActsSubscriber_test_1000==begin==>
"
);
var
promise
=
notify
.
subscribe
(
100
,{
bundleNames
:[
"
com.example.actsanspublishtest
"
]});
expect
(
promise
).
assertEqual
(
undefined
);
console
.
debug
(
"
==ActsSubscriber_test_1000==end==>
"
);
done
();
})
/*
* @tc.number: ActsSubscriber_test_xts_1000
* @tc.name: subscribe()
* @tc.desc: verify the function of subscribe
*/
it
(
'
ActsSubscriber_test_xts_1000
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
==ActsSubscriber_test_1000==begin==>
"
);
var
subInfo
=
null
var
promise
=
await
notify
.
subscribe
(
subInfo
,{
bundleNames
:[
"
com.example.actsanspublishtest
"
]});
expect
(
promise
).
assertEqual
(
undefined
);
console
.
debug
(
"
==ActsSubscriber_test_1000==end==>
"
);
done
();
})
/*
* @tc.number: ActsSubscriber_test_xts_1100
* @tc.name: subscribe()
* @tc.desc: verify the function of subscribe
*/
it
(
'
ActsSubscriber_test_xts_1100
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
==ActsSubscriber_test_1200==begin==>
"
);
var
subInfo
=
"
#$#%$%$^&%^%
"
var
promise
=
notify
.
subscribe
(
subInfo
,{
bundleNames
:[
"
com.example.actsanspublishtest
"
]});
expect
(
promise
).
assertEqual
(
undefined
);
console
.
debug
(
"
==ActsSubscriber_test_1200==end==>
"
);
done
();
})
/*
* @tc.number: ActsSubscriber_test_xts_1200
* @tc.name: subscribe()
* @tc.desc: verify the function of subscribe
*/
it
(
'
ActsSubscriber_test_xts_1200
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
==ActsSubscriber_test_1200==begin==>
"
);
var
subInfo
=
""
var
promise
=
await
notify
.
subscribe
(
subInfo
,{
bundleNames
:[
"
com.example.actsanspublishtest
"
]});
expect
(
promise
).
assertEqual
(
undefined
);
console
.
debug
(
"
==ActsSubscriber_test_1200==end==>
"
);
done
();
})
/*
* @tc.number: ActsSubscriber_test_xts_1300
* @tc.name: subscribe()
* @tc.desc: verify the function of subscribe
*/
it
(
'
ActsSubscriber_test_xts_1300
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
==ActsSubscriber_test_1300==begin==>
"
);
var
subInfo
=
{
onConnect
:
connectCallbackl
,
onDisconnect
:
disconnectCallbackn
,
}
await
notify
.
subscribe
(
subInfo
,{
bundleNames
:[
"
wrongBudleName
"
]},
subscribeCallbacko
);
await
notify
.
unsubscribe
(
subInfo
,
unSubscribeCallbackn
);
console
.
debug
(
"
==ActsSubscriber_test_1300==end==>
"
);
done
();
})
/*
* @tc.number: ActsSubscriber_test_xts_1400
* @tc.name: subscribe()
* @tc.desc: verify the function of subscribe
*/
it
(
'
ActsSubscriber_test_xts_1400
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
==ActsSubscriber_test_1400==begin==>
"
);
var
subInfo
=
{
onConnect
:
connectCallbacko
,
onDisconnect
:
disconnectCallbacko
,
}
try
{
await
notify
.
subscribe
(
subInfo
,
{
bundleNames
:
[]},
subscribeCallbackp
);
}
catch
(
err
){
console
.
debug
(
"
==ActsSubscriber_test_1400==err==>
"
+
err
);
}
console
.
debug
(
"
==ActsSubscriber_test_1400==end==>
"
);
done
();
})
})
notification/ans_standard/publish_test/sub/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
bb3d4d59
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录