Commit 89fdfa3a authored by Jack Lynch's avatar Jack Lynch Committed by Commit Bot

DevTools: Add axe test for call stack pane

This CL adds an axe accessibility test for the call stack pane. It was
previously reviewed in [1] but was split out because the CL was unwieldy
and it isn't dependent on those changes.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/1690089/

Bug: 963183
Change-Id: I247a5e6dfc6a5331c67944e6b95a34f7b06b2e6d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1716213
Commit-Queue: Jack Lynch <jalyn@microsoft.com>
Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704429}
parent 9fb6c92e
Testing accessibility in the call stack sidebar pane.
Set timer for test function.
Call stack pane content: Show blackboxed framesNot paused(anonymous)test.js:20callWithAsyncStacktest.js:13call1wrapper.js:1Promise.then (async)callWithAsyncStacktest.js:17call2VM wrapper.js:1Promise.then (async)callWithAsyncStacktest.js:17call3VM wrapper.js:1Promise.then (async)callWithAsyncStacktest.js:17call4VM wrapper.js:1Promise.then (async)callWithAsyncStacktest.js:17call5VM wrapper.js:1Promise.then (async)callWithAsyncStacktest.js:17testFunctiontest.js:20setTimeout (async)scheduleTestFunctionVM:3(anonymous)VM:1Show more
Running the axe-core linter on the call stack sidebar pane.
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('sources_test_runner');
await TestRunner.showPanel('sources');
TestRunner.addResult('Testing accessibility in the call stack sidebar pane.');
await TestRunner.evaluateInPagePromise(`
function callWithAsyncStack(f, depth) {
if (depth === 0) {
f();
return;
}
wrapper = eval('(function call' + depth + '() { callWithAsyncStack(f, depth - 1) }) //# sourceURL=wrapper.js');
Promise.resolve().then(wrapper);
}
function testFunction() {
callWithAsyncStack(() => {debugger}, 5);
}
//# sourceURL=test.js
`);
await SourcesTestRunner.startDebuggerTestPromise(/* quiet */ true);
await SourcesTestRunner.runTestFunctionAndWaitUntilPausedPromise();
await TestRunner.addSnifferPromise(
Sources.CallStackSidebarPane.prototype, '_updatedForTest');
const callStackPane = runtime.sharedInstance(Sources.CallStackSidebarPane);
const callStackElement = callStackPane.contentElement;
TestRunner.addResult(`Call stack pane content: ${TestRunner.clearSpecificInfoFromStackFrames(callStackElement.deepTextContent())}`);
TestRunner.addResult('Running the axe-core linter on the call stack sidebar pane.');
await AxeCoreTestRunner.runValidation(callStackElement);
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