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 */ 15import { CpuSetting, CheckCpuSetting } from '../../../../src/trace/component/schedulingAnalysis/CheckCpuSetting'; 16import '../../../../src/trace/component/schedulingAnalysis/CheckCpuSetting'; 17import { SpSchedulingAnalysis } from '../../../../src/trace/component/schedulingAnalysis/SpSchedulingAnalysis'; 18 19// @ts-ignore 20window.ResizeObserver = 21 window.ResizeObserver || 22 jest.fn().mockImplementation(() => ({ 23 disconnect: jest.fn(), 24 observe: jest.fn(), 25 unobserve: jest.fn(), 26 })); 27 28describe('CheckCpuSetting Test', () => { 29 it('CheckCpuSettingTest01', () => { 30 let cpuSetting = new CpuSetting(); 31 expect(cpuSetting).not.toBeUndefined(); 32 }); 33 it('CheckCpuSettingTest02', () => { 34 let checkCpuSetting = new CheckCpuSetting(); 35 expect(checkCpuSetting.init()).toBeUndefined(); 36 }); 37 it('CheckCpuSettingTest03', () => { 38 let checkCpuSetting = new CheckCpuSetting(); 39 expect(checkCpuSetting.initDefaultSetting()).toBeUndefined(); 40 }); 41 it('CheckCpuSettingTest04', () => { 42 let checkCpuSetting = new CheckCpuSetting(); 43 let cpuSetting = { 44 cpu: 1, 45 big: true, 46 middle: true, 47 small: true, 48 }; 49 expect(checkCpuSetting.createTableLine(cpuSetting)).toBeUndefined(); 50 }); 51 it('CheckCpuSettingTest05', () => { 52 let checkCpuSetting = new CheckCpuSetting(); 53 expect(checkCpuSetting.createHeaderDiv()).toBeUndefined(); 54 }); 55 56 it('CheckCpuSettingTest06', () => { 57 CheckCpuSetting.resetCpuSettings(); 58 expect(CheckCpuSetting.init_setting).toBeFalsy(); 59 }); 60}); 61