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

DevTools: Add Scope pane axe test

This CL adds an axe accessibility test for the Sources panel Scope pane.

Bug: 963183
Change-Id: Icb24c0ae8312d38fe26eaa78903472128a01e7cd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1668238Reviewed-by: default avatarRobert Paveza <Rob.Paveza@microsoft.com>
Commit-Queue: Jack Lynch <jalyn@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#728672}
parent da0b34e8
Testing accessibility in the scope pane.
Script execution paused.
Scope pane content: Localthis: WindowClosure (makeClosure)WindowGlobal
Running the axe-core linter on the scope pane.
aXe violations: []
Expanding the makeClosure closure.
Scope pane content: Localthis: WindowClosure (makeClosure)x: 5WindowGlobal
Running the axe-core linter on the scope pane.
aXe violations: []
Script execution resumed.
// 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');
await UI.viewManager.showView('sources.scopeChain');
TestRunner.addResult('Testing accessibility in the scope pane.\n');
await SourcesTestRunner.startDebuggerTestPromise();
TestRunner.evaluateInPagePromise(`
function makeClosure() {
let x = 5;
function logX() {
console.log(x);
debugger;
}
return logX;
}
makeClosure()();
`);
await SourcesTestRunner.waitUntilPausedPromise();
await TestRunner.addSnifferPromise(Sources.ScopeChainSidebarPane.prototype, '_sidebarPaneUpdatedForTest');
const scopePane = self.runtime.sharedInstance(Sources.ScopeChainSidebarPane);
await TestRunner.addSnifferPromise(ObjectUI.ObjectPropertyTreeElement, 'populateWithProperties');
TestRunner.addResult(`Scope pane content: ${scopePane.contentElement.deepTextContent()}`);
TestRunner.addResult(`Running the axe-core linter on the scope pane.`);
await AxeCoreTestRunner.runValidation(scopePane.contentElement);
TestRunner.addResult('Expanding the makeClosure closure.');
scopePane._treeOutline._rootElement.childAt(1).expand();
await TestRunner.addSnifferPromise(ObjectUI.ObjectPropertyTreeElement, 'populateWithProperties');
TestRunner.addResult(`Scope pane content: ${scopePane.contentElement.deepTextContent()}`);
TestRunner.addResult(`Running the axe-core linter on the scope pane.`);
await AxeCoreTestRunner.runValidation(scopePane.contentElement);
SourcesTestRunner.completeDebuggerTest();
})();
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