Commit b7dd95b8 authored by Jack Lynch's avatar Jack Lynch Committed by Commit Bot

Reland "DevTools: Add axe test for Changes drawer"

This is a reland of 1da9c254

The test has been slimmed down the the minimum complexity necessary to
test this part of the UI in order to avoid future CI timeouts.

Original change's description:
> DevTools: Add axe test for Changes drawer
>
> This adds an axe test for the accessibility changes in #1659355. The
> test is in a separate PR from the changes because of the flaky axe test
> issue which should be fixed by #1638125.
>
> Bug: 963183
> Change-Id: Ibc3dbd8dd954e2493521bef48abdb65a802a91ca
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1666445
> Commit-Queue: Jack Lynch <jalyn@microsoft.com>
> Reviewed-by: Joel Einbinder <einbinder@chromium.org>
> Auto-Submit: Jack Lynch <jalyn@microsoft.com>
> Cr-Commit-Position: refs/heads/master@{#677600}

Bug: 963183
Change-Id: Ie537409e0b740a5c39b67dd5a280e4fcb330997f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1713441Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Jack Lynch <jalyn@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#697023}
parent 427836e6
Tests accessibility in the Changes drawer.
Showing the Changes drawer.
Running aXe on the Changes drawer.
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() {
TestRunner.addResult('Tests accessibility in the Changes drawer.');
await TestRunner.loadModule('axe_core_test_runner');
await TestRunner.loadModule('changes');
const diff = [
{0: Diff.Diff.Operation.Insert, 1: ['line 1 inserted']},
{0: Diff.Diff.Operation.Delete, 1: ['line 2 deleted']},
];
const uiSourceCodeMock = {mimeType: () => {}};
TestRunner.addResult('Showing the Changes drawer.');
await UI.viewManager.showView('changes.changes');
const changesWidget = await UI.viewManager.view('changes.changes').widget();
changesWidget._selectedUISourceCode = uiSourceCodeMock;
changesWidget._renderDiffRows(diff);
TestRunner.addResult('Running aXe on the Changes drawer.');
await AxeCoreTestRunner.runValidation(changesWidget.contentElement);
TestRunner.completeTest();
})();
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