Hidebug.test.js 19.4 KB
Newer Older
U
uoengopen 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/*
 * 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 hidebug from '@ohos.hidebug'
import fileio from '@ohos.fileio'
17
import process from '@ohos.process'
18
import featureAbility from '@ohos.ability.featureAbility'
J
jiyong_sd 已提交
19
import {describe, it, expect} from '@ohos/hypium'
U
uoengopen 已提交
20

J
jiyong_sd 已提交
21
export default function HidebugJsTest() {
U
uoengopen 已提交
22 23 24
describe('HidebugJsTest', function () {

    /*
C
chenxuihui 已提交
25
     * @tc.number    : DFX_DFR_Hiprofiler_Interface_0600
U
uoengopen 已提交
26 27 28
     * @tc.name      : getNativeHeapSize
     * @tc.desc      : Get total native heap memory size
     */
C
chenxuihui 已提交
29 30
    it('DFX_DFR_Hiprofiler_Interface_0600', 0, function() {
        console.log('************* DFX_DFR_Hiprofiler_Interface_0600 Test start*************');
U
uoengopen 已提交
31 32
        try {
            let heapSize = hidebug.getNativeHeapSize();
C
chenxuihui 已提交
33
            expect(heapSize>BigInt(0)).assertTrue();
U
uoengopen 已提交
34 35 36
        } catch (error) {
            expect().assertFail();
        }
C
chenxuihui 已提交
37
        console.log('************* DFX_DFR_Hiprofiler_Interface_0600 Test end*************');
U
uoengopen 已提交
38 39 40
    });

    /*
C
chenxuihui 已提交
41
     * @tc.number    : DFX_DFR_Hiprofiler_Interface_0400
U
uoengopen 已提交
42 43 44
     * @tc.name      : getNativeHeapAllocatedSize
     * @tc.desc      : Get Native heap memory allocation size.
     */
C
chenxuihui 已提交
45 46
    it('DFX_DFR_Hiprofiler_Interface_0400', 0, function() {
        console.log('************* DFX_DFR_Hiprofiler_Interface_0400 Test start*************');
U
uoengopen 已提交
47 48
        try {
            let heapAllocatedSize = hidebug.getNativeHeapAllocatedSize();
C
chenxuihui 已提交
49
            expect(heapAllocatedSize>BigInt(0)).assertTrue();
U
uoengopen 已提交
50 51 52
        } catch (error) {
            expect().assertFail();
        }
C
chenxuihui 已提交
53
        console.log('************* DFX_DFR_Hiprofiler_Interface_0400 Test end*************');
U
uoengopen 已提交
54 55 56
    });

    /*
C
chenxuihui 已提交
57
     * @tc.number    : DFX_DFR_Hiprofiler_Interface_0500
U
uoengopen 已提交
58 59 60
     * @tc.name      : getNativeHeapFreeSize
     * @tc.desc      : Get Native heap memory free size
     */
C
chenxuihui 已提交
61 62
    it('DFX_DFR_Hiprofiler_Interface_0500', 0, function() {
        console.log('************* DFX_DFR_Hiprofiler_Interface_0500 Test start*************');
U
uoengopen 已提交
63 64
        try {
            let heapFreeSize = hidebug.getNativeHeapFreeSize();
C
chenxuihui 已提交
65
            expect(heapFreeSize>BigInt(0)).assertTrue();
U
uoengopen 已提交
66 67 68
        } catch (error) {
            expect().assertFail();
        }
C
chenxuihui 已提交
69
        console.log('************* DFX_DFR_Hiprofiler_Interface_0500 Test end*************');
U
uoengopen 已提交
70 71 72
    });

    /*
C
chenxuihui 已提交
73
     * @tc.number    : DFX_DFR_Hiprofiler_Interface_0800
U
uoengopen 已提交
74 75 76
     * @tc.name      : getPss
     * @tc.desc      : Get application process proportional set size memory information
     */
77
    it('DFX_DFR_Hiprofiler_Interface_0800', 0, function() {
C
chenxuihui 已提交
78
        console.log('************* DFX_DFR_Hiprofiler_Interface_0800 Test start*************');
U
uoengopen 已提交
79 80 81 82 83 84 85 86 87 88 89 90 91
        try {
            const times = 3;
            let pssValue = BigInt(0);
            for(let i = 0; i < times; i++){
                let arr = new Array(i*100000).fill(1);
                let tmp = hidebug.getPss();
                console.info('No.' + i + ' tmp: ' + tmp);
                expect(tmp).assertLarger(pssValue);
                pssValue = tmp;
            }
        } catch (error) {
            expect().assertFail();
        }
C
chenxuihui 已提交
92
        console.log('************* DFX_DFR_Hiprofiler_Interface_0800 Test end*************');
U
uoengopen 已提交
93 94 95
    });

    /*
C
chenxuihui 已提交
96
     * @tc.number    : DFX_DFR_Hiprofiler_Interface_1200
U
uoengopen 已提交
97 98 99
     * @tc.name      : getSharedDirty
     * @tc.desc      : Obtains the size of the shared dirty memory of a process.
     */
100
    it('DFX_DFR_Hiprofiler_Interface_1200', 0, function() {
C
chenxuihui 已提交
101
        console.log('************* DFX_DFR_Hiprofiler_Interface_1200 Test start*************');
U
uoengopen 已提交
102 103 104 105 106 107 108
        try {
            let dirty = hidebug.getSharedDirty();
            let temp = hidebug.getSharedDirty();
            expect(dirty).assertEqual(temp);
        } catch (error) {
            expect().assertFail();
        }
C
chenxuihui 已提交
109
        console.log('************* DFX_DFR_Hiprofiler_Interface_1200 Test end*************');
U
uoengopen 已提交
110 111 112
    });

    /*
C
chenxuihui 已提交
113
     * @tc.number    : DFX_DFR_Hiprofiler_Interface_1600
U
uoengopen 已提交
114 115 116
     * @tc.name      : startProfiling with normal parameter
     * @tc.desc      : Start CPU Profiling.
     */
117
    it('DFX_DFR_Hiprofiler_Interface_1600', 0, function() {
C
chenxuihui 已提交
118
        console.log('************* DFX_DFR_Hiprofiler_Interface_1600 Test start*************');
U
uoengopen 已提交
119 120 121 122
        try {
            let timestamp = Date.now();
            let filename = 'cpuprofiler-' + timestamp.toString();
            console.info(filename);
U
uoengopen 已提交
123
            let path = '/data/app/el2/100/base/com.hidebug.test/files/' + filename + '.json'
U
uoengopen 已提交
124 125 126 127 128 129 130 131
            hidebug.startProfiling(filename);
            let temp = 100;
            hidebug.stopProfiling();
            console.info('file is exists:', path);
            expect(true).assertTrue();
        } catch (error) {
            expect().assertFail();
        }
C
chenxuihui 已提交
132
        console.log('************* DFX_DFR_Hiprofiler_Interface_1600 Test end*************');
U
uoengopen 已提交
133 134 135
    });

    /*
C
chenxuihui 已提交
136
     * @tc.number    : DFX_DFR_Hiprofiler_Interface_1500
U
uoengopen 已提交
137 138 139
     * @tc.name      : startProfiling repeatedly
     * @tc.desc      : Start CPU Profiling.
     */
140
    it('DFX_DFR_Hiprofiler_Interface_1500', 0, function() {
C
chenxuihui 已提交
141
        console.log('************* DFX_DFR_Hiprofiler_Interface_1500 Test start*************');
U
uoengopen 已提交
142
        try {
U
uoengopen 已提交
143 144 145
            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'
            let path3 = '/data/app/el2/100/base/com.hidebug.test/files/cpuprofiler-333.json'
U
uoengopen 已提交
146 147 148 149 150 151
            hidebug.startProfiling('cpuprofiler-111');
            hidebug.startProfiling('cpuprofiler-222');
            hidebug.startProfiling('cpuprofiler-333');
            let temp = 100;
            hidebug.stopProfiling();
            hidebug.stopProfiling();
U
uoengopen 已提交
152 153 154 155
            console.info('file is exists:', path1);
            console.info('file is exists:', path2);
            console.info('file is exists:', path3);
            expect(true).assertTrue();
U
uoengopen 已提交
156 157 158
        } catch (error) {
            expect().assertFail();
        }
C
chenxuihui 已提交
159
        console.log('************* DFX_DFR_Hiprofiler_Interface_1500 Test end*************');
U
uoengopen 已提交
160 161 162
    });

    /*
C
chenxuihui 已提交
163
     * @tc.number    : DFX_DFR_Hiprofiler_Interface_1400
U
uoengopen 已提交
164 165 166
     * @tc.name      : startProfiling with empty parameter
     * @tc.desc      : Start CPU Profiling.
     */
167
    it('DFX_DFR_Hiprofiler_Interface_1400', 0, function() {
C
chenxuihui 已提交
168
        console.log('************* DFX_DFR_Hiprofiler_Interface_1400 Test start*************');
U
uoengopen 已提交
169
        let path = '/data/app/el2/100/base/com.hidebug.test/files/undefined.json'
U
uoengopen 已提交
170 171 172 173 174 175
        try {
            fileio.accessSync(path, 0);
            let res = fileio.unlinkSync(path);
            console.log(JSON.stringify(res));
        } catch(e) {
            console.info('the file is not exists');
U
uoengopen 已提交
176
        }
U
uoengopen 已提交
177 178 179 180 181 182
        try {
            hidebug.startProfiling('');
            let temp = 100;
            hidebug.stopProfiling();
            console.info('file is exists:', path);
            expect(true).assertTrue();
U
uoengopen 已提交
183 184
        } catch (error) {
            expect().assertFail();
U
uoengopen 已提交
185
        }
C
chenxuihui 已提交
186
        console.log('************* DFX_DFR_Hiprofiler_Interface_1400 Test end*************');
U
uoengopen 已提交
187 188 189
    });

    /*
C
chenxuihui 已提交
190
     * @tc.number    : DFX_DFR_Hiprofiler_Interface_1300
U
uoengopen 已提交
191 192 193
     * @tc.name      : startProfiling with overlong parameter
     * @tc.desc      : Start CPU Profiling.
     */
C
chenxuihui 已提交
194
    it('DFX_DFR_Hiprofiler_Interface_1300', 0, function() {
C
chenxuihui 已提交
195
        console.log('************* DFX_DFR_Hiprofiler_Interface_1300 Test start*************');
U
uoengopen 已提交
196
        let path = '/data/app/el2/100/base/com.hidebug.test/files/undefined.json'
U
uoengopen 已提交
197 198 199 200 201 202
        try {
            fileio.accessSync(path, 0);
            let res = fileio.unlinkSync(path);
            console.log(JSON.stringify(res));
        } catch(e) {
            console.info('the file is not exists');
U
uoengopen 已提交
203
        }
U
uoengopen 已提交
204 205 206 207 208 209 210 211 212 213 214 215 216
        let str = '';
        for (let i = 0; i < 1000; i++) {
            str += 'abcd';
        }
        try {
            hidebug.startProfiling(str);
            let temp = 100;
            hidebug.stopProfiling();
            console.info('file is exists:', path);
            expect(true).assertTrue();
        } catch (error) {
            expect().assertFail();
        }
C
chenxuihui 已提交
217
        console.log('************* DFX_DFR_Hiprofiler_Interface_1300 Test end*************');
U
uoengopen 已提交
218 219 220
    });

    /*
C
chenxuihui 已提交
221
     * @tc.number    : DFX_DFR_Hiprofiler_Interface_0300
U
uoengopen 已提交
222 223 224
     * @tc.name      : dumpHeapData with normal parameter
     * @tc.desc      : Dump JS Virtual Machine Heap Snapshot.
     */
225
    it('DFX_DFR_Hiprofiler_Interface_0300', 0, function() {
C
chenxuihui 已提交
226
        console.log('************* DFX_DFR_Hiprofiler_Interface_0300 Test start*************');
U
uoengopen 已提交
227 228 229 230
        try {
            let timestamp = Date.now();
            let filename = 'heap-' + timestamp.toString();
            console.info(filename);
U
uoengopen 已提交
231
            let path = '/data/app/el2/100/base/com.hidebug.test/files/' + filename + '.heapsnapshot'
U
uoengopen 已提交
232 233 234 235 236 237
            hidebug.dumpHeapData(filename);
            console.info('file is exists:', path);
            expect(true).assertTrue();
        } catch (error) {
            expect().assertFail();
        }
C
chenxuihui 已提交
238
        console.log('************* DFX_DFR_Hiprofiler_Interface_0300 Test end*************');
U
uoengopen 已提交
239 240 241
      });

    /*
C
chenxuihui 已提交
242
     * @tc.number    : DFX_DFR_Hiprofiler_Interface_0200
U
uoengopen 已提交
243 244 245
     * @tc.name      : dumpHeapData with empty parameter
     * @tc.desc      : Dump JS Virtual Machine Heap Snapshot.
     */
246
    it('DFX_DFR_Hiprofiler_Interface_0200', 0, function() {
C
chenxuihui 已提交
247
        console.log('************* DFX_DFR_Hiprofiler_Interface_0200 Test start*************');
U
uoengopen 已提交
248
        let path = '/data/app/el2/100/base/com.hidebug.test/files/undefined.heapsnapshot'
U
uoengopen 已提交
249 250 251 252 253 254
        try {
            fileio.accessSync(path, 0);
            let res = fileio.unlinkSync(path);
            console.log(JSON.stringify(res));
        } catch(e) {
            console.info('the file is not exists');
U
uoengopen 已提交
255
        }
U
uoengopen 已提交
256 257 258 259
        try {
            hidebug.dumpHeapData('');
            console.info('file is exists:', path);
            expect(true).assertTrue();
U
uoengopen 已提交
260 261
        } catch (error) {
            expect().assertFail();
U
uoengopen 已提交
262
        }
C
chenxuihui 已提交
263
        console.log('************* DFX_DFR_Hiprofiler_Interface_0200 Test end*************');
U
uoengopen 已提交
264 265 266
      });

    /*
C
chenxuihui 已提交
267
     * @tc.number    : DFX_DFR_Hiprofiler_Interface_0100
U
uoengopen 已提交
268 269 270
     * @tc.name      : dumpHeapData with overlog parameter
     * @tc.desc      : Dump JS Virtual Machine Heap Snapshot.
     */
271
    it('DFX_DFR_Hiprofiler_Interface_0100', 0, function() {
C
chenxuihui 已提交
272
        console.log('************* DFX_DFR_Hiprofiler_Interface_0100 Test start*************');
U
uoengopen 已提交
273
        let path = '/data/app/el2/100/base/com.hidebug.test/files/undefined.heapsnapshot'
U
uoengopen 已提交
274 275 276 277 278 279
        try {
            fileio.accessSync(path, 0);
            let res = fileio.unlinkSync(path);
            console.log(JSON.stringify(res));
        } catch(e) {
            console.info('the file is not exists');
U
uoengopen 已提交
280
        }
U
uoengopen 已提交
281 282 283 284 285 286 287 288 289 290 291
        let str = '';
        for (let i = 0; i < 1000; i++) {
            str += 'abcd';
        }
        try {
            hidebug.dumpHeapData(str);
            console.info('file is exists:', path);
            expect(true).assertTrue();
        } catch (error) {
            expect().assertFail();
        }
C
chenxuihui 已提交
292
        console.log('************* DFX_DFR_Hiprofiler_Interface_0100 Test end*************');
U
uoengopen 已提交
293
    });
U
uoengopen 已提交
294 295

    /*
C
chenxuihui 已提交
296
     * @tc.number    : DFX_DFR_Hiprofiler_Interface_0700
U
uoengopen 已提交
297 298 299
     * @tc.name      : getPrivateDirty
     * @tc.desc      : Get the size of the private dirty memory
     */
C
chenxuihui 已提交
300 301
    it('DFX_DFR_Hiprofiler_Interface_0700', 0, function() {
        console.log('************* DFX_DFR_Hiprofiler_Interface_0700 Test start*************');
U
uoengopen 已提交
302 303 304 305 306 307
        try {
            let temp = hidebug.getPrivateDirty();
            expect(temp>=BigInt(0)).assertTrue();
        } catch (error) {
            expect().assertFail();
        }
C
chenxuihui 已提交
308
        console.log('************* DFX_DFR_Hiprofiler_Interface_0700 Test end*************');
U
uoengopen 已提交
309 310 311
    });

    /*
C
chenxuihui 已提交
312
     * @tc.number    : DFX_DFR_Hiprofiler_Interface_1700
U
uoengopen 已提交
313 314 315
     * @tc.name      : getCpuUsage
     * @tc.desc      : Get the cpu usage of a process
     */
C
chenxuihui 已提交
316 317
    it('DFX_DFR_Hiprofiler_Interface_1700', 0, function() {
        console.log('************* DFX_DFR_Hiprofiler_Interface_1700 Test start*************');
U
uoengopen 已提交
318 319
        try {
            let temp = -1;
U
uoengopen 已提交
320 321
            for(let i=0;i<=101;i++){
                for(let j=0;j<=101;j++){
U
uoengopen 已提交
322
                    if(i+j == 202){
U
uoengopen 已提交
323 324 325 326 327 328 329 330 331
                        temp = hidebug.getCpuUsage();
                        console.info("CpuUsage is " + temp);
                    }
                }
            }
            expect(temp>=0 && temp<=1).assertTrue();
        } catch (error) {
            expect().assertFail();
        }
C
chenxuihui 已提交
332
        console.log('************* DFX_DFR_Hiprofiler_Interface_1700 Test end*************');
U
uoengopen 已提交
333 334 335
    });

    /*
C
chenxuihui 已提交
336
     * @tc.number    : DFX_DFR_Hiprofiler_Interface_1100
U
uoengopen 已提交
337 338 339
     * @tc.name      : getServiceDump with normal parameter
     * @tc.desc      : getServiceDump
     */
C
chenxuihui 已提交
340 341
    it('DFX_DFR_Hiprofiler_Interface_1100', 0, function() {
        console.log('************* DFX_DFR_Hiprofiler_Interface_1100 Test start*************');
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357
        let context = featureAbility.getContext();
        context.getFilesDir().then((data) => {
            var path = data + "/serviceInfo1.txt"
            let fd = fileio.openSync(path, 0o102, 0o666)
            var serviceId = 10
            var args = new Array("allInfo")
            try {
                hidebug.getServiceDump(serviceId, fd, args)
                expect(true).assertTrue();
            } catch (error) {
                expect().assertFail();
                console.info(error.code)
                console.info(error.message)
            }
            fileio.closeSync(fd);
        })
C
chenxuihui 已提交
358
        console.log('************* DFX_DFR_Hiprofiler_Interface_1100 Test end*************');
U
uoengopen 已提交
359 360 361
    });

    /*
C
chenxuihui 已提交
362
     * @tc.number    : DFX_DFR_Hiprofiler_Interface_0900
363
     * @tc.name      : getServiceDump with parameter error
U
uoengopen 已提交
364 365
     * @tc.desc      : getServiceDump
     */
C
chenxuihui 已提交
366 367
    it('DFX_DFR_Hiprofiler_Interface_0900', 0, function() {
        console.log('************* DFX_DFR_Hiprofiler_Interface_0900 Test start*************');
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383
        let context = featureAbility.getContext();
        context.getFilesDir().then((data) => {
            var path = data + "/serviceInfo2.txt"
            let fd = fileio.openSync(path, 0o102, 0o666)
            var serviceId = 10
            var args = new Array("allInfo")
            try {
                hidebug.getServiceDump(serviceId)
                expect().assertFail();
            } catch (error) {
                console.info(error.code)
                console.info(error.message)
                expect(error.code == 401).assertTrue();
            }
            fileio.closeSync(fd);
        })
C
chenxuihui 已提交
384
        console.log('************* DFX_DFR_Hiprofiler_Interface_0900 Test end*************');
U
uoengopen 已提交
385 386 387
    });

    /*
C
chenxuihui 已提交
388
     * @tc.number    : DFX_DFR_Hiprofiler_Interface_1000
389
     * @tc.name      : getServiceDump with check system ability failed
U
uoengopen 已提交
390 391
     * @tc.desc      : getServiceDump
     */
C
chenxuihui 已提交
392 393
    it('DFX_DFR_Hiprofiler_Interface_1000', 0, function() {
        console.log('************* DFX_DFR_Hiprofiler_Interface_1000 Test start*************');
394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409
        let context = featureAbility.getContext();
        context.getFilesDir().then((data) => {
            var path = data + "/serviceInfo3.txt"
            let fd = fileio.openSync(path, 0o102, 0o666)
            var serviceId = -10
            var args = new Array("allInfo")
            try {
                hidebug.getServiceDump(serviceId, fd, args)
                expect().assertFail();
            } catch (error) {
                console.info(error.code)
                console.info(error.message)
                expect(error.code == 11400101).assertTrue();
            }
            fileio.closeSync(fd);
        })
C
chenxuihui 已提交
410
        console.log('************* DFX_DFR_Hiprofiler_Interface_1000 Test end*************');
U
uoengopen 已提交
411
    });
412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428

    /*
     * @tc.number    : DFX_DFR_Hiprofiler_Interface_1800
     * @tc.name      : startJsCpuProfiling/stopJsCpuProfiling with normal parameter
     * @tc.desc      : startJsCpuProfiling/stopJsCpuProfiling
     */
     it('DFX_DFR_Hiprofiler_Interface_1800', 0, function() {
        console.log('************* DFX_DFR_Hiprofiler_Interface_1800 Test start*************');
        try {
            let timestamp = Date.now();
            let filename = "cpuprofiler_" + timestamp.toString();
            hidebug.startJsCpuProfiling(filename);
            for (var i = 0; i < 3; i++) {
                hidebug.getSharedDirty();
            }
            hidebug.stopJsCpuProfiling();
            var pid = process.pid;
C
chenxuihui 已提交
429
            let path = "/proc/" + pid + "/root/data/storage/el2/base/files/" + filename + ".cpuprofile";
430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497
            let data = fileio.readTextSync(path);
            if (data.includes("napi")) {
                expect(true).assertTrue();
            } else {
                expect(false).assertTrue();
            }
        } catch (err) {
            console.error('DFX_DFR_Hiprofiler_Interface_1800 has failed for ' + err);
            expect(false).assertTrue();
        }
        console.log('************* DFX_DFR_Hiprofiler_Interface_1800 Test end*************');
    });

    /*
     * @tc.number    : DFX_DFR_Hiprofiler_Interface_1900
     * @tc.name      : startJsCpuProfiling/stopJsCpuProfiling with abnormal parameter
     * @tc.desc      : startJsCpuProfiling/stopJsCpuProfiling
     */
     it('DFX_DFR_Hiprofiler_Interface_1900', 0, function() {
        console.log('************* DFX_DFR_Hiprofiler_Interface_1900 Test start*************');
        try {
            hidebug.startJsCpuProfiling();
            for (var i = 0; i < 3; i++) {
                hidebug.getSharedDirty();
            }
            hidebug.stopJsCpuProfiling();
        } catch (error) {
            console.info(error.code);
            console.info(error.message);
            expect(error.code == 401).assertTrue();
        }
        console.log('************* DFX_DFR_Hiprofiler_Interface_1900 Test end*************');
    });

    /*
     * @tc.number    : DFX_DFR_Hiprofiler_Interface_2000
     * @tc.name      : dumpJsHeapData with normal parameter
     * @tc.desc      : dumpJsHeapData
     */
     it('DFX_DFR_Hiprofiler_Interface_2000', 0, function() {
        console.log('************* DFX_DFR_Hiprofiler_Interface_2000 Test start*************');
        try {
            hidebug.dumpJsHeapData("heapData");
            expect(true).assertTrue();
        } catch (error) {
            console.info(error.code);
            console.info(error.message);
        }
        console.log('************* DFX_DFR_Hiprofiler_Interface_2000 Test end*************');
    });

    /*
     * @tc.number    : DFX_DFR_Hiprofiler_Interface_2100
     * @tc.name      : dumpJsHeapData with abnormal parameter
     * @tc.desc      : dumpJsHeapData
     */
     it('DFX_DFR_Hiprofiler_Interface_2100', 0, function() {
        console.log('************* DFX_DFR_Hiprofiler_Interface_2100 Test start*************');
        try {
            hidebug.dumpJsHeapData();
        } catch (error) {
            console.info(error.code);
            console.info(error.message);
            expect(error.code == 401).assertTrue();
        }
        console.log('************* DFX_DFR_Hiprofiler_Interface_2100 Test end*************');
    });

U
uoengopen 已提交
498
})
J
jiyong_sd 已提交
499
}