Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
2cbf53ab
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看板
未验证
提交
2cbf53ab
编写于
7月 23, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 23, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4513 hichecker,hidebug,faultlogger测试用例编号修改
Merge pull request !4513 from chenxuihui/master
上级
ae587725
fbe46ef1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
130 addition
and
139 deletion
+130
-139
hiviewdfx/hicheckertest/hicheckerjstest/src/main/js/test/HiChecker.test.js
...ertest/hicheckerjstest/src/main/js/test/HiChecker.test.js
+18
-18
hiviewdfx/hidebugtest/hidebugtestjstest/src/main/js/test/Hidebug.test.js
...ugtest/hidebugtestjstest/src/main/js/test/Hidebug.test.js
+68
-77
hiviewdfx/hiview/faultlogger/faultloggerjs/src/main/js/test/faultlogger.test.js
...logger/faultloggerjs/src/main/js/test/faultlogger.test.js
+44
-44
未找到文件。
hiviewdfx/hicheckertest/hicheckerjstest/src/main/js/test/HiChecker.test.js
浏览文件 @
2cbf53ab
...
...
@@ -48,11 +48,11 @@ describe('HiCheckerTest', function () {
/**
* @tc.number
* @tc.name
HiCheckerTest001
* @tc.name
DFX_DFR_Hichecker_Interface_0100
* @tc.desc
*/
it
(
'
HiCheckerTest001
'
,
0
,
function
()
{
console
.
info
(
'
HiCheckerTest001
start
'
);
it
(
'
DFX_DFR_Hichecker_Interface_0100
'
,
0
,
function
()
{
console
.
info
(
'
DFX_DFR_Hichecker_Interface_0100
start
'
);
hichecker
.
addRule
(
hichecker
.
RULE_THREAD_CHECK_SLOW_PROCESS
);
let
tmp
=
hichecker
.
contains
(
hichecker
.
RULE_THREAD_CHECK_SLOW_PROCESS
);
console
.
log
(
'
add rule success!
'
);
...
...
@@ -61,11 +61,11 @@ describe('HiCheckerTest', function () {
/**
* @tc.number
* @tc.name
HiCheckerTest002
* @tc.name
DFX_DFR_Hichecker_Interface_0500
* @tc.desc
*/
it
(
'
HiCheckerTest002
'
,
0
,
function
()
{
console
.
info
(
'
HiCheckerTest002
start
'
);
it
(
'
DFX_DFR_Hichecker_Interface_0500
'
,
0
,
function
()
{
console
.
info
(
'
DFX_DFR_Hichecker_Interface_0500
start
'
);
hichecker
.
addRule
(
hichecker
.
RULE_THREAD_CHECK_SLOW_PROCESS
|
hichecker
.
RULE_CHECK_SLOW_EVENT
);
hichecker
.
addRule
(
hichecker
.
RULE_CHECK_ABILITY_CONNECTION_LEAK
|
hichecker
.
RULE_CAUTION_PRINT_LOG
);
console
.
log
(
'
add rule success!
'
);
...
...
@@ -79,11 +79,11 @@ describe('HiCheckerTest', function () {
/**
* @tc.number
* @tc.name
HiCheckerTest003
* @tc.name
DFX_DFR_Hichecker_Interface_0200
* @tc.desc
*/
it
(
'
HiCheckerTest003
'
,
0
,
function
()
{
console
.
info
(
'
HiCheckerTest003
start
'
);
it
(
'
DFX_DFR_Hichecker_Interface_0200
'
,
0
,
function
()
{
console
.
info
(
'
DFX_DFR_Hichecker_Interface_0200
start
'
);
hichecker
.
addRule
(
-
1
);
console
.
log
(
'
add wrong rule!
'
);
expect
(
hichecker
.
contains
(
-
1
)).
assertEqual
(
false
);
...
...
@@ -97,11 +97,11 @@ describe('HiCheckerTest', function () {
/**
* @tc.number
* @tc.name
HiCheckerTest004
* @tc.name
DFX_DFR_Hichecker_Interface_1200
* @tc.desc
*/
it
(
'
HiCheckerTest004
'
,
0
,
function
()
{
console
.
info
(
'
HiCheckerTest004
start
'
);
it
(
'
DFX_DFR_Hichecker_Interface_1200
'
,
0
,
function
()
{
console
.
info
(
'
DFX_DFR_Hichecker_Interface_1200
start
'
);
hichecker
.
addRule
(
hichecker
.
RULE_THREAD_CHECK_SLOW_PROCESS
);
expect
(
hichecker
.
contains
(
hichecker
.
RULE_THREAD_CHECK_SLOW_PROCESS
)).
assertTrue
();
console
.
log
(
'
add rule success!
'
);
...
...
@@ -111,11 +111,11 @@ describe('HiCheckerTest', function () {
/**
* @tc.number
* @tc.name
HiCheckerTest005
* @tc.name
DFX_DFR_Hichecker_Interface_0800
* @tc.desc
*/
it
(
'
HiCheckerTest005
'
,
0
,
function
()
{
console
.
info
(
'
HiCheckerTest005
start
'
);
it
(
'
DFX_DFR_Hichecker_Interface_0800
'
,
0
,
function
()
{
console
.
info
(
'
DFX_DFR_Hichecker_Interface_0800
start
'
);
hichecker
.
addRule
(
hichecker
.
RULE_THREAD_CHECK_SLOW_PROCESS
|
hichecker
.
RULE_CHECK_SLOW_EVENT
);
hichecker
.
addRule
(
hichecker
.
RULE_CHECK_ABILITY_CONNECTION_LEAK
|
hichecker
.
RULE_CAUTION_PRINT_LOG
);
console
.
log
(
'
add rule success!
'
);
...
...
@@ -128,11 +128,11 @@ describe('HiCheckerTest', function () {
/**
* @tc.number
* @tc.name
HiCheckerTest006
* @tc.name
DFX_DFR_Hichecker_Interface_1300
* @tc.desc
*/
it
(
'
HiCheckerTest006
'
,
0
,
function
()
{
console
.
info
(
'
HiCheckerTest006
start
'
);
it
(
'
DFX_DFR_Hichecker_Interface_1300
'
,
0
,
function
()
{
console
.
info
(
'
DFX_DFR_Hichecker_Interface_1300
start
'
);
hichecker
.
addRule
(
hichecker
.
RULE_THREAD_CHECK_SLOW_PROCESS
|
hichecker
.
RULE_CHECK_SLOW_EVENT
);
hichecker
.
addRule
(
hichecker
.
RULE_CHECK_ABILITY_CONNECTION_LEAK
|
hichecker
.
RULE_CAUTION_PRINT_LOG
);
console
.
log
(
'
add rule success!
'
);
...
...
hiviewdfx/hidebugtest/hidebugtestjstest/src/main/js/test/Hidebug.test.js
浏览文件 @
2cbf53ab
...
...
@@ -20,60 +20,60 @@ export default function HidebugJsTest() {
describe
(
'
HidebugJsTest
'
,
function
()
{
/*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0
001
* @tc.number : DFX_DFR_Hiprofiler_Interface_0
600
* @tc.name : getNativeHeapSize
* @tc.desc : Get total native heap memory size
*/
it
(
'
DFX_DFR_Hiprofiler_Interface_0
001
'
,
0
,
function
()
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
001
Test start*************
'
);
it
(
'
DFX_DFR_Hiprofiler_Interface_0
600
'
,
0
,
function
()
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
600
Test start*************
'
);
try
{
let
heapSize
=
hidebug
.
getNativeHeapSize
();
expect
(
heapSize
>=
BigInt
(
0
)).
assertTrue
();
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
001
Test end*************
'
);
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
600
Test end*************
'
);
});
/*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0
002
* @tc.number : DFX_DFR_Hiprofiler_Interface_0
400
* @tc.name : getNativeHeapAllocatedSize
* @tc.desc : Get Native heap memory allocation size.
*/
it
(
'
DFX_DFR_Hiprofiler_Interface_0
002
'
,
0
,
function
()
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
002
Test start*************
'
);
it
(
'
DFX_DFR_Hiprofiler_Interface_0
400
'
,
0
,
function
()
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
400
Test start*************
'
);
try
{
let
heapAllocatedSize
=
hidebug
.
getNativeHeapAllocatedSize
();
expect
(
heapAllocatedSize
>=
BigInt
(
0
)).
assertTrue
();
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
002
Test end*************
'
);
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
400
Test end*************
'
);
});
/*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0
003
* @tc.number : DFX_DFR_Hiprofiler_Interface_0
500
* @tc.name : getNativeHeapFreeSize
* @tc.desc : Get Native heap memory free size
*/
it
(
'
DFX_DFR_Hiprofiler_Interface_0
003
'
,
0
,
function
()
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
003
Test start*************
'
);
it
(
'
DFX_DFR_Hiprofiler_Interface_0
500
'
,
0
,
function
()
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
500
Test start*************
'
);
try
{
let
heapFreeSize
=
hidebug
.
getNativeHeapFreeSize
();
expect
(
heapFreeSize
>=
BigInt
(
0
)).
assertTrue
();
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
003
Test end*************
'
);
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
500
Test end*************
'
);
});
/*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0
004
* @tc.number : DFX_DFR_Hiprofiler_Interface_0
800
* @tc.name : getPss
* @tc.desc : Get application process proportional set size memory information
*/
it
(
'
DFX_DFR_Hiprofiler_Interface_0
004
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
004
Test start*************
'
);
it
(
'
DFX_DFR_Hiprofiler_Interface_0
800
'
,
0
,
function
(
)
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
800
Test start*************
'
);
try
{
const
times
=
3
;
let
pssValue
=
BigInt
(
0
);
...
...
@@ -87,17 +87,16 @@ describe('HidebugJsTest', function () {
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0004 Test end*************
'
);
done
();
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0800 Test end*************
'
);
});
/*
* @tc.number : DFX_DFR_Hiprofiler_Interface_
0005
* @tc.number : DFX_DFR_Hiprofiler_Interface_
1200
* @tc.name : getSharedDirty
* @tc.desc : Obtains the size of the shared dirty memory of a process.
*/
it
(
'
DFX_DFR_Hiprofiler_Interface_
0005
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
0005
Test start*************
'
);
it
(
'
DFX_DFR_Hiprofiler_Interface_
1200
'
,
0
,
function
(
)
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
1200
Test start*************
'
);
try
{
let
dirty
=
hidebug
.
getSharedDirty
();
let
temp
=
hidebug
.
getSharedDirty
();
...
...
@@ -105,17 +104,16 @@ describe('HidebugJsTest', function () {
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0005 Test end*************
'
);
done
();
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_1200 Test end*************
'
);
});
/*
* @tc.number : DFX_DFR_Hiprofiler_Interface_
0006
* @tc.number : DFX_DFR_Hiprofiler_Interface_
1600
* @tc.name : startProfiling with normal parameter
* @tc.desc : Start CPU Profiling.
*/
it
(
'
DFX_DFR_Hiprofiler_Interface_
0006
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
0006
Test start*************
'
);
it
(
'
DFX_DFR_Hiprofiler_Interface_
1600
'
,
0
,
function
(
)
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
1600
Test start*************
'
);
try
{
let
timestamp
=
Date
.
now
();
let
filename
=
'
cpuprofiler-
'
+
timestamp
.
toString
();
...
...
@@ -129,17 +127,16 @@ describe('HidebugJsTest', function () {
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0006 Test end*************
'
);
done
();
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_1600 Test end*************
'
);
});
/*
* @tc.number : DFX_DFR_Hiprofiler_Interface_
0007
* @tc.number : DFX_DFR_Hiprofiler_Interface_
1500
* @tc.name : startProfiling repeatedly
* @tc.desc : Start CPU Profiling.
*/
it
(
'
DFX_DFR_Hiprofiler_Interface_
0007
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
0007
Test start*************
'
);
it
(
'
DFX_DFR_Hiprofiler_Interface_
1500
'
,
0
,
function
(
)
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
1500
Test start*************
'
);
try
{
let
path1
=
'
/data/app/el2/100/base/com.hidebug.test/files/cpuprofiler-111.json
'
let
path2
=
'
/data/app/el2/100/base/com.hidebug.test/files/cpuprofiler-222.json
'
...
...
@@ -157,17 +154,16 @@ describe('HidebugJsTest', function () {
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0007 Test end*************
'
);
done
();
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_1500 Test end*************
'
);
});
/*
* @tc.number : DFX_DFR_Hiprofiler_Interface_
0008
* @tc.number : DFX_DFR_Hiprofiler_Interface_
1400
* @tc.name : startProfiling with empty parameter
* @tc.desc : Start CPU Profiling.
*/
it
(
'
DFX_DFR_Hiprofiler_Interface_
0008
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
0008
Test start*************
'
);
it
(
'
DFX_DFR_Hiprofiler_Interface_
1400
'
,
0
,
function
(
)
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
1400
Test start*************
'
);
let
path
=
'
/data/app/el2/100/base/com.hidebug.test/files/undefined.json
'
try
{
fileio
.
accessSync
(
path
,
0
);
...
...
@@ -185,17 +181,16 @@ describe('HidebugJsTest', function () {
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0008 Test end*************
'
);
done
();
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_1400 Test end*************
'
);
});
/*
* @tc.number : DFX_DFR_Hiprofiler_Interface_
0009
* @tc.number : DFX_DFR_Hiprofiler_Interface_
1300
* @tc.name : startProfiling with overlong parameter
* @tc.desc : Start CPU Profiling.
*/
it
(
'
DFX_DFR_Hiprofiler_Interface_0009
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
0009
Test start*************
'
);
it
(
'
cDFX_DFR_Hiprofiler_Interface_1300
'
,
0
,
function
(
)
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
1300
Test start*************
'
);
let
path
=
'
/data/app/el2/100/base/com.hidebug.test/files/undefined.json
'
try
{
fileio
.
accessSync
(
path
,
0
);
...
...
@@ -217,17 +212,16 @@ describe('HidebugJsTest', function () {
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0009 Test end*************
'
);
done
();
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_1300 Test end*************
'
);
});
/*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0
01
0
* @tc.number : DFX_DFR_Hiprofiler_Interface_0
30
0
* @tc.name : dumpHeapData with normal parameter
* @tc.desc : Dump JS Virtual Machine Heap Snapshot.
*/
it
(
'
DFX_DFR_Hiprofiler_Interface_0
010
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
01
0 Test start*************
'
);
it
(
'
DFX_DFR_Hiprofiler_Interface_0
300
'
,
0
,
function
(
)
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
30
0 Test start*************
'
);
try
{
let
timestamp
=
Date
.
now
();
let
filename
=
'
heap-
'
+
timestamp
.
toString
();
...
...
@@ -239,17 +233,16 @@ describe('HidebugJsTest', function () {
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0010 Test end*************
'
);
done
();
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0300 Test end*************
'
);
});
/*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0
011
* @tc.number : DFX_DFR_Hiprofiler_Interface_0
200
* @tc.name : dumpHeapData with empty parameter
* @tc.desc : Dump JS Virtual Machine Heap Snapshot.
*/
it
(
'
DFX_DFR_Hiprofiler_Interface_0
011
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
011
Test start*************
'
);
it
(
'
DFX_DFR_Hiprofiler_Interface_0
200
'
,
0
,
function
(
)
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
200
Test start*************
'
);
let
path
=
'
/data/app/el2/100/base/com.hidebug.test/files/undefined.heapsnapshot
'
try
{
fileio
.
accessSync
(
path
,
0
);
...
...
@@ -265,17 +258,16 @@ describe('HidebugJsTest', function () {
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0011 Test end*************
'
);
done
();
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0200 Test end*************
'
);
});
/*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0
012
* @tc.number : DFX_DFR_Hiprofiler_Interface_0
100
* @tc.name : dumpHeapData with overlog parameter
* @tc.desc : Dump JS Virtual Machine Heap Snapshot.
*/
it
(
'
DFX_DFR_Hiprofiler_Interface_0
012
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
012
Test start*************
'
);
it
(
'
DFX_DFR_Hiprofiler_Interface_0
100
'
,
0
,
function
(
)
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
100
Test start*************
'
);
let
path
=
'
/data/app/el2/100/base/com.hidebug.test/files/undefined.heapsnapshot
'
try
{
fileio
.
accessSync
(
path
,
0
);
...
...
@@ -295,33 +287,32 @@ describe('HidebugJsTest', function () {
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0012 Test end*************
'
);
done
();
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0100 Test end*************
'
);
});
/*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0
013
* @tc.number : DFX_DFR_Hiprofiler_Interface_0
700
* @tc.name : getPrivateDirty
* @tc.desc : Get the size of the private dirty memory
*/
it
(
'
DFX_DFR_Hiprofiler_Interface_0
013
'
,
0
,
function
()
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
013
Test start*************
'
);
it
(
'
DFX_DFR_Hiprofiler_Interface_0
700
'
,
0
,
function
()
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
700
Test start*************
'
);
try
{
let
temp
=
hidebug
.
getPrivateDirty
();
expect
(
temp
>=
BigInt
(
0
)).
assertTrue
();
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
013
Test end*************
'
);
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
700
Test end*************
'
);
});
/*
* @tc.number : DFX_DFR_Hiprofiler_Interface_
0014
* @tc.number : DFX_DFR_Hiprofiler_Interface_
1700
* @tc.name : getCpuUsage
* @tc.desc : Get the cpu usage of a process
*/
it
(
'
DFX_DFR_Hiprofiler_Interface_
0014
'
,
0
,
function
()
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
0014
Test start*************
'
);
it
(
'
DFX_DFR_Hiprofiler_Interface_
1700
'
,
0
,
function
()
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
1700
Test start*************
'
);
try
{
let
temp
=
-
1
;
for
(
let
i
=
0
;
i
<=
101
;
i
++
){
...
...
@@ -336,16 +327,16 @@ describe('HidebugJsTest', function () {
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
0014
Test end*************
'
);
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
1700
Test end*************
'
);
});
/*
* @tc.number : DFX_DFR_Hiprofiler_Interface_
0015
* @tc.number : DFX_DFR_Hiprofiler_Interface_
1100
* @tc.name : getServiceDump with normal parameter
* @tc.desc : getServiceDump
*/
it
(
'
DFX_DFR_Hiprofiler_Interface_
0015
'
,
0
,
function
()
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
0015
Test start*************
'
);
it
(
'
DFX_DFR_Hiprofiler_Interface_
1100
'
,
0
,
function
()
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
1100
Test start*************
'
);
try
{
let
temp
=
hidebug
.
getServiceDump
(
10
);
console
.
info
(
"
ServiceDump is
"
+
temp
);
...
...
@@ -353,16 +344,16 @@ describe('HidebugJsTest', function () {
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
0015
Test end*************
'
);
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
1100
Test end*************
'
);
});
/*
* @tc.number : DFX_DFR_Hiprofiler_Interface_0
016
* @tc.number : DFX_DFR_Hiprofiler_Interface_0
900
* @tc.name : getServiceDump with abnormal parameter
* @tc.desc : getServiceDump
*/
it
(
'
DFX_DFR_Hiprofiler_Interface_0
016
'
,
0
,
function
()
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
016
Test start*************
'
);
it
(
'
DFX_DFR_Hiprofiler_Interface_0
900
'
,
0
,
function
()
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
900
Test start*************
'
);
try
{
let
temp
=
hidebug
.
getServiceDump
(
-
1
);
console
.
info
(
"
ServiceDump is
"
+
temp
);
...
...
@@ -370,16 +361,16 @@ describe('HidebugJsTest', function () {
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
016
Test end*************
'
);
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
900
Test end*************
'
);
});
/*
* @tc.number : DFX_DFR_Hiprofiler_Interface_
0017
* @tc.number : DFX_DFR_Hiprofiler_Interface_
1000
* @tc.name : getServiceDump with overlog parameter
* @tc.desc : getServiceDump
*/
it
(
'
DFX_DFR_Hiprofiler_Interface_
0017
'
,
0
,
function
()
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
0017
Test start*************
'
);
it
(
'
DFX_DFR_Hiprofiler_Interface_
1000
'
,
0
,
function
()
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
1000
Test start*************
'
);
try
{
let
temp
=
hidebug
.
getServiceDump
(
9007199254740993
);
console
.
info
(
"
ServiceDump is
"
+
temp
);
...
...
@@ -387,7 +378,7 @@ describe('HidebugJsTest', function () {
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
0017
Test end*************
'
);
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
1000
Test end*************
'
);
});
})
...
...
hiviewdfx/hiview/faultlogger/faultloggerjs/src/main/js/test/faultlogger.test.js
浏览文件 @
2cbf53ab
...
...
@@ -44,24 +44,24 @@ describe("FaultlogJsTest", function () {
/**
* test
*
* @tc.name:
FaultlogJsException_001
* @tc.name:
DFX_DFR_Faultlogger_Interface_0200
* @tc.desc: 检验函数参数输入错误时程序是否会崩溃
* @tc.require: AR000GICT2
* @tc.author:
*/
it
(
'
FaultlogJsException_001
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
---------------------------
FaultlogJsException_001
----------------------------------
"
);
it
(
'
DFX_DFR_Faultlogger_Interface_0200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
---------------------------
DFX_DFR_Faultlogger_Interface_0200
----------------------------------
"
);
try
{
let
ret1
=
faultlogger
.
querySelfFaultLog
(
"
faultloggertestsummary01
"
);
console
.
info
(
"
FaultlogJsException_001
ret1 ==
"
+
ret1
);
console
.
info
(
"
DFX_DFR_Faultlogger_Interface_0200
ret1 ==
"
+
ret1
);
expect
(
ret1
).
assertEqual
(
undefined
);
let
ret2
=
faultlogger
.
querySelfFaultLog
(
faultlogger
.
FaultType
.
JS_CRASH
,
"
faultloggertestsummary01
"
);
console
.
info
(
"
FaultlogJsException_001
ret2 ==
"
+
ret2
);
console
.
info
(
"
DFX_DFR_Faultlogger_Interface_0200
ret2 ==
"
+
ret2
);
expect
(
ret2
).
assertEqual
(
undefined
);
let
ret3
=
faultlogger
.
querySelfFaultLog
();
console
.
info
(
"
FaultlogJsException_001
ret3 ==
"
+
ret3
);
console
.
info
(
"
DFX_DFR_Faultlogger_Interface_0200
ret3 ==
"
+
ret3
);
expect
(
ret3
).
assertEqual
(
undefined
);
done
();
return
;
...
...
@@ -76,34 +76,34 @@ describe("FaultlogJsTest", function () {
/**
* test
*
* @tc.name:
FaultlogJsTest_002
* @tc.name:
DFX_DFR_Faultlogger_Interface_0400
* @tc.desc: 检验promise同步方式获取faultlog CPP_CRASH日志
* @tc.require: AR000GICT2
* @tc.author:
*/
it
(
'
FaultlogJsTest_002
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
---------------------------
FaultlogJsTest_002
----------------------------------
"
);
it
(
'
DFX_DFR_Faultlogger_Interface_0400
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
---------------------------
DFX_DFR_Faultlogger_Interface_0400
----------------------------------
"
);
try
{
let
now
=
Date
.
now
();
console
.
info
(
"
FaultlogJsTest_002
2 +
"
+
now
);
console
.
info
(
"
DFX_DFR_Faultlogger_Interface_0400
2 +
"
+
now
);
let
module
=
"
ohos.faultloggerjs.test
"
;
const
loopTimes
=
10
;
for
(
let
i
=
0
;
i
<
loopTimes
;
i
++
)
{
console
.
info
(
"
--------
FaultlogJsTest_002
3 +
"
+
i
+
"
----------
"
);
console
.
info
(
"
--------
DFX_DFR_Faultlogger_Interface_0400
3 +
"
+
i
+
"
----------
"
);
faultlogger
.
addFaultLog
(
i
-
400
,
faultlogger
.
FaultType
.
CPP_CRASH
,
module
,
"
faultloggertestsummary02
"
+
i
);
await
msleep
(
300
);
}
await
msleep
(
1000
);
console
.
info
(
"
--------
FaultlogJsTest_002
4
"
+
"
----------
"
);
console
.
info
(
"
--------
DFX_DFR_Faultlogger_Interface_0400
4
"
+
"
----------
"
);
let
ret
=
await
faultlogger
.
querySelfFaultLog
(
faultlogger
.
FaultType
.
CPP_CRASH
);
console
.
info
(
"
FaultlogJsTest_002
ret ==
"
+
ret
.
length
);
console
.
info
(
"
DFX_DFR_Faultlogger_Interface_0400
ret ==
"
+
ret
.
length
);
expect
(
ret
.
length
).
assertEqual
(
loopTimes
);
for
(
let
i
=
0
;
i
<
loopTimes
;
i
++
)
{
console
.
info
(
"
faultloggertestsummary02
"
+
i
+
"
fullLog.length
"
+
ret
[
i
].
fullLog
.
length
);
if
(
ret
[
i
].
fullLog
.
indexOf
(
"
faultloggertestsummary02
"
+
(
loopTimes
-
1
-
i
))
!=
-
1
)
{
console
.
info
(
"
FaultlogJsTest_002
"
+
ret
[
i
].
fullLog
.
length
);
console
.
info
(
"
DFX_DFR_Faultlogger_Interface_0400
"
+
ret
[
i
].
fullLog
.
length
);
expect
(
typeof
(
ret
[
i
].
pid
)
==
"
number
"
).
assertTrue
();
expect
(
typeof
(
ret
[
i
].
uid
)
==
"
number
"
).
assertTrue
();
expect
(
typeof
(
ret
[
i
].
type
)
==
"
number
"
).
assertTrue
();
...
...
@@ -118,16 +118,16 @@ describe("FaultlogJsTest", function () {
}
}
console
.
info
(
"
--------
FaultlogJsTest_002
5
"
+
"
----------
"
);
console
.
info
(
"
--------
DFX_DFR_Faultlogger_Interface_0400
5
"
+
"
----------
"
);
ret
=
await
faultlogger
.
querySelfFaultLog
(
faultlogger
.
FaultType
.
NO_SPECIFIC
);
console
.
info
(
"
FaultlogJsTest_002
ret ==
"
+
ret
.
length
);
console
.
info
(
"
DFX_DFR_Faultlogger_Interface_0400
ret ==
"
+
ret
.
length
);
expect
(
ret
.
length
).
assertEqual
(
loopTimes
);
done
();
return
;
}
catch
(
err
)
{
console
.
info
(
"
catch (err) ==
"
+
err
);
}
console
.
info
(
"
FaultlogJsTest_002
error
"
);
console
.
info
(
"
DFX_DFR_Faultlogger_Interface_0400
error
"
);
expect
(
false
).
assertTrue
();
done
();
})
...
...
@@ -135,16 +135,16 @@ describe("FaultlogJsTest", function () {
/**
* test
*
* @tc.name:
FaultlogJsTest_003
* @tc.name:
DFX_DFR_Faultlogger_Interface_0500
* @tc.desc: 检验promise同步方式获取faultlog JS_CRASH日志
* @tc.require: AR000GICT2
* @tc.author:
*/
it
(
'
FaultlogJsTest_003
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
---------------------------
FaultlogJsTest_003
----------------------------------
"
);
it
(
'
DFX_DFR_Faultlogger_Interface_0500
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
---------------------------
DFX_DFR_Faultlogger_Interface_0500
----------------------------------
"
);
try
{
let
now
=
Date
.
now
();
console
.
info
(
"
FaultlogJsTest_003
2 +
"
+
now
);
console
.
info
(
"
DFX_DFR_Faultlogger_Interface_0500
2 +
"
+
now
);
const
loopTimes
=
2
;
let
i
=
0
;
let
pro
=
new
Promise
(
...
...
@@ -156,7 +156,7 @@ describe("FaultlogJsTest", function () {
r
(
"
done!
"
)
return
}
console
.
info
(
"
--------
FaultlogJsTest_003
3 +
"
+
i
+
"
----------
"
);
console
.
info
(
"
--------
DFX_DFR_Faultlogger_Interface_0500
3 +
"
+
i
+
"
----------
"
);
++
i
;
let
dataStr
=
[
"
1
"
,
"
2
"
]
console
.
info
(
dataStr
[
2
].
test
);
...
...
@@ -166,9 +166,9 @@ describe("FaultlogJsTest", function () {
await
pro
;
await
msleep
(
1000
);
console
.
info
(
"
--------
FaultlogJsTest_003
4
"
+
"
----------
"
);
console
.
info
(
"
--------
DFX_DFR_Faultlogger_Interface_0500
4
"
+
"
----------
"
);
let
ret
=
await
faultlogger
.
querySelfFaultLog
(
faultlogger
.
FaultType
.
JS_CRASH
);
console
.
info
(
"
FaultlogJsTest_003
ret ==
"
+
ret
.
length
);
console
.
info
(
"
DFX_DFR_Faultlogger_Interface_0500
ret ==
"
+
ret
.
length
);
if
(
ret
.
length
>
0
)
{
expect
(
true
).
assertTrue
();
}
else
{
...
...
@@ -182,7 +182,7 @@ describe("FaultlogJsTest", function () {
}
catch
(
err
)
{
console
.
info
(
"
catch (err) ==
"
+
err
);
}
console
.
info
(
"
FaultlogJsTest_003
error
"
);
console
.
info
(
"
DFX_DFR_Faultlogger_Interface_0500
error
"
);
expect
(
false
).
assertTrue
();
done
();
})
...
...
@@ -190,34 +190,34 @@ describe("FaultlogJsTest", function () {
/**
* test
*
* @tc.name:
FaultlogJsTest_004
* @tc.name:
DFX_DFR_Faultlogger_Interface_0300
* @tc.desc: 检验promise同步方式获取faultlog APP_FREEZE日志
* @tc.require: AR000GICT2
* @tc.author:
*/
it
(
'
FaultlogJsTest_004
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
---------------------------
FaultlogJsTest_004
----------------------------------
"
);
it
(
'
DFX_DFR_Faultlogger_Interface_0300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
---------------------------
DFX_DFR_Faultlogger_Interface_0300
----------------------------------
"
);
try
{
let
now
=
Date
.
now
();
console
.
info
(
"
FaultlogJsTest_004
2 +
"
+
now
);
console
.
info
(
"
DFX_DFR_Faultlogger_Interface_0300
2 +
"
+
now
);
let
module
=
"
ohos.faultloggerjs.test
"
;
const
loopTimes
=
10
;
for
(
let
i
=
0
;
i
<
loopTimes
;
i
++
)
{
console
.
info
(
"
--------
FaultlogJsTest_004
3 +
"
+
i
+
"
----------
"
);
console
.
info
(
"
--------
DFX_DFR_Faultlogger_Interface_0300
3 +
"
+
i
+
"
----------
"
);
faultlogger
.
addFaultLog
(
i
-
200
,
faultlogger
.
FaultType
.
APP_FREEZE
,
module
,
"
faultloggertestsummary04
"
+
i
);
await
msleep
(
300
);
}
await
msleep
(
1000
);
console
.
info
(
"
--------
FaultlogJsTest_004
4
"
+
"
----------
"
);
console
.
info
(
"
--------
DFX_DFR_Faultlogger_Interface_0300
4
"
+
"
----------
"
);
let
ret
=
await
faultlogger
.
querySelfFaultLog
(
faultlogger
.
FaultType
.
APP_FREEZE
);
console
.
info
(
"
FaultlogJsTest_004
ret ==
"
+
ret
.
length
);
console
.
info
(
"
DFX_DFR_Faultlogger_Interface_0300
ret ==
"
+
ret
.
length
);
expect
(
ret
.
length
).
assertEqual
(
loopTimes
);
for
(
let
i
=
0
;
i
<
loopTimes
;
i
++
)
{
console
.
info
(
"
faultloggertestsummary04
"
+
i
+
"
fullLog.length
"
+
ret
[
i
].
fullLog
.
length
);
if
(
ret
[
i
].
fullLog
.
indexOf
(
"
faultloggertestsummary04
"
+
(
loopTimes
-
1
-
i
))
!=
-
1
)
{
console
.
info
(
"
FaultlogJsTest_004
"
+
ret
[
i
].
fullLog
.
length
);
console
.
info
(
"
DFX_DFR_Faultlogger_Interface_0300
"
+
ret
[
i
].
fullLog
.
length
);
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
...
...
@@ -228,7 +228,7 @@ describe("FaultlogJsTest", function () {
}
catch
(
err
)
{
console
.
info
(
"
catch (err) ==
"
+
err
);
}
console
.
info
(
"
FaultlogJsTest_004
error
"
);
console
.
info
(
"
DFX_DFR_Faultlogger_Interface_0300
error
"
);
expect
(
false
).
assertTrue
();
done
();
})
...
...
@@ -236,37 +236,37 @@ describe("FaultlogJsTest", function () {
/**
* test
*
* @tc.name:
FaultlogJsTest_005
* @tc.name:
DFX_DFR_Faultlogger_Interface_0100
* @tc.desc: 检验通过回调方式获取faultlog日志
* @tc.require: AR000GICT2
* @tc.author:
*/
it
(
'
FaultlogJsTest_005
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
---------------------------
FaultlogJsTest_005
----------------------------------
"
);
it
(
'
DFX_DFR_Faultlogger_Interface_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
---------------------------
DFX_DFR_Faultlogger_Interface_0100
----------------------------------
"
);
try
{
let
now
=
Date
.
now
();
console
.
info
(
"
FaultlogJsTest_005
start +
"
+
now
);
console
.
info
(
"
DFX_DFR_Faultlogger_Interface_0100
start +
"
+
now
);
let
module
=
"
ohos.faultloggerjs.test
"
;
const
loopTimes
=
10
;
for
(
let
i
=
0
;
i
<
loopTimes
;
i
++
)
{
console
.
info
(
"
--------
FaultlogJsTest_005
+
"
+
i
+
"
----------
"
);
console
.
info
(
"
--------
DFX_DFR_Faultlogger_Interface_0100
+
"
+
i
+
"
----------
"
);
faultlogger
.
addFaultLog
(
i
-
100
,
faultlogger
.
FaultType
.
CPP_CRASH
,
module
,
"
faultloggertestsummary05
"
+
i
);
await
msleep
(
300
);
}
await
msleep
(
1000
);
console
.
info
(
"
--------
FaultlogJsTest_005
4----------
"
);
console
.
info
(
"
--------
DFX_DFR_Faultlogger_Interface_0100
4----------
"
);
function
queryFaultLogCallback
(
error
,
ret
)
{
if
(
error
)
{
console
.
info
(
'
FaultlogJsTest_005
once error is
'
+
error
);
console
.
info
(
'
DFX_DFR_Faultlogger_Interface_0100
once error is
'
+
error
);
}
else
{
console
.
info
(
"
FaultlogJsTest_005
ret ==
"
+
ret
.
length
);
console
.
info
(
"
DFX_DFR_Faultlogger_Interface_0100
ret ==
"
+
ret
.
length
);
expect
(
ret
.
length
).
assertEqual
(
loopTimes
);
for
(
let
i
=
0
;
i
<
loopTimes
;
i
++
)
{
console
.
info
(
"
faultloggertestsummary05
"
+
i
+
"
fullLog.length
"
+
ret
[
i
].
fullLog
.
length
);
if
(
ret
[
i
].
fullLog
.
indexOf
(
"
faultloggertestsummary05
"
+
(
loopTimes
-
1
-
i
))
!=
-
1
)
{
console
.
info
(
"
FaultlogJsTest_005
"
+
ret
[
i
].
fullLog
.
length
);
console
.
info
(
"
DFX_DFR_Faultlogger_Interface_0100
"
+
ret
[
i
].
fullLog
.
length
);
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
...
...
@@ -280,7 +280,7 @@ describe("FaultlogJsTest", function () {
}
catch
(
err
)
{
console
.
info
(
err
);
}
console
.
info
(
"
FaultlogJsTest_005
error
"
);
console
.
info
(
"
DFX_DFR_Faultlogger_Interface_0100
error
"
);
expect
(
false
).
assertTrue
();
done
();
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录