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