Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
d4efb5c4
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看板
提交
d4efb5c4
编写于
10月 29, 2022
作者:
1
15929983503
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
hisysevent8.2modify
Signed-off-by:
N
15929983503
<
duanhaizhen@huawei.com
>
上级
828d5131
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
276 addition
and
200 deletion
+276
-200
hiviewdfx/hisyseventtest/hisyseventjstest/Test.json
hiviewdfx/hisyseventtest/hisyseventjstest/Test.json
+1
-10
hiviewdfx/hisyseventtest/hisyseventjstest/signature/openharmony_sx.p7b
...yseventtest/hisyseventjstest/signature/openharmony_sx.p7b
+0
-0
hiviewdfx/hisyseventtest/hisyseventjstest/src/main/js/test/HiSysEvent.test.js
...test/hisyseventjstest/src/main/js/test/HiSysEvent.test.js
+275
-190
未找到文件。
hiviewdfx/hisyseventtest/hisyseventjstest/Test.json
浏览文件 @
d4efb5c4
...
...
@@ -14,15 +14,6 @@
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"setenforce 0"
],
"teardown-command"
:
[
"setenforce 1"
]
}
]
}
hiviewdfx/hisyseventtest/hisyseventjstest/signature/openharmony_sx.p7b
浏览文件 @
d4efb5c4
无法预览此类型文件
hiviewdfx/hisyseventtest/hisyseventjstest/src/main/js/test/HiSysEvent.test.js
浏览文件 @
d4efb5c4
...
...
@@ -332,6 +332,7 @@ describe('hiSysEventJsTest', function () {
rules
:
[{
domain
:
"
RELIABILITY
"
,
name
:
"
STACK
"
,
tag
:
"
STABILITY
"
,
ruleType
:
hiSysEvent
.
RuleType
.
PREFIX
}],
onEvent
:
(
info
)
=>
{
...
...
@@ -349,10 +350,18 @@ describe('hiSysEventJsTest', function () {
console
.
info
(
`testHiSysEventApi12 Onservice died`
);
}
}
let
result
=
hiSysEvent
.
addWatcher
(
watcher
)
expect
(
result
).
assertEqual
(
0
)
try
{
hiSysEvent
.
addWatcher
(
watcher
)
expect
(
true
).
assertTrue
()
console
.
info
(
'
testHiSysEventApi12 end
'
)
done
();
}
catch
(
err
)
{
console
.
error
(
`testHiSysEventApi12 > error code:
${
err
.
code
}
, error msg:
${
err
.
message
}
`
)
expect
(
err
.
code
==
201
).
assertTrue
()
console
.
info
(
'
testHiSysEventApi12 end
'
)
done
()
}
hiSysEvent
.
removeWatcher
(
watcher
)
})
/**
...
...
@@ -383,10 +392,18 @@ describe('hiSysEventJsTest', function () {
console
.
info
(
`testHiSysEventApi13 Onservice died`
);
}
}
let
result
=
hiSysEvent
.
addWatcher
(
watcher
)
expect
(
result
).
assertEqual
(
0
)
try
{
hiSysEvent
.
addWatcher
(
watcher
)
expect
(
true
).
assertTrue
()
console
.
info
(
'
testHiSysEventApi13 end
'
)
done
();
}
catch
(
err
)
{
console
.
error
(
`testHiSysEventApi13 > error code:
${
err
.
code
}
, error msg:
${
err
.
message
}
`
)
expect
(
err
.
code
==
201
).
assertTrue
()
console
.
info
(
'
testHiSysEventApi13 end
'
)
done
()
}
hiSysEvent
.
removeWatcher
(
watcher
)
})
/**
...
...
@@ -417,10 +434,18 @@ describe('hiSysEventJsTest', function () {
console
.
info
(
`testHiSysEventApi14 Onservice died`
);
}
}
let
result
=
hiSysEvent
.
addWatcher
(
watcher
)
expect
(
result
).
assertEqual
(
0
)
try
{
hiSysEvent
.
addWatcher
(
watcher
)
expect
(
true
).
assertTrue
()
console
.
info
(
'
testHiSysEventApi14 end
'
)
done
();
}
catch
(
err
)
{
console
.
error
(
`testHiSysEventApi14 > error code:
${
err
.
code
}
, error msg:
${
err
.
message
}
`
)
expect
(
err
.
code
==
201
)
console
.
info
(
'
testHiSysEventApi14 end
'
)
done
()
}
hiSysEvent
.
removeWatcher
(
watcher
)
})
/**
...
...
@@ -452,10 +477,18 @@ describe('hiSysEventJsTest', function () {
console
.
info
(
`testHiSysEventApi15 Onservice died`
);
}
}
let
result
=
hiSysEvent
.
addWatcher
(
watcher
)
expect
(
result
).
assertEqual
(
0
)
try
{
hiSysEvent
.
addWatcher
(
watcher
)
expect
(
true
).
assertTrue
()
console
.
info
(
'
testHiSysEventApi15 end
'
)
done
();
}
catch
(
err
)
{
console
.
error
(
`testHiSysEventApi15 > error code:
${
err
.
code
}
, error msg:
${
err
.
message
}
`
)
expect
(
err
.
code
==
201
).
assertTrue
()
console
.
info
(
'
testHiSysEventApi15 end
'
)
done
()
}
hiSysEvent
.
removeWatcher
(
watcher
)
})
/**
...
...
@@ -487,10 +520,18 @@ describe('hiSysEventJsTest', function () {
console
.
info
(
`testHiSysEventApi16 Onservice died`
);
}
}
let
result
=
hiSysEvent
.
addWatcher
(
watcher
)
expect
(
result
).
assertEqual
(
0
)
try
{
hiSysEvent
.
addWatcher
(
watcher
)
expect
(
true
).
assertTrue
()
console
.
info
(
'
testHiSysEventApi16 end
'
)
done
();
}
catch
(
err
)
{
console
.
error
(
`testHiSysEventApi16 > error code:
${
err
.
code
}
, error msg:
${
err
.
message
}
`
)
expect
(
err
.
code
==
201
).
assertTrue
()
console
.
info
(
'
testHiSysEventApi16 end
'
)
done
()
}
hiSysEvent
.
removeWatcher
(
watcher
)
})
/**
...
...
@@ -522,10 +563,18 @@ describe('hiSysEventJsTest', function () {
console
.
info
(
`testHiSysEventApi17 Onservice died`
);
}
}
let
result
=
hiSysEvent
.
addWatcher
(
watcher
)
expect
(
result
).
assertEqual
(
0
)
try
{
hiSysEvent
.
addWatcher
(
watcher
)
expect
(
true
).
assertTrue
()
console
.
info
(
'
testHiSysEventApi17 end
'
)
done
();
}
catch
(
err
)
{
console
.
error
(
`testHiSysEventApi17 > error code:
${
err
.
code
}
, error msg:
${
err
.
message
}
`
)
expect
(
err
.
code
==
201
).
assertTrue
()
console
.
info
(
'
testHiSysEventApi17 end
'
)
done
()
}
hiSysEvent
.
removeWatcher
(
watcher
)
})
/**
...
...
@@ -556,15 +605,20 @@ describe('hiSysEventJsTest', function () {
console
.
info
(
`testHiSysEventApi18 Onservice died`
);
}
}
let
result
=
hiSysEvent
.
addWatcher
(
watcher
)
expect
(
result
).
assertEqual
(
0
)
hiSysEvent
.
addWatcher
(
watcher
)
setTimeout
(()
=>
{
result
=
hiSysEvent
.
removeWatcher
(
watcher
)
expect
(
result
).
assertEqual
(
0
)
don
e
()
try
{
hiSysEvent
.
removeWatcher
(
watcher
)
expect
(
true
).
assertTru
e
()
console
.
info
(
'
testHiSysEventApi18 end
'
)
},
1000
)
done
();
}
catch
(
err
)
{
console
.
error
(
`testHiSysEventApi18 > error code:
${
err
.
code
}
, error msg:
${
err
.
message
}
`
)
expect
(
err
.
code
==
201
).
assertTrue
()
console
.
info
(
'
testHiSysEventApi18 end
'
)
done
()
}
},
1000
)
})
/**
...
...
@@ -595,15 +649,20 @@ describe('hiSysEventJsTest', function () {
console
.
info
(
`testHiSysEventApi19 Onservice died`
);
}
}
let
result
=
hiSysEvent
.
addWatcher
(
watcher
)
expect
(
result
).
assertEqual
(
0
)
hiSysEvent
.
addWatcher
(
watcher
)
setTimeout
(()
=>
{
result
=
hiSysEvent
.
removeWatcher
(
watcher
)
expect
(
result
).
assertEqual
(
0
)
don
e
()
try
{
hiSysEvent
.
removeWatcher
(
watcher
)
expect
(
true
).
assertTru
e
()
console
.
info
(
'
testHiSysEventApi19 end
'
)
},
1000
)
done
();
}
catch
(
err
)
{
console
.
error
(
`testHiSysEventApi19 > error code:
${
err
.
code
}
, error msg:
${
err
.
message
}
`
)
expect
(
err
.
code
==
201
).
assertTrue
()
console
.
info
(
'
testHiSysEventApi19 end
'
)
done
()
}
},
1000
)
})
/**
...
...
@@ -634,15 +693,20 @@ describe('hiSysEventJsTest', function () {
console
.
info
(
`testHiSysEventApi20 Onservice died`
);
}
}
let
result
=
hiSysEvent
.
addWatcher
(
watcher
)
expect
(
result
).
assertEqual
(
0
)
hiSysEvent
.
addWatcher
(
watcher
)
setTimeout
(()
=>
{
result
=
hiSysEvent
.
removeWatcher
(
watcher
)
expect
(
result
).
assertEqual
(
0
)
don
e
()
try
{
hiSysEvent
.
removeWatcher
(
watcher
)
expect
(
true
).
assertTru
e
()
console
.
info
(
'
testHiSysEventApi20 end
'
)
},
1000
)
done
();
}
catch
(
err
)
{
console
.
error
(
`testHiSysEventApi20 > error code:
${
err
.
code
}
, error msg:
${
err
.
message
}
`
)
expect
(
err
.
code
==
201
).
assertTrue
()
console
.
info
(
'
testHiSysEventApi20 end
'
)
done
()
}
},
1000
)
})
/**
...
...
@@ -674,15 +738,20 @@ describe('hiSysEventJsTest', function () {
console
.
info
(
`testHiSysEventApi21 Onservice died`
);
}
}
let
result
=
hiSysEvent
.
addWatcher
(
watcher
)
expect
(
result
).
assertEqual
(
0
)
hiSysEvent
.
addWatcher
(
watcher
)
setTimeout
(()
=>
{
result
=
hiSysEvent
.
removeWatcher
(
watcher
)
expect
(
result
).
assertEqual
(
0
)
don
e
()
try
{
hiSysEvent
.
removeWatcher
(
watcher
)
expect
(
true
).
assertTru
e
()
console
.
info
(
'
testHiSysEventApi21 end
'
)
},
1000
)
done
();
}
catch
(
err
)
{
console
.
error
(
`testHiSysEventApi21 > error code:
${
err
.
code
}
, error msg:
${
err
.
message
}
`
)
expect
(
err
.
code
==
201
).
assertTrue
()
console
.
info
(
'
testHiSysEventApi21 end
'
)
done
()
}
},
1000
)
})
/**
...
...
@@ -714,15 +783,20 @@ describe('hiSysEventJsTest', function () {
console
.
info
(
`testHiSysEventApi22 Onservice died`
);
}
}
let
result
=
hiSysEvent
.
addWatcher
(
watcher
)
expect
(
result
).
assertEqual
(
0
)
hiSysEvent
.
addWatcher
(
watcher
)
setTimeout
(()
=>
{
result
=
hiSysEvent
.
removeWatcher
(
watcher
)
expect
(
result
).
assertEqual
(
0
)
don
e
()
try
{
hiSysEvent
.
removeWatcher
(
watcher
)
expect
(
true
).
assertTru
e
()
console
.
info
(
'
testHiSysEventApi22 end
'
)
},
1000
)
done
();
}
catch
(
err
)
{
console
.
error
(
`testHiSysEventApi22 > error code:
${
err
.
code
}
, error msg:
${
err
.
message
}
`
)
expect
(
err
.
code
==
201
).
assertTrue
()
console
.
info
(
'
testHiSysEventApi22 end
'
)
done
()
}
},
1000
)
})
/**
...
...
@@ -754,15 +828,20 @@ describe('hiSysEventJsTest', function () {
console
.
info
(
`testHiSysEventApi23 Onservice died`
);
}
}
let
result
=
hiSysEvent
.
addWatcher
(
watcher
)
expect
(
result
).
assertEqual
(
0
)
hiSysEvent
.
addWatcher
(
watcher
)
setTimeout
(()
=>
{
result
=
hiSysEvent
.
removeWatcher
(
watcher
)
expect
(
result
).
assertEqual
(
0
)
don
e
()
try
{
hiSysEvent
.
removeWatcher
(
watcher
)
expect
(
true
).
assertTru
e
()
console
.
info
(
'
testHiSysEventApi23 end
'
)
},
1000
)
done
();
}
catch
(
err
)
{
console
.
error
(
`testHiSysEventApi23 > error code:
${
err
.
code
}
, error msg:
${
err
.
message
}
`
)
expect
(
err
.
code
==
201
).
assertTrue
()
console
.
info
(
'
testHiSysEventApi23 end
'
)
done
()
}
},
1000
)
})
/**
...
...
@@ -772,6 +851,7 @@ describe('hiSysEventJsTest', function () {
*/
it
(
'
testHiSysEventApi24
'
,
1
,
async
function
(
done
)
{
console
.
info
(
'
testHiSysEventApi24 start
'
)
try
{
hiSysEvent
.
write
({
domain
:
"
ACCOUNT
"
,
name
:
"
PERMISSION_EXCEPTION
"
,
...
...
@@ -794,7 +874,7 @@ describe('hiSysEventJsTest', function () {
}
});
setTimeout
(()
=>
{
let
ret
=
hiSysEvent
.
query
({
hiSysEvent
.
query
({
beginTime
:
-
1
,
endTime
:
-
1
,
maxEvents
:
1
,
...
...
@@ -833,8 +913,10 @@ describe('hiSysEventJsTest', function () {
console
.
info
(
`testHiSysEventApi24 end`
)
}
})
expect
(
ret
).
assertEqual
(
0
)
},
1000
);
}
catch
(
error
)
{
console
.
error
(
`error code:
${
error
.
code
}
, error msg:
${
error
.
message
}
`
);
}
})
/**
...
...
@@ -844,6 +926,7 @@ describe('hiSysEventJsTest', function () {
*/
it
(
'
testHiSysEventApi25
'
,
1
,
async
function
(
done
)
{
console
.
info
(
'
testHiSysEventApi25 start
'
)
try
{
hiSysEvent
.
write
({
domain
:
"
HIVIEWDFX
"
,
name
:
"
SYS_USAGE
"
,
...
...
@@ -876,7 +959,7 @@ describe('hiSysEventJsTest', function () {
})
},
1000
)
setTimeout
(()
=>
{
let
ret
=
hiSysEvent
.
query
({
hiSysEvent
.
query
({
beginTime
:
-
1
,
endTime
:
-
1
,
maxEvents
:
5
,
...
...
@@ -915,8 +998,10 @@ describe('hiSysEventJsTest', function () {
console
.
info
(
`testHiSysEventApi25 end`
)
}
})
expect
(
ret
).
assertEqual
(
0
)
},
1000
);
},
2000
);
}
catch
(
error
)
{
console
.
error
(
`error code:
${
error
.
code
}
, error msg:
${
error
.
message
}
`
);
}
})
})
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录