Commit da02b3f4 authored by Mathias Bynens's avatar Mathias Bynens Committed by Commit Bot

Remove DevTools locations pane test

The test now lives in the DevTools repository, here:

    devtools/devtools-frontend/src/test/webtests/http/tests/devtools/a11y-axe-core/settings/locations-a11y-test.js

Change-Id: I1d9cbc870cf1df97866b495cef3d0ee478f4b6ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2120576
Auto-Submit: Mathias Bynens <mathias@chromium.org>
Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#753215}
parent 6b4025d7
Tests accessibility in the settings tool locations pane using the axe-core linter.
Running: testAddLocation
Opened input box: true
aXe violations: []
Running: testNewLocationError
Invalidating the Location name input
Error message: Location name cannot be empty
Invalidating the Latitude input
Error message: Latitude must be a number
Invalidating the Longitude input
Error message: Longitude must be a number
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 settings tool locations pane using the axe-core linter.');
await TestRunner.loadModule('axe_core_test_runner');
await UI.viewManager.showView('emulation-locations');
const locationsWidget = await UI.viewManager.view('emulation-locations').widget();
async function testAddLocation() {
const addLocationButton = locationsWidget._defaultFocusedElement;
addLocationButton.click();
const newLocationInputs = locationsWidget._list._editor._controls;
TestRunner.addResult(`Opened input box: ${!!newLocationInputs}`);
await AxeCoreTestRunner.runValidation(locationsWidget.contentElement);
}
async function testNewLocationError() {
const locationsEditor = locationsWidget._list._editor;
const newLocationInputs = locationsEditor._controls;
const nameInput = newLocationInputs[0];
const latitudeInput = newLocationInputs[1];
const longitudeInput = newLocationInputs[2];
let errorMessage;
TestRunner.addResult(`Invalidating the ${nameInput.getAttribute('aria-label')} input`);
nameInput.blur();
errorMessage = locationsEditor._errorMessageContainer.textContent;
TestRunner.addResult(`Error message: ${errorMessage}`);
TestRunner.addResult(`Invalidating the ${latitudeInput.getAttribute('aria-label')} input`);
nameInput.value = 'location';
latitudeInput.value = 'a.a';
latitudeInput.dispatchEvent(new Event('input'));
errorMessage = locationsEditor._errorMessageContainer.textContent;
TestRunner.addResult(`Error message: ${errorMessage}`);
TestRunner.addResult(`Invalidating the ${longitudeInput.getAttribute('aria-label')} input`);
latitudeInput.value = '1.1';
longitudeInput.value = '1a.1';
longitudeInput.dispatchEvent(new Event('input'));
errorMessage = locationsEditor._errorMessageContainer.textContent;
TestRunner.addResult(`Error message: ${errorMessage}`);
await AxeCoreTestRunner.runValidation(locationsWidget.contentElement);
}
TestRunner.runAsyncTestSuite([testAddLocation, testNewLocationError]);
})();
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