Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
8836be1b
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看板
提交
8836be1b
编写于
8月 27, 2022
作者:
C
chenxuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
hiappeventsujstest
Signed-off-by:
N
chenxuihui
<
chenxuhui2@huawei.com
>
上级
c3919b36
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
50 addition
and
2153 deletion
+50
-2153
hiviewdfx/hiappeventtest/hiappeventsubjstest/src/main/js/default/app.js
...peventtest/hiappeventsubjstest/src/main/js/default/app.js
+0
-22
hiviewdfx/hiappeventtest/hiappeventsubjstest/src/main/js/default/i18n/en-US.json
...t/hiappeventsubjstest/src/main/js/default/i18n/en-US.json
+0
-6
hiviewdfx/hiappeventtest/hiappeventsubjstest/src/main/js/default/i18n/zh-CN.json
...t/hiappeventsubjstest/src/main/js/default/i18n/zh-CN.json
+0
-6
hiviewdfx/hiappeventtest/hiappeventsubjstest/src/main/js/default/pages/index/index.css
...peventsubjstest/src/main/js/default/pages/index/index.css
+0
-9
hiviewdfx/hiappeventtest/hiappeventsubjstest/src/main/js/default/pages/index/index.hml
...peventsubjstest/src/main/js/default/pages/index/index.hml
+0
-5
hiviewdfx/hiappeventtest/hiappeventsubjstest/src/main/js/default/pages/index/index.js
...ppeventsubjstest/src/main/js/default/pages/index/index.js
+0
-46
hiviewdfx/hiappeventtest/hiappeventsubjstest/src/main/js/default/test/HiAppEventSub.test.js
...tsubjstest/src/main/js/default/test/HiAppEventSub.test.js
+0
-1991
hiviewdfx/hiappeventtest/hiappeventsubjstest/src/main/js/default/test/List.test.js
...hiappeventsubjstest/src/main/js/default/test/List.test.js
+0
-18
hiviewdfx/hiappeventtest/hiappeventsubjstest/src/main/js/test/HiAppEventSub.test.js
...iappeventsubjstest/src/main/js/test/HiAppEventSub.test.js
+48
-48
hiviewdfx/hiappeventtest/hiappeventsubjstest/src/main/js/test/List.test.js
...enttest/hiappeventsubjstest/src/main/js/test/List.test.js
+2
-2
未找到文件。
hiviewdfx/hiappeventtest/hiappeventsubjstest/src/main/js/default/app.js
已删除
100755 → 0
浏览文件 @
c3919b36
/*
* 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
'
);
}
};
hiviewdfx/hiappeventtest/hiappeventsubjstest/src/main/js/default/i18n/en-US.json
已删除
100755 → 0
浏览文件 @
c3919b36
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
hiviewdfx/hiappeventtest/hiappeventsubjstest/src/main/js/default/i18n/zh-CN.json
已删除
100755 → 0
浏览文件 @
c3919b36
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
hiviewdfx/hiappeventtest/hiappeventsubjstest/src/main/js/default/pages/index/index.css
已删除
100755 → 0
浏览文件 @
c3919b36
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
100px
;
}
hiviewdfx/hiappeventtest/hiappeventsubjstest/src/main/js/default/pages/index/index.hml
已删除
100755 → 0
浏览文件 @
c3919b36
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
hiviewdfx/hiappeventtest/hiappeventsubjstest/src/main/js/default/pages/index/index.js
已删除
100755 → 0
浏览文件 @
c3919b36
/*
* 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
app
from
'
@system.app
'
import
device
from
'
@system.device
'
import
router
from
'
@system.router
'
import
{
Core
,
ExpectExtend
,
Constant
}
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
()
{
},
}
\ No newline at end of file
hiviewdfx/hiappeventtest/hiappeventsubjstest/src/main/js/default/test/HiAppEventSub.test.js
已删除
100755 → 0
浏览文件 @
c3919b36
此差异已折叠。
点击以展开。
hiviewdfx/hiappeventtest/hiappeventsubjstest/src/main/js/default/test/List.test.js
已删除
100755 → 0
浏览文件 @
c3919b36
/*
* 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
HiAppEventApiTest
from
'
./HiAppEventSub.test.js
'
export
default
function
testsuite
()
{
HiAppEventApiTest
()
}
hiviewdfx/hiappeventtest/hiappeventsubjstest/src/main/js/test/HiAppEventSub.test.js
浏览文件 @
8836be1b
...
...
@@ -16,8 +16,8 @@ import HiAppEvent from '@ohos.hiAppEvent'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
Constant
from
'
deccjsunit/src/Constant
'
export
default
function
Hi
appeventsubt
est
()
{
describe
(
'
Hi
appeventsubt
est
'
,
function
()
{
export
default
function
Hi
AppEventSubT
est
()
{
describe
(
'
Hi
AppEventSubT
est
'
,
function
()
{
/**
* @tc.number DFX_DFT_HiAppEvent_Sub_0100
...
...
@@ -120,13 +120,13 @@ describe('Hiappeventsubtest', function () {
*/
it
(
'
HiAppEventSub02
'
,
3
,
async
function
(
done
)
{
console
.
info
(
'
testHiAppEventSub02 start
'
)
function
sleep
(
numberMillis
){
function
sleep
(
numberMillis
)
{
var
now
=
new
Date
();
var
exitTime
=
now
.
getTime
()
+
numberMillis
;
while
(
true
){
var
exitTime
=
now
.
getTime
()
+
numberMillis
;
while
(
true
)
{
now
=
new
Date
();
if
(
now
.
getTime
()
>
exitTime
)
return
;
if
(
now
.
getTime
()
>
exitTime
)
return
;
}
}
let
holder
=
HiAppEvent
.
addWatcher
({
...
...
@@ -593,7 +593,7 @@ describe('Hiappeventsubtest', function () {
console
.
info
(
'
HiAppEventSub07 end
'
)
},
1000
)
})
/**
* @tc.number DFX_DFT_HiAppEvent_Sub_0800
* @tc.name 验证调用hiAppEvent.addWatcher,domain为无效,事件订阅失败
...
...
@@ -647,7 +647,7 @@ describe('Hiappeventsubtest', function () {
console
.
info
(
'
HiAppEventSub08 end
'
)
},
1000
)
})
/**
* @tc.number DFX_DFT_HiAppEvent_Sub_0900
* @tc.name 验证调用hiAppEvent.addWatcher,设置domain,eventType为FAULT,事件订阅成功
...
...
@@ -1003,7 +1003,8 @@ describe('Hiappeventsubtest', function () {
appEventFilters
:
[
{
domain
:
"
default
"
,
eventTypes
:
[
HiAppEvent
.
EventType
.
FAULT
,
HiAppEvent
.
EventType
.
STATISTIC
,
HiAppEvent
.
EventType
.
SECURITY
,
HiAppEvent
.
EventType
.
BEHAVIOR
]
eventTypes
:
[
HiAppEvent
.
EventType
.
FAULT
,
HiAppEvent
.
EventType
.
STATISTIC
,
HiAppEvent
.
EventType
.
SECURITY
,
HiAppEvent
.
EventType
.
BEHAVIOR
]
}
],
triggerCondition
:
{
...
...
@@ -1089,7 +1090,8 @@ describe('Hiappeventsubtest', function () {
name
:
"
watcher1
"
,
appEventFilters
:
[
{
eventTypes
:
[
HiAppEvent
.
EventType
.
FAULT
,
HiAppEvent
.
EventType
.
STATISTIC
,
HiAppEvent
.
EventType
.
SECURITY
,
HiAppEvent
.
EventType
.
BEHAVIOR
]
eventTypes
:
[
HiAppEvent
.
EventType
.
FAULT
,
HiAppEvent
.
EventType
.
STATISTIC
,
HiAppEvent
.
EventType
.
SECURITY
,
HiAppEvent
.
EventType
.
BEHAVIOR
]
}
],
triggerCondition
:
{
...
...
@@ -1256,13 +1258,13 @@ describe('Hiappeventsubtest', function () {
*/
it
(
'
HiAppEventSub16
'
,
3
,
async
function
(
done
)
{
console
.
info
(
'
testHiAppEventSub16 start
'
)
function
sleep
(
numberMillis
){
function
sleep
(
numberMillis
)
{
var
now
=
new
Date
();
var
exitTime
=
now
.
getTime
()
+
numberMillis
;
while
(
true
){
var
exitTime
=
now
.
getTime
()
+
numberMillis
;
while
(
true
)
{
now
=
new
Date
();
if
(
now
.
getTime
()
>
exitTime
)
return
;
if
(
now
.
getTime
()
>
exitTime
)
return
;
}
}
let
result
=
HiAppEvent
.
addWatcher
({
...
...
@@ -1339,13 +1341,13 @@ describe('Hiappeventsubtest', function () {
*/
it
(
'
HiAppEventSub17
'
,
3
,
async
function
(
done
)
{
console
.
info
(
'
testHiAppEventSub17 start
'
)
function
sleep
(
numberMillis
){
function
sleep
(
numberMillis
)
{
var
now
=
new
Date
();
var
exitTime
=
now
.
getTime
()
+
numberMillis
;
while
(
true
){
var
exitTime
=
now
.
getTime
()
+
numberMillis
;
while
(
true
)
{
now
=
new
Date
();
if
(
now
.
getTime
()
>
exitTime
)
return
;
if
(
now
.
getTime
()
>
exitTime
)
return
;
}
}
let
result
=
HiAppEvent
.
addWatcher
({
...
...
@@ -1625,7 +1627,7 @@ describe('Hiappeventsubtest', function () {
console
.
info
(
'
HiAppEventSub21 end
'
)
},
1000
)
})
/**
* @tc.number DFX_DFT_HiAppEvent_Sub_2200
* @tc.name 验证调用hiAppEvent.addWatcher,timeout=1,事件订阅成功
...
...
@@ -1633,13 +1635,13 @@ describe('Hiappeventsubtest', function () {
*/
it
(
'
HiAppEventSub22
'
,
3
,
async
function
(
done
)
{
console
.
info
(
'
testHiAppEventSub22 start
'
)
function
sleep
(
numberMillis
){
function
sleep
(
numberMillis
)
{
var
now
=
new
Date
();
var
exitTime
=
now
.
getTime
()
+
numberMillis
;
while
(
true
){
var
exitTime
=
now
.
getTime
()
+
numberMillis
;
while
(
true
)
{
now
=
new
Date
();
if
(
now
.
getTime
()
>
exitTime
)
return
;
if
(
now
.
getTime
()
>
exitTime
)
return
;
}
}
let
result
=
HiAppEvent
.
addWatcher
({
...
...
@@ -1687,7 +1689,6 @@ describe('Hiappeventsubtest', function () {
},
1000
)
})
/**
* @tc.number DFX_DFT_HiAppEvent_Sub_2300
* @tc.name 验证调用hiAppEvent.addWatcher,timeout=0,事件订阅失败
...
...
@@ -1695,13 +1696,13 @@ describe('Hiappeventsubtest', function () {
*/
it
(
'
HiAppEventSub23
'
,
3
,
async
function
(
done
)
{
console
.
info
(
'
testHiAppEventSub23 start
'
)
function
sleep
(
numberMillis
){
function
sleep
(
numberMillis
)
{
var
now
=
new
Date
();
var
exitTime
=
now
.
getTime
()
+
numberMillis
;
while
(
true
){
var
exitTime
=
now
.
getTime
()
+
numberMillis
;
while
(
true
)
{
now
=
new
Date
();
if
(
now
.
getTime
()
>
exitTime
)
return
;
if
(
now
.
getTime
()
>
exitTime
)
return
;
}
}
let
result
=
HiAppEvent
.
addWatcher
({
...
...
@@ -1749,7 +1750,6 @@ describe('Hiappeventsubtest', function () {
},
1000
)
})
/**
* @tc.number DFX_DFT_HiAppEvent_Sub_2400
* @tc.name 验证调用hiAppEvent.addWatcher,未设置触发条件,事件订阅失败
...
...
@@ -1757,13 +1757,13 @@ describe('Hiappeventsubtest', function () {
*/
it
(
'
HiAppEventSub24
'
,
3
,
async
function
(
done
)
{
console
.
info
(
'
testHiAppEventSub24 start
'
)
function
sleep
(
numberMillis
){
function
sleep
(
numberMillis
)
{
var
now
=
new
Date
();
var
exitTime
=
now
.
getTime
()
+
numberMillis
;
while
(
true
){
var
exitTime
=
now
.
getTime
()
+
numberMillis
;
while
(
true
)
{
now
=
new
Date
();
if
(
now
.
getTime
()
>
exitTime
)
return
;
if
(
now
.
getTime
()
>
exitTime
)
return
;
}
}
let
result
=
HiAppEvent
.
addWatcher
({
...
...
@@ -1813,13 +1813,15 @@ describe('Hiappeventsubtest', function () {
* @tc.name 验证调用hiAppEvent.addWatcher,触发条件仅timeout有效,事件订阅成功
* @tc.desc HiAppEvent write interface test.
*/
function
sleep
(
numberMillis
){
it
(
'
HiAppEventSub28
'
,
3
,
async
function
(
done
)
{
console
.
info
(
'
testHiAppEventSub28 start
'
)
function
sleep
(
numberMillis
)
{
var
now
=
new
Date
();
var
exitTime
=
now
.
getTime
()
+
numberMillis
;
while
(
true
){
var
exitTime
=
now
.
getTime
()
+
numberMillis
;
while
(
true
)
{
now
=
new
Date
();
if
(
now
.
getTime
()
>
exitTime
)
return
;
if
(
now
.
getTime
()
>
exitTime
)
return
;
}
}
let
result
=
HiAppEvent
.
addWatcher
({
...
...
@@ -1921,7 +1923,6 @@ describe('Hiappeventsubtest', function () {
},
1000
)
})
/**
* @tc.number DFX_DFT_HiAppEvent_Sub_2500
* @tc.name 验证调用removeWatcher,watcher为已有watcher,订阅者、相关订阅事件删除成功
...
...
@@ -1960,7 +1961,6 @@ describe('Hiappeventsubtest', function () {
})
/**
* @tc.number DFX_DFT_HiAppEvent_Sub_2600
* @tc.name 验证调用removeWatcher,watcher无效,订阅者、相关订阅事件删除失败
...
...
@@ -1997,7 +1997,7 @@ describe('Hiappeventsubtest', function () {
console
.
info
(
'
HiAppEventSub26 end
'
)
},
2000
)
})
/**
* @tc.number DFX_DFT_HiAppEvent_Sub_2700
* @tc.name 验证清理接口功能
...
...
@@ -2010,4 +2010,4 @@ describe('Hiappeventsubtest', function () {
console
.
info
(
'
HiAppEventSub27 end
'
)
})
})
}
}
\ No newline at end of file
hiviewdfx/hiappeventtest/hiappeventsubjstest/src/main/js/test/List.test.js
浏览文件 @
8836be1b
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
Hi
appeventsubt
est
from
'
./HiAppEventSub.test.js
'
import
Hi
AppEventSubT
est
from
'
./HiAppEventSub.test.js
'
export
default
function
testsuite
()
{
Hi
appeventsubt
est
()
Hi
AppEventSubT
est
()
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录