Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
e499b96b
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看板
提交
e499b96b
编写于
7月 23, 2022
作者:
C
chenxuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
hidebug测试用例编号修改
Signed-off-by:
N
chenxuihui
<
chenxuhui2@huawei.com
>
上级
3c0256fc
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
68 addition
and
68 deletion
+68
-68
hiviewdfx/hidebugtest/hidebugtestjstest/src/main/js/test/Hidebug.test.js
...ugtest/hidebugtestjstest/src/main/js/test/Hidebug.test.js
+68
-68
未找到文件。
hiviewdfx/hidebugtest/hidebugtestjstest/src/main/js/test/Hidebug.test.js
浏览文件 @
e499b96b
...
...
@@ -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
,
async
function
(
done
)
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
800
Test start*************
'
);
try
{
const
times
=
3
;
let
pssValue
=
BigInt
(
0
);
...
...
@@ -87,17 +87,17 @@ describe('HidebugJsTest', function () {
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
004
Test end*************
'
);
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
800
Test end*************
'
);
done
();
});
/*
* @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
,
async
function
(
done
)
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
1200
Test start*************
'
);
try
{
let
dirty
=
hidebug
.
getSharedDirty
();
let
temp
=
hidebug
.
getSharedDirty
();
...
...
@@ -105,17 +105,17 @@ describe('HidebugJsTest', function () {
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
0005
Test end*************
'
);
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
1200
Test end*************
'
);
done
();
});
/*
* @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
,
async
function
(
done
)
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
1600
Test start*************
'
);
try
{
let
timestamp
=
Date
.
now
();
let
filename
=
'
cpuprofiler-
'
+
timestamp
.
toString
();
...
...
@@ -129,17 +129,17 @@ describe('HidebugJsTest', function () {
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
0006
Test end*************
'
);
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
1600
Test end*************
'
);
done
();
});
/*
* @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
,
async
function
(
done
)
{
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 +157,17 @@ describe('HidebugJsTest', function () {
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
0007
Test end*************
'
);
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
1500
Test end*************
'
);
done
();
});
/*
* @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
,
async
function
(
done
)
{
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 +185,17 @@ describe('HidebugJsTest', function () {
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
0008
Test end*************
'
);
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
1400
Test end*************
'
);
done
();
});
/*
* @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
,
async
function
(
done
)
{
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 +217,17 @@ describe('HidebugJsTest', function () {
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
0009
Test end*************
'
);
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_
1300
Test end*************
'
);
done
();
});
/*
* @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
01
0
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
01
0 Test start*************
'
);
it
(
'
DFX_DFR_Hiprofiler_Interface_0
30
0
'
,
0
,
async
function
(
done
)
{
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
30
0 Test start*************
'
);
try
{
let
timestamp
=
Date
.
now
();
let
filename
=
'
heap-
'
+
timestamp
.
toString
();
...
...
@@ -239,17 +239,17 @@ describe('HidebugJsTest', function () {
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
01
0 Test end*************
'
);
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
30
0 Test end*************
'
);
done
();
});
/*
* @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
,
async
function
(
done
)
{
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 +265,17 @@ describe('HidebugJsTest', function () {
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
011
Test end*************
'
);
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
200
Test end*************
'
);
done
();
});
/*
* @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
,
async
function
(
done
)
{
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 +295,33 @@ describe('HidebugJsTest', function () {
}
catch
(
error
)
{
expect
().
assertFail
();
}
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
012
Test end*************
'
);
console
.
log
(
'
************* DFX_DFR_Hiprofiler_Interface_0
100
Test end*************
'
);
done
();
});
/*
* @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 +336,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 +353,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 +370,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 +387,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*************
'
);
});
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录