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 16// @ts-ignore 17import {SpRecordTrace} from "../../../dist/trace/component/SpRecordTrace.js" 18 19describe('SpRecordTrace Test', () => { 20 21 let spRecordTrace = new SpRecordTrace(); 22 23 it('SpRecordTraceTest01', function () { 24 expect(spRecordTrace.initHtml()).not.toBe('') 25 }); 26 it('SpRecordTraceTest02', function () { 27 expect(spRecordTrace.initElements()).toBeUndefined() 28 }); 29 it('SpRecordTraceTest03', function () { 30 let toReturnWith = spRecordTrace.createFpsPluginConfig(); 31 expect(toReturnWith.sampleInterval).toBe(1000); 32 }); 33 it('SpRecordTraceTest04', function () { 34 let traceEvents = spRecordTrace.createTraceEvents(['Scheduling details', 'CPU Frequency and idle states', 35 'High frequency memory', 'Advanced ftrace config', 'Syscalls']); 36 expect(traceEvents[0].indexOf('binder/binder_lock')).toBe(-1) 37 }); 38}) 39