blob: 4547b0e412c9887b8283d80579b81c18f0d497e2 [file] [log] [blame]
// 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 Storage view using the axe-core linter.');
await TestRunner.loadModule('application_test_runner');
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`Storage`);
clearStorageElement.select();
const storageView = UI.panels.resources.visibleView;
TestRunner.addResult('Storage view is visible: ' + ApplicationTestRunner.isStorageView(storageView));
async function writeArray() {
const array = Array(1).fill(0);
const mainFrameId = TestRunner.resourceTreeModel.mainFrame.id;
await new Promise(resolve => ApplicationTestRunner.createDatabase(mainFrameId, 'Database1', resolve));
await new Promise(
resolve => ApplicationTestRunner.createObjectStore(mainFrameId, 'Database1', 'Store1', 'id', true, resolve));
await new Promise(
resolve =>
ApplicationTestRunner.addIDBValue(mainFrameId, 'Database1', 'Store1', {key: 1, value: array}, '', resolve));
}
await writeArray();
await AxeCoreTestRunner.runValidation(storageView.contentElement);
TestRunner.completeTest();
})();