Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: chrome/test/data/webui/settings/settings_animated_pages_test.js

Issue 2805363002: MD Settings: Add mechanism to restore focus after subpage exiting. (Closed)
Patch Set: Address @dbeam comments. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/test/data/webui/settings/cr_settings_interactive_ui_tests.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 suite('settings-animated-pages', function() {
6 test('focuses subpage trigger when exiting subpage', function(done) {
7 document.body.innerHTML = `
8 <settings-animated-pages section="test-section">
9 <neon-animatable route-path="default">
10 <button id="subpage-trigger"></button>
11 </neon-animatable>
12 <neon-animatable route-path="${settings.Route.SEARCH_ENGINES.path}">
13 <button id="subpage-trigger"></button>
14 </neon-animatable>
15 </settings-animated-pages>`;
16
17 var animatedPages = document.body.querySelector('settings-animated-pages');
18 animatedPages.focusConfig = new Map();
19 animatedPages.focusConfig.set(
20 settings.Route.SEARCH_ENGINES.path, '#subpage-trigger');
21
22 animatedPages.$.animatedPages.selected = settings.Route.SEARCH_ENGINES.path;
23
24 var trigger = document.body.querySelector('#subpage-trigger');
25 assertTrue(!!trigger);
26 trigger.addEventListener('focus', function() { done(); });
27
28 // Trigger subpage exit.
29 animatedPages.currentRouteChanged(
30 settings.Route.BASIC, settings.Route.SEARCH_ENGINES);
31 });
32 });
OLDNEW
« no previous file with comments | « chrome/test/data/webui/settings/cr_settings_interactive_ui_tests.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698