Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
d5beb43e
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
接近 2 年 前同步成功
通知
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看板
提交
d5beb43e
编写于
10月 14, 2021
作者:
O
openharmony_ci
提交者:
Gitee
10月 14, 2021
浏览文件
操作
浏览文件
下载
差异文件
!891 L2 失败用例修改
Merge pull request !891 from jiyong/OpenHarmony-3.0-LTS
上级
92328f7c
64528138
变更
70
隐藏空白更改
内联
并排
Showing
70 changed file
with
1326 addition
and
93 deletion
+1326
-93
appexecfwk/ams_standard/serviceability/actsparticleabilitytest/entry/src/main/js/test/ActsParticleAbilityTest.test.js
...st/entry/src/main/js/test/ActsParticleAbilityTest.test.js
+61
-61
notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/test/ExampleJsunit.test.js
...testcallback/entry/src/main/js/test/ExampleJsunit.test.js
+4
-4
notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/test/ExampleJsunit.test.js
...ttestpromise/entry/src/main/js/test/ExampleJsunit.test.js
+4
-4
notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/test/ExampleJsunit.test.js
...moveslottest/entry/src/main/js/test/ExampleJsunit.test.js
+1
-1
notification/ans_standard/publish_test/BUILD.gn
notification/ans_standard/publish_test/BUILD.gn
+4
-0
notification/ans_standard/publish_test/activeButton/.gitignore
...ication/ans_standard/publish_test/activeButton/.gitignore
+15
-0
notification/ans_standard/publish_test/activeButton/.idea/.gitignore
...n/ans_standard/publish_test/activeButton/.idea/.gitignore
+3
-0
notification/ans_standard/publish_test/activeButton/.idea/compiler.xml
...ans_standard/publish_test/activeButton/.idea/compiler.xml
+6
-0
notification/ans_standard/publish_test/activeButton/.idea/gradle.xml
...n/ans_standard/publish_test/activeButton/.idea/gradle.xml
+22
-0
notification/ans_standard/publish_test/activeButton/.idea/jarRepositories.xml
...ndard/publish_test/activeButton/.idea/jarRepositories.xml
+30
-0
notification/ans_standard/publish_test/activeButton/.idea/misc.xml
...ion/ans_standard/publish_test/activeButton/.idea/misc.xml
+4
-0
notification/ans_standard/publish_test/activeButton/BUILD.gn
notification/ans_standard/publish_test/activeButton/BUILD.gn
+30
-0
notification/ans_standard/publish_test/activeButton/Test.json
...fication/ans_standard/publish_test/activeButton/Test.json
+18
-0
notification/ans_standard/publish_test/activeButton/entry/.gitignore
...n/ans_standard/publish_test/activeButton/entry/.gitignore
+1
-0
notification/ans_standard/publish_test/activeButton/entry/src/main/config.json
...dard/publish_test/activeButton/entry/src/main/config.json
+62
-0
notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/app.js
...ublish_test/activeButton/entry/src/main/js/default/app.js
+22
-0
notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/i18n/en-US.json
...st/activeButton/entry/src/main/js/default/i18n/en-US.json
+6
-0
notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/i18n/zh-CN.json
...st/activeButton/entry/src/main/js/default/i18n/zh-CN.json
+6
-0
notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/pages/index/index.css
...iveButton/entry/src/main/js/default/pages/index/index.css
+9
-0
notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/pages/index/index.hml
...iveButton/entry/src/main/js/default/pages/index/index.hml
+5
-0
notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/pages/index/index.js
...tiveButton/entry/src/main/js/default/pages/index/index.js
+47
-0
notification/ans_standard/publish_test/activeButton/entry/src/main/js/resources/base/element/string.json
...tton/entry/src/main/js/resources/base/element/string.json
+12
-0
notification/ans_standard/publish_test/activeButton/entry/src/main/js/resources/base/media/icon.png
...iveButton/entry/src/main/js/resources/base/media/icon.png
+0
-0
notification/ans_standard/publish_test/activeButton/entry/src/main/js/test/ActiveButton.js
..._test/activeButton/entry/src/main/js/test/ActiveButton.js
+146
-0
notification/ans_standard/publish_test/activeButton/entry/src/main/js/test/List.test.js
...ish_test/activeButton/entry/src/main/js/test/List.test.js
+15
-0
notification/ans_standard/publish_test/activeButton/signature/openharmony_sx.p7b
...rd/publish_test/activeButton/signature/openharmony_sx.p7b
+0
-0
notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/default/pages/index/index.hml
...ationfive/entry/src/main/js/default/pages/index/index.hml
+1
-1
notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/test/BadgeDisplay.js
...lenotificationfive/entry/src/main/js/test/BadgeDisplay.js
+3
-2
notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/test/BadgeDisplay.js
...lenotificationfour/entry/src/main/js/test/BadgeDisplay.js
+3
-2
notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/test/BadgeDisplay.js
...lenotificationfive/entry/src/main/js/test/BadgeDisplay.js
+3
-2
notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/test/BadgeDisplay.js
...lenotificationfour/entry/src/main/js/test/BadgeDisplay.js
+3
-2
notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/config.json
.../getactive/getactivenormal/sub/entry/src/main/config.json
+2
-2
notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/test/WantAgent.test.js
...tagentinfoonepro/entry/src/main/js/test/WantAgent.test.js
+4
-4
notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/test/WantAgent.test.js
...tagentinfotwopro/entry/src/main/js/test/WantAgent.test.js
+7
-6
notification/ans_standard/publish_test/publishcontentype/entry/src/main/config.json
...publish_test/publishcontentype/entry/src/main/config.json
+2
-2
notification/ans_standard/publish_test/publishicontest/BUILD.gn
...cation/ans_standard/publish_test/publishicontest/BUILD.gn
+31
-0
notification/ans_standard/publish_test/publishicontest/Test.json
...ation/ans_standard/publish_test/publishicontest/Test.json
+19
-0
notification/ans_standard/publish_test/publishicontest/entry/src/main/config.json
...d/publish_test/publishicontest/entry/src/main/config.json
+61
-0
notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/app.js
...ish_test/publishicontest/entry/src/main/js/default/app.js
+22
-0
notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/i18n/en-US.json
...publishicontest/entry/src/main/js/default/i18n/en-US.json
+6
-0
notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/i18n/zh-CN.json
...publishicontest/entry/src/main/js/default/i18n/zh-CN.json
+6
-0
notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/pages/index/index.css
...hicontest/entry/src/main/js/default/pages/index/index.css
+9
-0
notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/pages/index/index.hml
...hicontest/entry/src/main/js/default/pages/index/index.hml
+5
-0
notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/pages/index/index.js
...shicontest/entry/src/main/js/default/pages/index/index.js
+47
-0
notification/ans_standard/publish_test/publishicontest/entry/src/main/js/resources/base/element/string.json
...test/entry/src/main/js/resources/base/element/string.json
+12
-0
notification/ans_standard/publish_test/publishicontest/entry/src/main/js/resources/base/media/icon.png
...hicontest/entry/src/main/js/resources/base/media/icon.png
+0
-0
notification/ans_standard/publish_test/publishicontest/entry/src/main/js/test/Icon.js
...blish_test/publishicontest/entry/src/main/js/test/Icon.js
+99
-0
notification/ans_standard/publish_test/publishicontest/entry/src/main/js/test/List.test.js
..._test/publishicontest/entry/src/main/js/test/List.test.js
+15
-0
notification/ans_standard/publish_test/publishicontest/signature/openharmony_sx.p7b
...publish_test/publishicontest/signature/openharmony_sx.p7b
+0
-0
notification/ans_standard/publish_test/publishimage/.gitignore
...ication/ans_standard/publish_test/publishimage/.gitignore
+15
-0
notification/ans_standard/publish_test/publishimage/.idea/.gitignore
...n/ans_standard/publish_test/publishimage/.idea/.gitignore
+3
-0
notification/ans_standard/publish_test/publishimage/.idea/compiler.xml
...ans_standard/publish_test/publishimage/.idea/compiler.xml
+6
-0
notification/ans_standard/publish_test/publishimage/.idea/gradle.xml
...n/ans_standard/publish_test/publishimage/.idea/gradle.xml
+22
-0
notification/ans_standard/publish_test/publishimage/.idea/jarRepositories.xml
...ndard/publish_test/publishimage/.idea/jarRepositories.xml
+30
-0
notification/ans_standard/publish_test/publishimage/.idea/misc.xml
...ion/ans_standard/publish_test/publishimage/.idea/misc.xml
+4
-0
notification/ans_standard/publish_test/publishimage/BUILD.gn
notification/ans_standard/publish_test/publishimage/BUILD.gn
+30
-0
notification/ans_standard/publish_test/publishimage/Test.json
...fication/ans_standard/publish_test/publishimage/Test.json
+18
-0
notification/ans_standard/publish_test/publishimage/entry/.gitignore
...n/ans_standard/publish_test/publishimage/entry/.gitignore
+1
-0
notification/ans_standard/publish_test/publishimage/entry/src/main/config.json
...dard/publish_test/publishimage/entry/src/main/config.json
+62
-0
notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/app.js
...ublish_test/publishimage/entry/src/main/js/default/app.js
+22
-0
notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/i18n/en-US.json
...st/publishimage/entry/src/main/js/default/i18n/en-US.json
+6
-0
notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/i18n/zh-CN.json
...st/publishimage/entry/src/main/js/default/i18n/zh-CN.json
+6
-0
notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/pages/index/index.css
...lishimage/entry/src/main/js/default/pages/index/index.css
+9
-0
notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/pages/index/index.hml
...lishimage/entry/src/main/js/default/pages/index/index.hml
+5
-0
notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/pages/index/index.js
...blishimage/entry/src/main/js/default/pages/index/index.js
+47
-0
notification/ans_standard/publish_test/publishimage/entry/src/main/js/resources/base/element/string.json
...mage/entry/src/main/js/resources/base/element/string.json
+12
-0
notification/ans_standard/publish_test/publishimage/entry/src/main/js/resources/base/media/icon.png
...lishimage/entry/src/main/js/resources/base/media/icon.png
+0
-0
notification/ans_standard/publish_test/publishimage/entry/src/main/js/test/List.test.js
...ish_test/publishimage/entry/src/main/js/test/List.test.js
+15
-0
notification/ans_standard/publish_test/publishimage/entry/src/main/js/test/publishImage.js
..._test/publishimage/entry/src/main/js/test/publishImage.js
+120
-0
notification/ans_standard/publish_test/publishimage/signature/openharmony_sx.p7b
...rd/publish_test/publishimage/signature/openharmony_sx.p7b
+0
-0
未找到文件。
appexecfwk/ams_standard/serviceability/actsparticleabilitytest/entry/src/main/js/test/ActsParticleAbilityTest.test.js
浏览文件 @
d5beb43e
...
...
@@ -15,7 +15,7 @@
import
commonEvent
from
"
@ohos.commonevent
"
import
rpc
from
"
@ohos.rpc
"
import
featureAbility
from
'
@ohos.ability.featureAbility
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
const
TIMEOUT
=
9000
;
const
START_ABILITY_TIMEOUT
=
5000
;
...
...
@@ -27,7 +27,7 @@ var subscriberInfoStartAbility_0200 = {
events
:
[
"
ACTS_Particle_StartAbility_0200_CommonEvent
"
],
};
describe
(
'
Acts
StServic
eAbilityTest
'
,
function
()
{
describe
(
'
Acts
Particl
eAbilityTest
'
,
function
()
{
let
bundleName
=
"
com.example.particletestserver
"
;
let
abilityName
=
"
com.example.particletestserver.MainAbility
"
;
var
mRemote
;
...
...
@@ -55,10 +55,10 @@ describe('ActsStServiceAbilityTest', function () {
}
/*
* @tc.number: ACTS_ParticleAbility_startAbility_0100
* @tc.name: ConnectAbility : Connects an ability to a Service abilit
y.
* @tc.desc: Check the return value of the interface (by P
romise)
*/
* @tc.number: ACTS_ParticleAbility_startAbility_0100
* @tc.name: ConnectAbility : Connects an ability to a Service ability and use service to test startAbilti
y.
* @tc.desc: Check the event of the interface startAbiltiy (by p
romise)
*/
it
(
'
ACTS_ParticleAbility_startAbility_0100
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
ACTS_ParticleAbility_startAbility_0100====<begin
'
);
console
.
log
(
'
========StartConnect called
'
);
...
...
@@ -118,68 +118,68 @@ describe('ActsStServiceAbilityTest', function () {
},
TIMEOUT
);
})
/*
/*
* @tc.number: ACTS_ParticleAbility_startAbility_0200
* @tc.name: ConnectAbility : Connects an ability to a Service ability.
* @tc.desc: Check the
return value of the interface (by Promise
)
* @tc.name: ConnectAbility : Connects an ability to a Service ability
and use service to test startAbiltiy
.
* @tc.desc: Check the
event of the interface startAbiltiy (by callback
)
*/
it
(
'
ACTS_ParticleAbility_startAbility_0200
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
ACTS_ParticleAbility_startAbility_0200====<begin
'
);
console
.
log
(
'
========StartConnect called
'
);
var
subscriber
;
let
id
;
let
connId
;
function
subscribeCallBack
(
err
,
data
)
{
clearTimeout
(
id
);
expect
(
data
.
event
).
assertEqual
(
"
ACTS_Particle_StartAbility_0200_CommonEvent
"
);
console
.
debug
(
"
====>Subscribe CallBack data:====>
"
+
JSON
.
stringify
(
data
));
var
result
=
featureAbility
.
disconnectAbility
(
it
(
'
ACTS_ParticleAbility_startAbility_0200
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
ACTS_ParticleAbility_startAbility_0200====<begin
'
);
console
.
log
(
'
========StartConnect called
'
);
var
subscriber
;
let
id
;
let
connId
;
function
subscribeCallBack
(
err
,
data
)
{
clearTimeout
(
id
);
expect
(
data
.
event
).
assertEqual
(
"
ACTS_Particle_StartAbility_0200_CommonEvent
"
);
console
.
debug
(
"
====>Subscribe CallBack data:====>
"
+
JSON
.
stringify
(
data
));
var
result
=
featureAbility
.
disconnectAbility
(
connId
,
(
error
,
data
)
=>
{
(
error
,
data
)
=>
{
console
.
log
(
'
featureAbilityTest DisconnectAbility result errCode :
'
+
error
.
code
+
"
data:
"
+
data
)
},
);
console
.
log
(
'
DisconnectNative ConnectAbility result :
'
+
result
);
commonEvent
.
unsubscribe
(
subscriber
,
unSubscribeCallback
)
done
();
}
commonEvent
.
createSubscriber
(
subscriberInfoStartAbility_0200
).
then
(
async
(
data
)
=>
{
console
.
debug
(
"
====>Create Subscriber====>
"
);
subscriber
=
data
;
await
commonEvent
.
subscribe
(
subscriber
,
subscribeCallBack
);
})
function
unSubscribeCallback
()
{
console
.
debug
(
"
====>UnSubscribe CallBack====>
"
);
done
();
}
function
timeout
()
{
expect
().
assertFail
();
console
.
debug
(
'
ACTS_ParticleAbility_startAbility_0200 timeout
'
);
commonEvent
.
unsubscribe
(
subscriber
,
unSubscribeCallback
)
done
();
}
id
=
setTimeout
(
timeout
,
START_ABILITY_TIMEOUT
);
connId
=
await
featureAbility
.
connectAbility
(
{
bundleName
:
bundleName
,
abilityName
:
abilityName
,
action
:
"
StartAbilityCallback
"
},
{
onConnect
:
onConnectCallback
,
onDisconnect
:
onDisconnectCallback
,
onFailed
:
onFailedCallback
,
},
);
console
.
log
(
'
StartConnectNative ConnectAbility connId :
'
+
connId
);
setTimeout
(
function
()
{
console
.
log
(
'
StartConnectNative ConnectAbility timeout
'
)
},
TIMEOUT
);
commonEvent
.
unsubscribe
(
subscriber
,
unSubscribeCallback
)
done
();
}
commonEvent
.
createSubscriber
(
subscriberInfoStartAbility_0200
).
then
(
async
(
data
)
=>
{
console
.
debug
(
"
====>Create Subscriber====>
"
);
subscriber
=
data
;
await
commonEvent
.
subscribe
(
subscriber
,
subscribeCallBack
);
})
function
unSubscribeCallback
()
{
console
.
debug
(
"
====>UnSubscribe CallBack====>
"
);
done
();
}
function
timeout
()
{
expect
().
assertFail
();
console
.
debug
(
'
ACTS_ParticleAbility_startAbility_0200 timeout
'
);
commonEvent
.
unsubscribe
(
subscriber
,
unSubscribeCallback
)
done
();
}
id
=
setTimeout
(
timeout
,
START_ABILITY_TIMEOUT
);
connId
=
await
featureAbility
.
connectAbility
(
{
bundleName
:
bundleName
,
abilityName
:
abilityName
,
action
:
"
StartAbilityCallback
"
},
{
onConnect
:
onConnectCallback
,
onDisconnect
:
onDisconnectCallback
,
onFailed
:
onFailedCallback
,
},
);
console
.
log
(
'
StartConnectNative ConnectAbility connId :
'
+
connId
);
setTimeout
(
function
()
{
console
.
log
(
'
StartConnectNative ConnectAbility timeout
'
)
},
TIMEOUT
);
})
})
\ No newline at end of file
notification/ans_standard/actsansslottest/actsansgetslottestcallback/entry/src/main/js/test/ExampleJsunit.test.js
浏览文件 @
d5beb43e
...
...
@@ -63,7 +63,7 @@ describe('ActsAnsGetSlotTestCallback', function () {
expect
(
err
.
code
).
assertEqual
(
0
);
console
.
debug
(
"
====>getSlotActsAnsGetSlotTestCallback_0100 data====>
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
type
).
assertEqual
(
notification
.
SlotType
.
SOCIAL_COMMUNICATION
);
expect
(
data
.
level
).
assertEqual
(
3
);
expect
(
data
.
level
).
assertEqual
(
4
);
expect
(
data
.
desc
).
assertEqual
(
""
);
expect
(
data
.
badgeFlag
).
assertEqual
(
true
);
expect
(
data
.
bypassDnd
).
assertEqual
(
false
);
...
...
@@ -127,7 +127,7 @@ describe('ActsAnsGetSlotTestCallback', function () {
expect
(
err
.
code
).
assertEqual
(
0
);
console
.
debug
(
"
====>getSlotActsAnsGetSlotTestCallback_0300 data====>
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
type
).
assertEqual
(
notification
.
SlotType
.
CONTENT_INFORMATION
);
expect
(
data
.
level
).
assertEqual
(
3
);
expect
(
data
.
level
).
assertEqual
(
2
);
expect
(
data
.
desc
).
assertEqual
(
""
);
expect
(
data
.
badgeFlag
).
assertEqual
(
true
);
expect
(
data
.
bypassDnd
).
assertEqual
(
false
);
...
...
@@ -161,7 +161,7 @@ describe('ActsAnsGetSlotTestCallback', function () {
expect
(
err
.
code
).
assertEqual
(
0
);
console
.
debug
(
"
====>getSlotActsAnsGetSlotTestCallback_0400 data====>
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
type
).
assertEqual
(
notification
.
SlotType
.
OTHER_TYPES
);
expect
(
data
.
level
).
assertEqual
(
3
);
expect
(
data
.
level
).
assertEqual
(
1
);
expect
(
data
.
desc
).
assertEqual
(
""
);
expect
(
data
.
badgeFlag
).
assertEqual
(
true
);
expect
(
data
.
bypassDnd
).
assertEqual
(
false
);
...
...
@@ -195,7 +195,7 @@ describe('ActsAnsGetSlotTestCallback', function () {
expect
(
err
.
code
).
assertEqual
(
0
);
console
.
debug
(
"
====>getSlotActsAnsGetSlotTestCallback_0500 data====>
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
type
).
assertEqual
(
notification
.
SlotType
.
OTHER_TYPES
);
expect
(
data
.
level
).
assertEqual
(
3
);
expect
(
data
.
level
).
assertEqual
(
1
);
expect
(
data
.
desc
).
assertEqual
(
""
);
expect
(
data
.
badgeFlag
).
assertEqual
(
true
);
expect
(
data
.
bypassDnd
).
assertEqual
(
false
);
...
...
notification/ans_standard/actsansslottest/actsansgetslottestpromise/entry/src/main/js/test/ExampleJsunit.test.js
浏览文件 @
d5beb43e
...
...
@@ -32,7 +32,7 @@ describe('ActsAnsGetSlotTestPromise', function () {
console
.
debug
(
"
====>getSlotActsAnsGetSlotTestPromise_0100 enter====>
"
);
console
.
debug
(
"
====>getSlotActsAnsGetSlotTestPromise_0100 data====>
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
type
).
assertEqual
(
notification
.
SlotType
.
SOCIAL_COMMUNICATION
);
expect
(
data
.
level
).
assertEqual
(
3
);
expect
(
data
.
level
).
assertEqual
(
4
);
expect
(
data
.
desc
).
assertEqual
(
""
);
expect
(
data
.
badgeFlag
).
assertEqual
(
true
);
expect
(
data
.
bypassDnd
).
assertEqual
(
false
);
...
...
@@ -99,7 +99,7 @@ describe('ActsAnsGetSlotTestPromise', function () {
console
.
debug
(
"
====>getSlotPromise CONTENT_INFORMATION ActsAnsGetSlotTestPromise_0300 enter====>
"
);
console
.
debug
(
"
====>getSlotPromise ActsAnsGetSlotTestPromise_0300 data====>
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
type
).
assertEqual
(
notification
.
SlotType
.
CONTENT_INFORMATION
);
expect
(
data
.
level
).
assertEqual
(
3
);
expect
(
data
.
level
).
assertEqual
(
2
);
expect
(
data
.
desc
).
assertEqual
(
""
);
expect
(
data
.
badgeFlag
).
assertEqual
(
true
);
expect
(
data
.
bypassDnd
).
assertEqual
(
false
);
...
...
@@ -133,7 +133,7 @@ describe('ActsAnsGetSlotTestPromise', function () {
console
.
debug
(
"
====>getSlotPromise OTHER_TYPES ActsAnsGetSlotTestPromise_0400 enter====>
"
);
console
.
debug
(
"
====>getSlotPromise ActsAnsGetSlotTestPromise_0400 data====>
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
type
).
assertEqual
(
notification
.
SlotType
.
OTHER_TYPES
);
expect
(
data
.
level
).
assertEqual
(
3
);
expect
(
data
.
level
).
assertEqual
(
1
);
expect
(
data
.
desc
).
assertEqual
(
""
);
expect
(
data
.
badgeFlag
).
assertEqual
(
true
);
expect
(
data
.
bypassDnd
).
assertEqual
(
false
);
...
...
@@ -167,7 +167,7 @@ describe('ActsAnsGetSlotTestPromise', function () {
console
.
debug
(
"
====>getSlotPromise UNKNOWN_TYPE ActsAnsGetSlotTestPromise_0500 enter====>
"
);
console
.
debug
(
"
====>getSlotPromise ActsAnsGetSlotTestPromise_0500 data====>
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
type
).
assertEqual
(
notification
.
SlotType
.
OTHER_TYPES
);
expect
(
data
.
level
).
assertEqual
(
3
);
expect
(
data
.
level
).
assertEqual
(
1
);
expect
(
data
.
desc
).
assertEqual
(
""
);
expect
(
data
.
badgeFlag
).
assertEqual
(
true
);
expect
(
data
.
bypassDnd
).
assertEqual
(
false
);
...
...
notification/ans_standard/actsansslottest/actsansremoveslottest/entry/src/main/js/test/ExampleJsunit.test.js
浏览文件 @
d5beb43e
...
...
@@ -32,7 +32,7 @@ describe('ActsAnsRemoveSlotTest', function () {
console
.
debug
(
"
====>getSlotActsAnsGetSlotTestPromise_0100 enter====>
"
);
console
.
debug
(
"
====>getSlotActsAnsGetSlotTestPromise_0100 data====>
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
type
).
assertEqual
(
notification
.
SlotType
.
SOCIAL_COMMUNICATION
);
expect
(
data
.
level
).
assertEqual
(
3
);
expect
(
data
.
level
).
assertEqual
(
4
);
expect
(
data
.
desc
).
assertEqual
(
""
);
expect
(
data
.
badgeFlag
).
assertEqual
(
true
);
expect
(
data
.
bypassDnd
).
assertEqual
(
false
);
...
...
notification/ans_standard/publish_test/BUILD.gn
浏览文件 @
d5beb43e
...
...
@@ -20,6 +20,7 @@ group("publish_test") {
#"badgedisplayed:badgedisplayed",
#"badgedisplayedset:badgedisplayedset",
"enablenotification:enablenotification",
#"enablenotificationset:enablenotificationset",
#"getactive:getactive",
"getwantagentinfo:getwantagentinfo",
...
...
@@ -27,6 +28,9 @@ group("publish_test") {
#"publishcontentype:ActsAnsNotificationTest",
#"subscribe:subscribe",
#"unsubscribe:ActsAnsUnSubscriberTest",
#"activeButton:ActsAnsActionButtonTest",
#"publishicontest:ActsAnsIconTest",
#"publishimage:ActsAnsPublishImageTest",
"wantagent:wantagent",
]
}
...
...
notification/ans_standard/publish_test/activeButton/.gitignore
0 → 100644
浏览文件 @
d5beb43e
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
/entry/.preview
.cxx
notification/ans_standard/publish_test/activeButton/.idea/.gitignore
0 → 100644
浏览文件 @
d5beb43e
# Default ignored files
/shelf/
/workspace.xml
notification/ans_standard/publish_test/activeButton/.idea/compiler.xml
0 → 100644
浏览文件 @
d5beb43e
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"CompilerConfiguration"
>
<bytecodeTargetLevel
target=
"1.8"
/>
</component>
</project>
\ No newline at end of file
notification/ans_standard/publish_test/activeButton/.idea/gradle.xml
0 → 100644
浏览文件 @
d5beb43e
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"GradleMigrationSettings"
migrationVersion=
"1"
/>
<component
name=
"GradleSettings"
>
<option
name=
"linkedExternalProjectsSettings"
>
<GradleProjectSettings>
<option
name=
"testRunner"
value=
"PLATFORM"
/>
<option
name=
"distributionType"
value=
"LOCAL"
/>
<option
name=
"externalProjectPath"
value=
"$PROJECT_DIR$"
/>
<option
name=
"gradleHome"
value=
"D:\HUAWEI\DevEco Studio 2.1.0.301\tools\gradle"
/>
<option
name=
"modules"
>
<set>
<option
value=
"$PROJECT_DIR$"
/>
<option
value=
"$PROJECT_DIR$/entry"
/>
</set>
</option>
<option
name=
"resolveModulePerSourceSet"
value=
"false"
/>
<option
name=
"useQualifiedModuleNames"
value=
"false"
/>
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
notification/ans_standard/publish_test/activeButton/.idea/jarRepositories.xml
0 → 100644
浏览文件 @
d5beb43e
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"RemoteRepositoriesConfiguration"
>
<remote-repository>
<option
name=
"id"
value=
"central"
/>
<option
name=
"name"
value=
"Maven Central repository"
/>
<option
name=
"url"
value=
"https://repo1.maven.org/maven2"
/>
</remote-repository>
<remote-repository>
<option
name=
"id"
value=
"jboss.community"
/>
<option
name=
"name"
value=
"JBoss Community repository"
/>
<option
name=
"url"
value=
"https://repository.jboss.org/nexus/content/repositories/public/"
/>
</remote-repository>
<remote-repository>
<option
name=
"id"
value=
"maven2"
/>
<option
name=
"name"
value=
"maven2"
/>
<option
name=
"url"
value=
"https://developer.huawei.com/repo/"
/>
</remote-repository>
<remote-repository>
<option
name=
"id"
value=
"BintrayJCenter"
/>
<option
name=
"name"
value=
"BintrayJCenter"
/>
<option
name=
"url"
value=
"https://jcenter.bintray.com/"
/>
</remote-repository>
<remote-repository>
<option
name=
"id"
value=
"maven"
/>
<option
name=
"name"
value=
"maven"
/>
<option
name=
"url"
value=
"https://repo.huaweicloud.com/repository/maven/"
/>
</remote-repository>
</component>
</project>
\ No newline at end of file
notification/ans_standard/publish_test/activeButton/.idea/misc.xml
0 → 100644
浏览文件 @
d5beb43e
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_8"
default=
"true"
project-jdk-name=
"1.8"
project-jdk-type=
"JavaSDK"
/>
</project>
\ No newline at end of file
notification/ans_standard/publish_test/activeButton/BUILD.gn
0 → 100644
浏览文件 @
d5beb43e
# 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("ActsAnsActionButtonTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAnsActionButtonTest"
}
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/activeButton/Test.json
0 → 100644
浏览文件 @
d5beb43e
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"60000"
,
"package"
:
"com.example.actsansactionbuttontest"
,
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsAnsActionButtonTest"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
notification/ans_standard/publish_test/activeButton/entry/.gitignore
0 → 100644
浏览文件 @
d5beb43e
/build
notification/ans_standard/publish_test/activeButton/entry/src/main/config.json
0 → 100644
浏览文件 @
d5beb43e
{
"app"
:
{
"bundleName"
:
"com.example.actsansactionbuttontest"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1
,
"name"
:
"1.0"
},
"apiVersion"
:
{
"compatible"
:
5
,
"target"
:
5
,
"releaseType"
:
"Beta1"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.actsansactionbuttontest"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"com.example.actsansactionbuttontest.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
}
}
]
}
}
\ No newline at end of file
notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/app.js
0 → 100644
浏览文件 @
d5beb43e
/*
* 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/activeButton/entry/src/main/js/default/i18n/en-US.json
0 → 100644
浏览文件 @
d5beb43e
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/i18n/zh-CN.json
0 → 100644
浏览文件 @
d5beb43e
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/pages/index/index.css
0 → 100644
浏览文件 @
d5beb43e
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
100px
;
}
notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/pages/index/index.hml
0 → 100644
浏览文件 @
d5beb43e
<div class="container">
<text class="title">
activeButton
</text>
</div>
notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/pages/index/index.js
0 → 100644
浏览文件 @
d5beb43e
/*
* 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/activeButton/entry/src/main/js/resources/base/element/string.json
0 → 100644
浏览文件 @
d5beb43e
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"ActiveBtn"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
notification/ans_standard/publish_test/activeButton/entry/src/main/js/resources/base/media/icon.png
0 → 100644
浏览文件 @
d5beb43e
6.6 KB
notification/ans_standard/publish_test/activeButton/entry/src/main/js/test/ActiveButton.js
0 → 100644
浏览文件 @
d5beb43e
/*
* 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
notify
from
'
@ohos.notification
'
import
wantagent
from
'
@ohos.wantAgent
'
import
image
from
'
@ohos.multimedia.image
'
import
{
OperationType
,
Flags
}
from
'
@ohos.wantagent
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
var
largeBuffer
var
smallBuffer
var
opts
var
subInfo
var
largeIcon
var
smallIcon
var
time
=
1000
describe
(
'
ActsAnsActionButtonTest
'
,
function
()
{
console
.
info
(
"
===========ActsDoNotSubscriberTest start====================>
"
);
//consume
function
consumeCallback
(
err
,
data
)
{
console
.
debug
(
"
==========================>consumeDoNotCallbackOne data : =======================>
"
+
err
+
JSON
.
stringify
(
data
));
expect
(
typeof
(
data
.
request
.
actionButtons
)).
assertEqual
(
'
object
'
)
for
(
let
i
=
0
;
i
<
data
.
request
.
actionButtons
;
i
++
)
{
console
.
debug
(
"
======consumeCallback====data.actionButtons.title:====>
"
+
data
.
request
.
actionButtons
[
i
].
title
);
console
.
debug
(
"
======consumeCallback====sortings.hashCode:====>
"
+
data
.
request
.
actionButtons
[
i
].
wantAgent
);
console
.
debug
(
"
======consumeCallback====sortings.hashCode:====>
"
+
data
.
request
.
actionButtons
[
i
].
icon
);
}
}
//consume
function
consumeCallbackTwo
(
err
,
data
)
{
console
.
debug
(
"
==========================>consumeDoNotCallbackTwo data : =======================>
"
+
err
+
JSON
.
stringify
(
data
));
expect
(
typeof
(
data
.
request
.
actionButtons
)).
assertEqual
(
'
object
'
)
for
(
let
i
=
0
;
i
<
data
.
request
.
actionButtons
;
i
++
)
{
console
.
debug
(
"
======consumeDoNotCallbackTwo====sortings.hashCode:====>
"
+
data
.
request
.
actionButtons
[
i
].
title
);
console
.
debug
(
"
======consumeDoNotCallbackTwo====sortings.hashCode:====>
"
+
data
.
request
.
actionButtons
[
i
].
wantAgent
);
console
.
debug
(
"
======consumeCallback====sortings.hashCode:====>
"
+
data
.
request
.
actionButtons
[
i
].
icon
);
}
}
//subscribe
function
subscribeCallback
(
err
)
{
console
.
debug
(
"
==========================>subscribeDoNotCallback=======================>
"
);
}
function
publishCallback200
(){
console
.
debug
(
"
==========================>publishCallback200=======================>
"
);
}
/*
* @tc.number: ActsDoNotSubscriber_test_0100
* @tc.name: subscribe()
* @tc.desc: verify the function of subscribe
*/
it
(
'
ActsActiveButton_test_0100
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
===============ActsActiveButton_test_0100======begin====================>
"
);
var
subInfo
=
{
onConsume
:
consumeCallback
}
try
{
await
notify
.
subscribe
(
subInfo
,
subscribeCallback
);
}
catch
(
err
)
{
console
.
error
(
'
=ActsActiveButton_test_0100 订阅 activeButton err:
'
+
err
);
}
console
.
debug
(
"
===============ActsActiveButton_test_0100=======end3===================>
"
);
var
agentInfo
=
{
wants
:
[
{
deviceId
:
"
deviceId
"
,
bundleName
:
"
com.example.test
"
,
abilityName
:
"
com.example.test.TriggerAbility
"
,
action
:
"
action1
"
,
entities
:
[
"
entity1
"
],
type
:
"
MIMETYPE
"
,
uri
:
"
key={true,true,false}
"
,
parameters
:
{
mykey0
:
2222
,
mykey1
:
[
1
,
2
,
3
],
mykey2
:
"
[1, 2, 3]
"
,
mykey3
:
"
ssssssssssssssssssssssssss
"
,
mykey4
:
[
false
,
true
,
false
],
mykey5
:
[
"
qqqqq
"
,
"
wwwwww
"
,
"
aaaaaaaaaaaaaaaaa
"
],
mykey6
:
true
,
}
}
],
operationType
:
OperationType
.
START_ABILITY
,
requestCode
:
0
,
wantAgentFlags
:[
Flags
.
UPDATE_PRESENT_FLAG
]
};
var
wantAgentData
=
await
wantagent
.
getWantAgent
(
agentInfo
);
largeBuffer
=
new
ArrayBuffer
(
64
);
smallBuffer
=
new
ArrayBuffer
(
32
);
opts
=
{
alphaType
:
0
,
editable
:
true
,
pixelFormat
:
4
,
scaleMode
:
1
,
size
:
{
height
:
2
,
width
:
3
}}
const
promise_Large
=
image
.
createPixelMap
(
largeBuffer
,
opts
);
promise_Large
.
then
((
data
)
=>
{
console
.
debug
(
"
==========================createPixelMap_promise_Large=======================>
"
);
largeIcon
=
data
;
console
.
debug
(
"
==========================createPixelMap_promise_Large largeIcon=======================>
"
+
largeIcon
);
const
promise_Small
=
image
.
createPixelMap
(
smallBuffer
,
opts
);
promise_Small
.
then
((
data
)
=>
{
console
.
debug
(
"
==========================createPixelMap_promise_Small=======================>
"
);
smallIcon
=
data
;
console
.
debug
(
"
==========================createPixelMap_promise_Small smallIcon=======================>
"
+
smallIcon
);
var
notificationRequest
=
{
content
:{
contentType
:
notify
.
ContentType
.
NOTIFICATION_CONTENT_LONG_TEXT
,
longText
:
{
title
:
"
test_title
"
,
text
:
"
test_text
"
,
additionalText
:
"
test_additionalText
"
,
longText
:
"
long_text
"
,
briefText
:
"
long_briefText
"
,
expandedTitle
:
"
long_expandedTitle
"
},
},
id
:
1
,
slotType
:
notify
.
SlotType
.
SERVICE_INFORMATION
,
actionButtons
:
[{
title
:
"
button
"
,
wantAgent
:
wantAgentData
,
icon
:
largeIcon
},{
title
:
"
button
"
,
wantAgent
:
wantAgentData
,
icon
:
smallIcon
}]
}
notify
.
publish
(
notificationRequest
,
publishCallback200
);
console
.
info
(
"
===============ActsActiveButton_test_0100==========================>
"
);
done
();
setTimeout
(
function
(){
console
.
debug
(
"
====>time out ActsActiveButton_test_0100====>
"
);
},
time
);
})
})
})
})
notification/ans_standard/publish_test/activeButton/entry/src/main/js/test/List.test.js
0 → 100644
浏览文件 @
d5beb43e
/*
* 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
(
'
./ActiveButton.js
'
)
notification/ans_standard/publish_test/activeButton/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
d5beb43e
文件已添加
notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/default/pages/index/index.hml
浏览文件 @
d5beb43e
<div class="container">
<text class="title">
通知许可设定--参数传空
0928
通知许可设定--参数传空
1111
</text>
</div>
notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/test/BadgeDisplay.js
浏览文件 @
d5beb43e
...
...
@@ -42,10 +42,11 @@ describe('ActsAnsEnableNotificationFiveTest', function () {
* @tc.desc: verify the function of enableNotification
*/
it
(
'
ActsEnableNotification_test_1000
'
,
0
,
async
function
(
done
)
{
await
notify
.
enableNotification
(
var
promise
=
notify
.
enableNotification
(
{
bundle
:
"
com.example.actsanslocalnotificationtest
"
,
},
""
).
then
(
console
.
log
(
"
====>ActsEnableNotification_test_1000 success====>
"
))
},
""
)
expect
(
promise
).
assertEqual
(
undefined
)
done
();
setTimeout
(
function
(){
console
.
debug
(
"
====>time out ActsEnableNotification_test_1000====>
"
);
...
...
notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/test/BadgeDisplay.js
浏览文件 @
d5beb43e
...
...
@@ -42,10 +42,11 @@ describe('ActsAnsEnableNotificationFourTest', function () {
* @tc.desc: verify the function of enableNotification
*/
it
(
'
ActsEnableNotification_test_0800
'
,
0
,
async
function
(
done
)
{
await
notify
.
enableNotification
(
var
promise
=
notify
.
enableNotification
(
{
bundle
:
"
com.example.actsanslocalnotificationtest
"
,
},
100
).
then
(
console
.
log
(
"
====>ActsEnableNotification_test_0800 success====>
"
))
},
100
)
expect
(
promise
).
assertEqual
(
undefined
)
done
();
setTimeout
(
function
(){
console
.
debug
(
"
====>time out ActsEnableNotification_test_0800====>
"
);
...
...
notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/test/BadgeDisplay.js
浏览文件 @
d5beb43e
...
...
@@ -42,10 +42,11 @@ describe('ActsAnsEnableNotificationSetFiveTest', function () {
* @tc.desc: verify the function of enableNotification
*/
it
(
'
ActsEnableNotificationSet_test_1000
'
,
0
,
async
function
(
done
)
{
await
notify
.
enableNotification
(
var
promise
=
notify
.
enableNotification
(
{
bundle
:
"
com.example.actsanslocalnotificationtest
"
,
},
""
).
then
(
console
.
log
(
"
====>ActsEnableNotificationSet_test_1000 success====>
"
))
},
""
)
expect
(
promise
).
assertEqual
(
undefined
)
done
();
setTimeout
(
function
(){
console
.
debug
(
"
====>time out ActsEnableNotificationSet_test_1000====>
"
);
...
...
notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/test/BadgeDisplay.js
浏览文件 @
d5beb43e
...
...
@@ -42,10 +42,11 @@ describe('ActsAnsEnableNotificationSetFourTest', function () {
* @tc.desc: verify the function of enableNotification
*/
it
(
'
ActsEnableNotificationSet_test_0800
'
,
0
,
async
function
(
done
)
{
await
notify
.
enableNotification
(
var
promise
=
notify
.
enableNotification
(
{
bundle
:
"
com.example.actsanslocalnotificationtest
"
,
},
100
).
then
(
console
.
log
(
"
====>ActsEnableNotificationSet_test_0800 success====>
"
))
},
100
)
expect
(
promise
).
assertEqual
(
undefined
)
done
();
setTimeout
(
function
(){
console
.
debug
(
"
====>time out ActsEnableNotificationSet_test_0800====>
"
);
...
...
notification/ans_standard/publish_test/getactive/getactivenormal/sub/entry/src/main/config.json
浏览文件 @
d5beb43e
{
"app"
:
{
"bundleName"
:
"com.
neu
.actsansactivesubscribertest"
,
"bundleName"
:
"com.
example
.actsansactivesubscribertest"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1
,
...
...
@@ -59,4 +59,4 @@
}
]
}
}
\ No newline at end of file
}
notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/test/WantAgent.test.js
浏览文件 @
d5beb43e
...
...
@@ -147,17 +147,17 @@ describe('ActsAnsGetWantAgentInfoOneProTest', function () {
console
.
info
(
data
);
expect
(
typeof
(
data
)).
assertEqual
(
"
object
"
);
wantAgent
.
equal
(
WantAgent1
,
WantAgent2
).
then
(
(
error
,
data
)
=>
{
(
data
)
=>
{
console
.
info
(
'
----equalPromise1 success!----
'
)
console
.
info
(
data
);
expect
(
typeof
(
data
)).
assertEqual
(
"
boolean
"
);
expect
(
data
).
assertEqual
(
false
);
}
)
wantAgent
.
equal
(
WantAgent1
,
WantAgent1
).
then
(
(
error
,
data
)
=>
{
(
data
)
=>
{
console
.
info
(
'
----equalPromise2 success!----
'
)
console
.
info
(
data
);
expect
(
typeof
(
data
)).
assertEqual
(
"
boolean
"
);
expect
(
data
).
assertEqual
(
true
);
}
)
}
...
...
notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/test/WantAgent.test.js
浏览文件 @
d5beb43e
...
...
@@ -71,10 +71,10 @@ describe('ActsAnsGetWantAgentInfoTwoProTest', function () {
expect
(
typeof
(
data
)).
assertEqual
(
"
object
"
);
}
done
();
}),
setTimeout
(
function
(){
console
.
debug
(
"
====>time out ACTS_SetWantInfo_0700====>
"
);
},
time
)
}),
console
.
info
(
'
----getWantAgent1 after----
'
);
})
...
...
@@ -121,17 +121,17 @@ describe('ActsAnsGetWantAgentInfoTwoProTest', function () {
console
.
info
(
data
);
expect
(
typeof
(
data
)).
assertEqual
(
"
object
"
);
wantAgent
.
equal
(
WantAgent1
,
WantAgent2
).
then
(
(
error
,
data
)
=>
{
(
data
)
=>
{
console
.
info
(
'
----equalPromise1 success!----
'
)
console
.
info
(
data
);
expect
(
typeof
(
data
)).
assertEqual
(
"
boolean
"
);
expect
(
data
).
assertEqual
(
false
);
}
)
wantAgent
.
equal
(
WantAgent1
,
WantAgent1
).
then
(
(
error
,
data
)
=>
{
(
data
)
=>
{
console
.
info
(
'
----equalPromise2 success!----
'
)
console
.
info
(
data
);
expect
(
typeof
(
data
)).
assertEqual
(
"
boolean
"
);
expect
(
data
).
assertEqual
(
true
);
}
)
}
...
...
@@ -141,10 +141,11 @@ describe('ActsAnsGetWantAgentInfoTwoProTest', function () {
expect
(
typeof
(
data
)).
assertEqual
(
"
object
"
);
}
done
();
});
setTimeout
(
function
(){
console
.
debug
(
"
====>time out ACTS_SetWantInfo_0800====>
"
);
},
time
)
});
console
.
info
(
'
----getWantAgent2 after----
'
);
})
})
...
...
notification/ans_standard/publish_test/publishcontentype/entry/src/main/config.json
浏览文件 @
d5beb43e
{
"app"
:
{
"bundleName"
:
"com.
neu
.actsansnotificationtest"
,
"bundleName"
:
"com.
example
.actsansnotificationtest"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1
,
...
...
@@ -59,4 +59,4 @@
}
]
}
}
\ No newline at end of file
}
notification/ans_standard/publish_test/publishicontest/BUILD.gn
0 → 100644
浏览文件 @
d5beb43e
# 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("ActsAnsIconTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAnsIconTest"
}
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/publishicontest/Test.json
0 → 100644
浏览文件 @
d5beb43e
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"120000"
,
"package"
:
"com.example.actsansicontest"
,
"shell-timeout"
:
"120000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsAnsIconTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
notification/ans_standard/publish_test/publishicontest/entry/src/main/config.json
0 → 100644
浏览文件 @
d5beb43e
{
"app"
:
{
"bundleName"
:
"com.example.actsansicontest"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1
,
"name"
:
"1.0"
},
"apiVersion"
:
{
"compatible"
:
5
,
"target"
:
5
,
"releaseType"
:
"Beta1"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.actsansicontest"
,
"name"
:
".actsansicontest"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"com.example.actsansicontest.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
notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/app.js
0 → 100644
浏览文件 @
d5beb43e
/*
* 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/publishicontest/entry/src/main/js/default/i18n/en-US.json
0 → 100644
浏览文件 @
d5beb43e
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/i18n/zh-CN.json
0 → 100644
浏览文件 @
d5beb43e
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/pages/index/index.css
0 → 100644
浏览文件 @
d5beb43e
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
100px
;
}
notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/pages/index/index.hml
0 → 100644
浏览文件 @
d5beb43e
<div class="container">
<text class="title">
icon_pixcelMap
</text>
</div>
notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/pages/index/index.js
0 → 100644
浏览文件 @
d5beb43e
/*
* 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/publishicontest/entry/src/main/js/resources/base/element/string.json
0 → 100644
浏览文件 @
d5beb43e
{
"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/publishicontest/entry/src/main/js/resources/base/media/icon.png
0 → 100644
浏览文件 @
d5beb43e
6.6 KB
notification/ans_standard/publish_test/publishicontest/entry/src/main/js/test/Icon.js
0 → 100644
浏览文件 @
d5beb43e
/*
* 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
notify
from
'
@ohos.notification
'
import
image
from
'
@ohos.multimedia.image
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
var
largeBuffer
var
smallBuffer
var
opts
var
subInfo
var
largeIcon
var
smallIcon
var
time
=
1000
describe
(
'
ActsAnsIconTest
'
,
function
()
{
console
.
info
(
"
===========ActsAnsIconTest start====================>
"
);
//consume
function
consumeCallback
(
err
,
data
)
{
console
.
debug
(
"
==========================consumeCallback data : =======================>
"
+
err
+
JSON
.
stringify
(
data
));
console
.
log
(
"
==========================consumeCallback smallIcon : =======================>
"
+
JSON
.
stringify
(
data
.
request
.
smallIcon
))
console
.
log
(
"
==========================consumeCallback largeIcon : =======================>
"
+
JSON
.
stringify
(
data
.
request
.
largeIcon
))
}
function
subscribeCallback
(
err
)
{
console
.
info
(
"
==========================subscribeCallback start=======================>
"
);
console
.
info
(
"
================subscribeCallback err : =======================>
"
+
JSON
.
stringify
(
err
));
console
.
info
(
"
==========================subscribeCallback end=======================>
"
);
}
function
publishCallback
(
err
){
console
.
info
(
"
==========================publishCallback start=======================>
"
);
console
.
info
(
"
================publishCallback err : =======================>
"
+
JSON
.
stringify
(
err
));
console
.
info
(
"
==========================publishCallback end=======================>
"
);
}
/*
* @tc.number: ActsAnsIconTest_0100
* @tc.name: createPixelMap()
* @tc.desc: verify the function of subscribe
*/
it
(
'
ActsAnsIconTest_0100
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
===============ActsAnsIconTest_0100 start====================>
"
);
subInfo
=
{
onConsume
:
consumeCallback
,
}
await
notify
.
subscribe
(
subInfo
,
subscribeCallback
);
largeBuffer
=
new
ArrayBuffer
(
64
);
smallBuffer
=
new
ArrayBuffer
(
32
);
opts
=
{
alphaType
:
0
,
editable
:
true
,
pixelFormat
:
4
,
scaleMode
:
1
,
size
:
{
height
:
2
,
width
:
3
}}
const
promise_Large
=
image
.
createPixelMap
(
largeBuffer
,
opts
);
promise_Large
.
then
((
data
)
=>
{
console
.
debug
(
"
==========================createPixelMap_promise_Large=======================>
"
);
largeIcon
=
data
;
console
.
debug
(
"
==========================createPixelMap_promise_Large largeIcon=======================>
"
+
largeIcon
);
const
promise_Small
=
image
.
createPixelMap
(
smallBuffer
,
opts
);
promise_Small
.
then
((
data
)
=>
{
console
.
debug
(
"
==========================createPixelMap_promise_Small=======================>
"
);
smallIcon
=
data
;
console
.
debug
(
"
==========================createPixelMap_promise_Small smallIcon=======================>
"
+
smallIcon
);
notify
.
publish
({
id
:
1
,
content
:
{
contentType
:
notify
.
ContentType
.
NOTIFICATION_CONTENT_BASIC_TEXT
,
normal
:
{
title
:
"
test1_title
"
,
text
:
"
test1_text
"
,
additionalText
:
"
test1_additionalText
"
},
},
slotType
:
notify
.
SlotType
.
SOCIAL_COMMUNICATION
,
classification
:
"
classification1
"
,
sortingKey
:
"
sortingKey1
"
,
smallIcon
:
smallIcon
,
largeIcon
:
largeIcon
,
},
publishCallback
);
done
();
setTimeout
(
function
(){
console
.
debug
(
"
====>time out ActsAnsIconTest_0100====>
"
);
},
time
);
});
})
})
});
notification/ans_standard/publish_test/publishicontest/entry/src/main/js/test/List.test.js
0 → 100644
浏览文件 @
d5beb43e
/*
* 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
(
'
./Icon.js
'
)
\ No newline at end of file
notification/ans_standard/publish_test/publishicontest/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
d5beb43e
文件已添加
notification/ans_standard/publish_test/publishimage/.gitignore
0 → 100644
浏览文件 @
d5beb43e
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
/entry/.preview
.cxx
notification/ans_standard/publish_test/publishimage/.idea/.gitignore
0 → 100644
浏览文件 @
d5beb43e
# Default ignored files
/shelf/
/workspace.xml
notification/ans_standard/publish_test/publishimage/.idea/compiler.xml
0 → 100644
浏览文件 @
d5beb43e
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"CompilerConfiguration"
>
<bytecodeTargetLevel
target=
"1.8"
/>
</component>
</project>
\ No newline at end of file
notification/ans_standard/publish_test/publishimage/.idea/gradle.xml
0 → 100644
浏览文件 @
d5beb43e
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"GradleMigrationSettings"
migrationVersion=
"1"
/>
<component
name=
"GradleSettings"
>
<option
name=
"linkedExternalProjectsSettings"
>
<GradleProjectSettings>
<option
name=
"testRunner"
value=
"PLATFORM"
/>
<option
name=
"distributionType"
value=
"LOCAL"
/>
<option
name=
"externalProjectPath"
value=
"$PROJECT_DIR$"
/>
<option
name=
"gradleHome"
value=
"D:\HUAWEI\DevEco Studio 2.1.0.301\tools\gradle"
/>
<option
name=
"modules"
>
<set>
<option
value=
"$PROJECT_DIR$"
/>
<option
value=
"$PROJECT_DIR$/entry"
/>
</set>
</option>
<option
name=
"resolveModulePerSourceSet"
value=
"false"
/>
<option
name=
"useQualifiedModuleNames"
value=
"false"
/>
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
notification/ans_standard/publish_test/publishimage/.idea/jarRepositories.xml
0 → 100644
浏览文件 @
d5beb43e
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"RemoteRepositoriesConfiguration"
>
<remote-repository>
<option
name=
"id"
value=
"central"
/>
<option
name=
"name"
value=
"Maven Central repository"
/>
<option
name=
"url"
value=
"https://repo1.maven.org/maven2"
/>
</remote-repository>
<remote-repository>
<option
name=
"id"
value=
"jboss.community"
/>
<option
name=
"name"
value=
"JBoss Community repository"
/>
<option
name=
"url"
value=
"https://repository.jboss.org/nexus/content/repositories/public/"
/>
</remote-repository>
<remote-repository>
<option
name=
"id"
value=
"maven2"
/>
<option
name=
"name"
value=
"maven2"
/>
<option
name=
"url"
value=
"https://developer.huawei.com/repo/"
/>
</remote-repository>
<remote-repository>
<option
name=
"id"
value=
"BintrayJCenter"
/>
<option
name=
"name"
value=
"BintrayJCenter"
/>
<option
name=
"url"
value=
"https://jcenter.bintray.com/"
/>
</remote-repository>
<remote-repository>
<option
name=
"id"
value=
"maven"
/>
<option
name=
"name"
value=
"maven"
/>
<option
name=
"url"
value=
"https://repo.huaweicloud.com/repository/maven/"
/>
</remote-repository>
</component>
</project>
\ No newline at end of file
notification/ans_standard/publish_test/publishimage/.idea/misc.xml
0 → 100644
浏览文件 @
d5beb43e
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_8"
default=
"true"
project-jdk-name=
"1.8"
project-jdk-type=
"JavaSDK"
/>
</project>
\ No newline at end of file
notification/ans_standard/publish_test/publishimage/BUILD.gn
0 → 100644
浏览文件 @
d5beb43e
# 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("ActsAnsPublishImageTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAnsPublishImageTest"
}
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/publishimage/Test.json
0 → 100644
浏览文件 @
d5beb43e
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"60000"
,
"package"
:
"com.example.actsanspublishimagetest"
,
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsAnsPublishImageTest"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
notification/ans_standard/publish_test/publishimage/entry/.gitignore
0 → 100644
浏览文件 @
d5beb43e
/build
notification/ans_standard/publish_test/publishimage/entry/src/main/config.json
0 → 100644
浏览文件 @
d5beb43e
{
"app"
:
{
"bundleName"
:
"com.example.actsanspublishimagetest"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1
,
"name"
:
"1.0"
},
"apiVersion"
:
{
"compatible"
:
5
,
"target"
:
5
,
"releaseType"
:
"Beta1"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.actsanspublishimagetest"
,
"name"
:
".MyApplication"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"com.example.actsanspublishimagetest.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
}
}
]
}
}
\ No newline at end of file
notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/app.js
0 → 100644
浏览文件 @
d5beb43e
/*
* 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/publishimage/entry/src/main/js/default/i18n/en-US.json
0 → 100644
浏览文件 @
d5beb43e
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/i18n/zh-CN.json
0 → 100644
浏览文件 @
d5beb43e
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/pages/index/index.css
0 → 100644
浏览文件 @
d5beb43e
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
100px
;
}
notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/pages/index/index.hml
0 → 100644
浏览文件 @
d5beb43e
<div class="container">
<text class="title">
发布图片通知
</text>
</div>
notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/pages/index/index.js
0 → 100644
浏览文件 @
d5beb43e
/*
* 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/publishimage/entry/src/main/js/resources/base/element/string.json
0 → 100644
浏览文件 @
d5beb43e
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"Pubimage"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
notification/ans_standard/publish_test/publishimage/entry/src/main/js/resources/base/media/icon.png
0 → 100644
浏览文件 @
d5beb43e
6.6 KB
notification/ans_standard/publish_test/publishimage/entry/src/main/js/test/List.test.js
0 → 100644
浏览文件 @
d5beb43e
/*
* 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
(
'
./publishImage.js
'
)
notification/ans_standard/publish_test/publishimage/entry/src/main/js/test/publishImage.js
0 → 100644
浏览文件 @
d5beb43e
/*
* 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
notify
from
'
@ohos.notification
'
import
image
from
'
@ohos.multimedia.image
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
var
imageBuffer
var
opts
var
pubimage
var
time
=
1000
describe
(
'
ActsAnsPublishImageTest
'
,
function
()
{
console
.
info
(
"
===========ActsDoNotSubscriberTest start====================>
"
);
//consume
function
consumeCallbackOne
(
err
,
data
)
{
console
.
debug
(
"
==========================>consumeDoNotCallback1 data : =======================>
"
+
err
+
JSON
.
stringify
(
data
));
checkConsumeData
(
data
)
}
function
consumeCallbackTwo
(
err
,
data
)
{
console
.
debug
(
"
==========================>consumeDoNotCallback2 data : =======================>
"
+
err
+
JSON
.
stringify
(
data
));
checkConsumeData
(
data
)
}
function
checkConsumeData
(
data
){
expect
(
typeof
(
data
)).
assertEqual
(
"
object
"
);
expect
(
data
.
id
).
assertEqual
(
1
);
expect
(
data
.
content
.
contentType
).
assertEqual
(
notify
.
ContentType
.
NOTIFICATION_CONTENT_PICTURE
);
expect
(
data
.
content
.
picture
.
title
).
assertEqual
(
"
image_title
"
);
expect
(
data
.
content
.
picture
.
text
).
assertEqual
(
"
image_text
"
);
expect
(
data
.
content
.
picture
.
additionalText
).
assertEqual
(
"
image_additionalText
"
);
expect
(
data
.
content
.
picture
.
briefText
).
assertEqual
(
"
image_briefText
"
);
expect
(
data
.
content
.
picture
.
expandedTitle
).
assertEqual
(
"
expandedTitle
"
);
// expect(typeof(data.content.picture.picture)).assertEqual();
expect
(
data
.
slotType
).
assertEqual
(
notify
.
SlotType
.
SOCIAL_COMMUNICATION
);
expect
(
data
.
classification
).
assertEqual
(
"
classification1
"
);
expect
(
data
.
sortingKey
).
assertEqual
(
"
sortingKey1
"
);
}
//subscribeOn
function
subscribeOnCallback
(
err
)
{
console
.
debug
(
"
==========================>subscribeDoNotOnCallback=======================>
"
);
}
//subscribe
function
subscribeCallback
(
err
)
{
console
.
debug
(
"
==========================>subscribeDoNotCallback=======================>
"
);
}
function
publishCallback001
(){
console
.
log
(
'
ActsAnsPublishImageTest ACTS_Publish_0100 asyncCallback
'
)
}
/*
* @tc.number: ActsPublishImage_test_0100
* @tc.name: subscribe()
* @tc.desc: verify the function of subscribe
*/
it
(
'
ActsPublishImage_test_0100
'
,
0
,
async
function
(
done
)
{
console
.
debug
(
"
===============ActsDoNotSubscriber_test_0100======begin====================>
"
);
var
subInfo
=
{
onConsume
:
consumeCallbackOne
,
onConnecte
:
subscribeOnCallback
,
}
try
{
await
notify
.
subscribe
(
subInfo
,
subscribeCallback
);
}
catch
(
err
)
{
console
.
error
(
'
=ActsDoNotSubscriber_test_0100 订阅 subscribeDoNotCallback err:
'
+
err
);
}
console
.
debug
(
"
===============ActsSubscriber_test_0100=======end3===================>
"
);
done
();
setTimeout
(
function
(){
console
.
debug
(
"
====>time out ActsPublishImage_test_0100====>
"
);
},
time
);
})
/*
* @tc.number: ACTS_publishTest_0100
* @tc.name: publish()
* @tc.desc: verify the function of publish
*/
it
(
'
ActsPublishImage_test_0200
'
,
0
,
async
function
(
done
)
{
imageBuffer
=
new
ArrayBuffer
(
32
);
opts
=
{
alphaType
:
0
,
editable
:
true
,
pixelFormat
:
4
,
scaleMode
:
1
,
size
:
{
height
:
2
,
width
:
3
}}
const
promise_Large
=
image
.
createPixelMap
(
imageBuffer
,
opts
);
promise_Large
.
then
((
data
)
=>
{
console
.
debug
(
"
==========================createPixelMap_promise_Large=======================>
"
);
pubimage
=
data
;
console
.
debug
(
"
==========================createPixelMap_promise_Large largeIcon=======================>
"
+
pubimage
);
notify
.
publish
({
id
:
1
,
content
:
{
contentType
:
notify
.
ContentType
.
NOTIFICATION_CONTENT_PICTURE
,
picture
:
{
title
:
"
image_title
"
,
text
:
"
image_text
"
,
additionalText
:
"
image_additionalText
"
,
briefText
:
"
image_brief
"
,
expandedTitle
:
"
expandedTitle
"
,
picture
:
pubimage
},
},
slotType
:
notify
.
SlotType
.
SOCIAL_COMMUNICATION
,
classification
:
"
classification1
"
,
sortingKey
:
"
sortingKey1
"
,
},
publishCallback001
);
done
()
setTimeout
(
function
(){
console
.
debug
(
"
====>time out ACTS_publishTest_0100====>
"
);
},
time
);
})
})
})
notification/ans_standard/publish_test/publishimage/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
d5beb43e
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录