-
Notifications
You must be signed in to change notification settings - Fork 366
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui: add tests for Wattson plugin + allow plugins to be enabled via url
Bug: 329507878 Change-Id: Ia1e07a1b9e212c7bd853aa413abb7198c9153b60
- Loading branch information
Showing
8 changed files
with
97 additions
and
2 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
test/data/ui-screenshots/wattson.test.ts/sched-aggregations/sched-aggr-process.png.sha256
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
f34bf2a4e27e532ae99819fc3f9595be853383bf929756f1261a311d6ff3a572 |
1 change: 1 addition & 0 deletions
1
test/data/ui-screenshots/wattson.test.ts/sched-aggregations/sched-aggr-thread.png.sha256
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
af2e494f4ac1ca9a1121d276509e36fda60caa5b03c5538d024ee89297d34d31 |
1 change: 1 addition & 0 deletions
1
...data/ui-screenshots/wattson.test.ts/wattson-aggregations/wattson-estimate-aggr.png.sha256
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2795614d6dd948b0a0150e116c29a51a5e85abf45982ccde6a93d24b0f44dfdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// Copyright (C) 2024 The Android Open Source Project | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
import {test, Page} from '@playwright/test'; | ||
import {PerfettoTestHelper} from './perfetto_ui_test_helper'; | ||
import {assertExists} from '../base/logging'; | ||
|
||
test.describe.configure({mode: 'serial'}); | ||
|
||
let pth: PerfettoTestHelper; | ||
let page: Page; | ||
|
||
// Clip only the bottom half of the UI. When dealing with area selection, the | ||
// time-width of the mouse-based region (which then is showed up in the upper | ||
// ruler) is not 100% reproducible. | ||
const SCREEN_CLIP = { | ||
clip: { | ||
x: 230, | ||
y: 500, | ||
width: 1920, | ||
height: 1080, | ||
}, | ||
}; | ||
|
||
test.beforeAll(async ({browser}, _testInfo) => { | ||
page = await browser.newPage(); | ||
pth = new PerfettoTestHelper(page); | ||
await pth.openTraceFile('wattson_dsu_pmu.pb', { | ||
enablePlugins: 'org.kernel.Wattson', | ||
}); | ||
}); | ||
|
||
test('wattson aggregations', async () => { | ||
const wattsonGrp = pth.locateTrackGroup('Wattson'); | ||
await wattsonGrp.scrollIntoViewIfNeeded(); | ||
await pth.toggleTrackGroup(wattsonGrp); | ||
const cpuEstimate = pth.locateTrack('Wattson/Cpu0 Estimate', wattsonGrp); | ||
const coords = assertExists(await cpuEstimate.boundingBox()); | ||
await page.keyboard.press('Escape'); | ||
await page.mouse.move(600, coords.y + 10); | ||
await page.mouse.down(); | ||
await page.mouse.move(1000, coords.y + 80); | ||
await page.mouse.up(); | ||
await pth.waitForIdleAndScreenshot('wattson-estimate-aggr.png', SCREEN_CLIP); | ||
await page.keyboard.press('Escape'); | ||
}); | ||
|
||
test('sched aggregations', async () => { | ||
await page.keyboard.press('Escape'); | ||
await page.mouse.move(600, 250); | ||
await page.mouse.down(); | ||
await page.mouse.move(800, 350); | ||
await page.mouse.up(); | ||
await pth.waitForPerfettoIdle(); | ||
|
||
await page.click('button[label="Wattson by thread"]'); | ||
await pth.waitForIdleAndScreenshot('sched-aggr-thread.png', SCREEN_CLIP); | ||
|
||
await page.click('button[label="Wattson by process"]'); | ||
await pth.waitForIdleAndScreenshot('sched-aggr-process.png', SCREEN_CLIP); | ||
|
||
await page.keyboard.press('Escape'); | ||
}); |