1/* 2 * Copyright (C) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import { PerfFireChartStruct, HiPerfChartFrame } from '../../../src/trace/bean/PerfStruct'; 17describe('PerfStruct', () => { 18 it('PerfStructTest01', () => { 19 let perfFireChartStruct = new PerfFireChartStruct(0, '1', 2, 3, 4, 5); 20 let struct = { 21 depth: 2, 22 id: 0, 23 name: '1', 24 selfTime: 3, 25 thread_id: 5, 26 totalTime: 4, 27 }; 28 expect(perfFireChartStruct).toEqual(struct); 29 }); 30 it('PerfStructTest02', () => { 31 let hiPerfChartFrame = new HiPerfChartFrame(0, '1', 2, 3, 4, 5, 6); 32 let struct = { 33 children: [], 34 column: 0, 35 depth: 5, 36 endTime: 3, 37 id: 0, 38 isSelect: false, 39 line: 0, 40 name: '1', 41 selfTime: 0, 42 startTime: 2, 43 thread_id: 6, 44 totalTime: 4, 45 }; 46 expect(hiPerfChartFrame).toEqual(struct); 47 }); 48}); 49