Commit 687aebfa authored by Mike Jackson's avatar Mike Jackson Committed by Commit Bot

DevTools: Prevent clear-storage-a11y-test from timing out

Refactored the code to use common methods (which didn't
exist when the test was written), and fix the time out
in the test.

The fix for the time out was to reduce the size of the
allocation we were making as data into indexeddb.

Change-Id: Id5889c923e421dc195a5a9edf58fedd37e39ca9d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1927219
Commit-Queue: Mike Jackson <mjackson@microsoft.com>
Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#718490}
parent 130029bc
......@@ -271,7 +271,6 @@ crbug.com/856601 [ Linux ] external/wpt/webrtc/idlharness.https.window.html [ Pa
crbug.com/856601 [ Linux ] external/wpt/webvtt/api/idlharness.window.html [ Pass Timeout ]
crbug.com/856601 [ Linux ] external/wpt/xhr/idlharness.any.worker.html [ Pass Timeout ]
crbug.com/856601 [ Linux ] http/tests/devtools/a11y-axe-core/console-a11y-test.js [ Pass Timeout ]
crbug.com/856601 [ Linux ] http/tests/devtools/a11y-axe-core/application-panel/clear-storage-a11y-test.js [ Pass Timeout ]
crbug.com/856601 [ Linux ] http/tests/devtools/a11y-axe-core/network/network-condition-a11y-test.js [ Pass Timeout ]
crbug.com/856601 [ Linux ] virtual/omt-worker-fetch/external/wpt/fetch/api/idl.any.serviceworker.html [ Pass Timeout ]
crbug.com/856601 [ Linux ] virtual/omt-worker-fetch/external/wpt/fetch/api/idl.any.worker.html [ Pass Timeout ]
......
......@@ -2,3 +2,4 @@ Tests accessibility in the Clear Storage view using the axe-core linter.
Clear storage view is visible: true
aXe violations: []
......@@ -7,8 +7,16 @@
await TestRunner.loadModule('axe_core_test_runner');
await ApplicationTestRunner.resetState();
await TestRunner.showPanel('resources');
await UI.viewManager.showView('resources');
const parent = UI.panels.resources._sidebar._applicationTreeElement;
const clearStorageElement = parent.children().find(child => child.title === ls`Clear storage`);
clearStorageElement.select();
const clearStorageView = UI.panels.resources.visibleView;
TestRunner.addResult('Clear storage view is visible: ' + (clearStorageView instanceof Resources.ClearStorageView));
async function writeArray() {
const array = Array(20000).fill(0);
const array = Array(1).fill(0);
const mainFrameId = TestRunner.resourceTreeModel.mainFrame.id;
await new Promise(resolve => ApplicationTestRunner.createDatabase(mainFrameId, 'Database1', resolve));
await new Promise(
......@@ -17,22 +25,8 @@
resolve =>
ApplicationTestRunner.addIDBValue(mainFrameId, 'Database1', 'Store1', {key: 1, value: array}, '', resolve));
}
async function runAxe(element) {
try {
const results = await axe.run(element);
const violations = AxeCoreTestRunner.processAxeResult(results.violations);
TestRunner.addResult(`aXe violations: ${violations}`);
} catch (e) {
TestRunner.addResult(`aXe threw an error: '${e}'`);
}
}
await UI.viewManager.showView('resources');
const parent = UI.panels.resources._sidebar._applicationTreeElement;
const clearStorageElement = parent.children().find(child => child.title === ls`Clear storage`);
clearStorageElement.select();
const clearStorageView = UI.panels.resources.visibleView;
TestRunner.addResult('Clear storage view is visible: ' + (clearStorageView instanceof Resources.ClearStorageView));
await writeArray();
await runAxe(clearStorageView.contentElement);
await AxeCoreTestRunner.runValidation(clearStorageView.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