Commit 69e3a2a3 authored by Daniel Classon's avatar Daniel Classon Committed by Commit Bot

[DevicePage] Turn Display and Keyboard tests into suites

Allows the addition of further display and keyboard tests needed to
test out deep linking.

Bug: 1084154
Change-Id: I9b66ee94364403fa977bdb3b14c29d748114a555
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2372814Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Daniel Classon <dclasson@google.com>
Cr-Commit-Position: refs/heads/master@{#801195}
parent ecf5d675
......@@ -694,13 +694,18 @@ cr.define('device_page_tests', function() {
});
});
test(assert(TestNames.Keyboard), async () => {
suite(assert(TestNames.Keyboard), function() {
const name = k => `prefs.settings.language.${k}.value`;
const get = k => devicePage.get(name(k));
const set = (k, v) => devicePage.set(name(k), v);
// Open the keyboard subpage.
const keyboardPage =
let keyboardPage;
setup(async () => {
keyboardPage =
await showAndGetDeviceSubpage('keyboard', settings.routes.KEYBOARD);
});
test('keyboard', async () => {
// Initially, the optional keys are hidden.
expectFalse(!!keyboardPage.$$('#capsLockKey'));
......@@ -813,8 +818,10 @@ cr.define('device_page_tests', function() {
settings.DevicePageBrowserProxyImpl.getInstance()
.keyboardShortcutViewerShown_);
});
});
test(assert(TestNames.Display), function() {
suite(assert(TestNames.Display), function() {
test('display tests', function() {
let displayPage;
const browserProxy = settings.DevicePageBrowserProxyImpl.getInstance();
return Promise
......@@ -990,8 +997,8 @@ cr.define('device_page_tests', function() {
]);
})
.then(function() {
// Confirm that there is now only one display and that it is primary
// and mirroring is enabled.
// Confirm that there is now only one display and that it is
// primary and mirroring is enabled.
expectEquals(1, displayPage.displays.length);
expectEquals(
displayPage.displays[0].id, displayPage.selectedDisplay.id);
......@@ -1032,7 +1039,9 @@ cr.define('device_page_tests', function() {
browserProxy.lastHighlightedDisplayId_);
// Navigate back to the display page.
return showAndGetDeviceSubpage('display', settings.routes.DISPLAY);
return showAndGetDeviceSubpage(
'display', settings.routes.DISPLAY);
});
});
});
......
......@@ -502,7 +502,7 @@ TEST_F('OSSettingsAppManagementReducersTest', 'AllJsTests', () => {
mocha.run();
});
// Tests for the Device page.
// Tests for the Bluetooth page.
// eslint-disable-next-line no-var
var OSSettingsBluetoothPageTest = class extends OSSettingsBrowserTest {
/** @override */
......
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