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

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

Issue 2248083004: Settings: Fix Clear Browsing Data dialog scrolling to Privacy page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 4 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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('route', function() { 5 suite('route', function() {
6 test('tree structure', function() { 6 test('tree structure', function() {
7 // Set up root page routes. 7 // Set up root page routes.
8 var BASIC = new settings.Route('/'); 8 var BASIC = new settings.Route('/');
9 var ADVANCED = new settings.Route('/advanced'); 9 var ADVANCED = new settings.Route('/advanced');
10 assertFalse(ADVANCED.isSubpage()); 10 assertFalse(ADVANCED.isSubpage());
(...skipping 17 matching lines...) Expand all
28 assertEquals('privacy', SITE_SETTINGS.section); 28 assertEquals('privacy', SITE_SETTINGS.section);
29 assertFalse(BASIC.contains(SITE_SETTINGS)); 29 assertFalse(BASIC.contains(SITE_SETTINGS));
30 assertTrue(ADVANCED.contains(SITE_SETTINGS)); 30 assertTrue(ADVANCED.contains(SITE_SETTINGS));
31 assertTrue(PRIVACY.contains(SITE_SETTINGS)); 31 assertTrue(PRIVACY.contains(SITE_SETTINGS));
32 32
33 // Test a sub-subpage route. 33 // Test a sub-subpage route.
34 var SITE_SETTINGS_ALL = SITE_SETTINGS.createChild('all'); 34 var SITE_SETTINGS_ALL = SITE_SETTINGS.createChild('all');
35 assertEquals('/siteSettings/all', SITE_SETTINGS_ALL.path); 35 assertEquals('/siteSettings/all', SITE_SETTINGS_ALL.path);
36 assertEquals(SITE_SETTINGS, SITE_SETTINGS_ALL.parent); 36 assertEquals(SITE_SETTINGS, SITE_SETTINGS_ALL.parent);
37 assertTrue(SITE_SETTINGS_ALL.isSubpage()); 37 assertTrue(SITE_SETTINGS_ALL.isSubpage());
38
39 // Test a non-subpage child of ADVANCED.
40 var CLEAR_BROWSER_DATA = ADVANCED.createChild('/clearBrowserData');
41 assertFalse(CLEAR_BROWSER_DATA.isSubpage());
42 assertEquals('', CLEAR_BROWSER_DATA.section);
38 }); 43 });
39 44
40 test('no duplicate routes', function() { 45 test('no duplicate routes', function() {
41 var paths = new Set(); 46 var paths = new Set();
42 Object.values(settings.Route).forEach(function(route) { 47 Object.values(settings.Route).forEach(function(route) {
43 assertFalse(paths.has(route.path), route.path); 48 assertFalse(paths.has(route.path), route.path);
44 paths.add(route.path); 49 paths.add(route.path);
45 }); 50 });
46 }); 51 });
47 }); 52 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698