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

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

Issue 2817903004: MD Settings: Focus cookies search field when exiting cookie details subpage. (Closed)
Patch Set: Simulate pop state in test. 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/browser/resources/settings/site_settings_page/site_settings_page.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
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 suite('settings-animated-pages', function() { 5 suite('settings-animated-pages', function() {
6 test('focuses subpage trigger when exiting subpage', function(done) { 6 test('focuses subpage trigger when exiting subpage', function(done) {
7 document.body.innerHTML = ` 7 document.body.innerHTML = `
8 <settings-animated-pages section="test-section"> 8 <settings-animated-pages
9 section="${settings.Route.SEARCH_ENGINES.section}">
9 <neon-animatable route-path="default"> 10 <neon-animatable route-path="default">
10 <button id="subpage-trigger"></button> 11 <button id="subpage-trigger"></button>
11 </neon-animatable> 12 </neon-animatable>
12 <neon-animatable route-path="${settings.Route.SEARCH_ENGINES.path}"> 13 <neon-animatable route-path="${settings.Route.SEARCH_ENGINES.path}">
13 <button id="subpage-trigger"></button> 14 <button id="subpage-trigger"></button>
14 </neon-animatable> 15 </neon-animatable>
15 </settings-animated-pages>`; 16 </settings-animated-pages>`;
16 17
17 var animatedPages = document.body.querySelector('settings-animated-pages'); 18 var animatedPages = document.body.querySelector('settings-animated-pages');
18 animatedPages.focusConfig = new Map(); 19 animatedPages.focusConfig = new Map();
19 animatedPages.focusConfig.set( 20 animatedPages.focusConfig.set(
20 settings.Route.SEARCH_ENGINES.path, '#subpage-trigger'); 21 settings.Route.SEARCH_ENGINES.path, '#subpage-trigger');
21 22
22 animatedPages.$.animatedPages.selected = settings.Route.SEARCH_ENGINES.path;
23
24 var trigger = document.body.querySelector('#subpage-trigger'); 23 var trigger = document.body.querySelector('#subpage-trigger');
25 assertTrue(!!trigger); 24 assertTrue(!!trigger);
26 trigger.addEventListener('focus', function() { done(); }); 25 trigger.addEventListener('focus', function() { done(); });
27 26
28 // Trigger subpage exit. 27 // Trigger subpage exit navigation.
29 animatedPages.currentRouteChanged( 28 settings.navigateTo(settings.Route.BASIC);
dpapad 2017/04/13 21:56:16 Updated test to simulate the "pop" state, now that
30 settings.Route.BASIC, settings.Route.SEARCH_ENGINES); 29 settings.navigateTo(settings.Route.SEARCH_ENGINES);
30 settings.navigateToPreviousRoute();
31 }); 31 });
32 }); 32 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/site_settings_page/site_settings_page.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698