Commit a6c1c072 authored by John Emau's avatar John Emau Committed by Commit Bot

DevTools: add axe tests for performance details, bottom-up and call tree panes

The tests use dummy data simulating a performance run.

Screenshot of details (aka summary) pane: https://i.imgur.com/hQXhjma.png
Screenshot of bottom-up pane: https://i.imgur.com/RuUS3RM.png
Screenshot of call tree pane: https://i.imgur.com/RaWp632.png

Bug: 963183
Change-Id: Ie56bfe4a66bd791997d675c4013097890b61458e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1733418
Commit-Queue: John Emau <johnemau@microsoft.com>
Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700099}
parent 08545b88
Running: testDetailsView
Tests accessibility in performance Details view using the axe-core linter
aXe violations: []
Running: testBottomUpView
Tests accessibility in performance BottomUp view using the axe-core linter
aXe violations: []
Running: testCallTreeView
Tests accessibility in performance CallTree view using the axe-core linter
aXe violations: []
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function() {
await TestRunner.loadModule('axe_core_test_runner');
await TestRunner.loadModule('performance_test_runner');
await TestRunner.showPanel('timeline');
const testData = [
{
'name': 'top level event name',
'ts': 1000000,
'ph': 'B',
'tid': 1,
'pid': 100,
'cat': 'toplevel',
'args': {'data': {'message': 'AAA'}}
},
{
'name': 'TimeStamp',
'ts': 1010000,
'ph': 'B',
'tid': 1,
'pid': 100,
'cat': 'toplevel',
'args': {'data': {'message': 'BBB'}}
},
{
'name': 'TimeStamp',
'ts': 1020000,
'ph': 'B',
'tid': 1,
'pid': 100,
'cat': 'toplevel',
'args': {'data': {'message': 'CCC'}}
},
];
// create dummy data for test
const model =
PerformanceTestRunner.createPerformanceModelWithEvents(testData);
const detailsView = runtime.sharedInstance(Timeline.TimelineDetailsView);
async function testDetailsView() {
TestRunner.addResult(`Tests accessibility in performance Details view using the axe-core linter`);
detailsView._tabbedPane.selectTab(Timeline.TimelineDetailsView.Tab.Details);
const detailsTab = detailsView._tabbedPane.visibleView;
// Details pane gets data from the parent TimelineDetails view
detailsView.setModel(model, PerformanceTestRunner.mainTrack());
await AxeCoreTestRunner.runValidation(detailsTab.element);
}
async function testViewWithName(tab) {
TestRunner.addResult(`Tests accessibility in performance ${tab} view using the axe-core linter`);
detailsView._tabbedPane.selectTab(tab);
const detailsTab = detailsView._tabbedPane.visibleView;
// update child views with the same test data
detailsTab.setModel(model, PerformanceTestRunner.mainTrack());
detailsTab.updateContents(Timeline.TimelineSelection.fromRange(
model.timelineModel().minimumRecordTime(),
model.timelineModel().maximumRecordTime()));
await AxeCoreTestRunner.runValidation(detailsTab.element);
}
function testBottomUpView() {
return testViewWithName(Timeline.TimelineDetailsView.Tab.BottomUp);
}
function testCallTreeView() {
return testViewWithName(Timeline.TimelineDetailsView.Tab.CallTree);
}
TestRunner.runAsyncTestSuite([
testDetailsView,
testBottomUpView,
testCallTreeView,
]);
})();
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment