xref: /aosp_15_r20/external/perfetto/ui/src/test/independent_features.test.ts (revision 6dbdd20afdafa5e3ca9b8809fa73465d530080dc)
1// Copyright (C) 2024 The Android Open Source Project
2//
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 {test} from '@playwright/test';
16import {PerfettoTestHelper} from './perfetto_ui_test_helper';
17
18test.describe.configure({mode: 'parallel'});
19
20// Test that we show a (debuggable) chip next to tracks for debuggable apps.
21// Regression test for aosp/3106008 .
22test('debuggable chip', async ({browser}) => {
23  const page = await browser.newPage();
24  const pth = new PerfettoTestHelper(page);
25  await pth.openTraceFile('api32_startup_warm.perfetto-trace');
26  const trackGroup = pth.locateTrackGroup(
27    'androidx.benchmark.integration.macrobenchmark.test 7527',
28  );
29  await trackGroup.scrollIntoViewIfNeeded();
30  await pth.waitForIdleAndScreenshot('track_with_debuggable_chip.png');
31
32  await pth.toggleTrackGroup(trackGroup);
33  await pth.waitForIdleAndScreenshot('track_with_debuggable_chip_expanded.png');
34});
35
36test('trace error notification', async ({browser}) => {
37  const page = await browser.newPage();
38  const pth = new PerfettoTestHelper(page);
39  await pth.openTraceFile('clusterfuzz_14753');
40  await pth.waitForIdleAndScreenshot('error-icon.png', {
41    clip: {x: 1800, y: 0, width: 150, height: 150},
42  });
43});
44