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

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: merge 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
« no previous file with comments | « chrome/browser/resources/settings/settings_page/settings_subpage.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 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 assertEquals(0, BASIC.depth); 9 assertEquals(0, BASIC.depth);
10 10
(...skipping 22 matching lines...) Expand all
33 assertFalse(BASIC.contains(SITE_SETTINGS)); 33 assertFalse(BASIC.contains(SITE_SETTINGS));
34 assertTrue(ADVANCED.contains(SITE_SETTINGS)); 34 assertTrue(ADVANCED.contains(SITE_SETTINGS));
35 assertTrue(PRIVACY.contains(SITE_SETTINGS)); 35 assertTrue(PRIVACY.contains(SITE_SETTINGS));
36 36
37 // Test a sub-subpage route. 37 // Test a sub-subpage route.
38 var SITE_SETTINGS_ALL = SITE_SETTINGS.createChild('all'); 38 var SITE_SETTINGS_ALL = SITE_SETTINGS.createChild('all');
39 assertEquals('/siteSettings/all', SITE_SETTINGS_ALL.path); 39 assertEquals('/siteSettings/all', SITE_SETTINGS_ALL.path);
40 assertEquals(SITE_SETTINGS, SITE_SETTINGS_ALL.parent); 40 assertEquals(SITE_SETTINGS, SITE_SETTINGS_ALL.parent);
41 assertEquals(3, SITE_SETTINGS_ALL.depth); 41 assertEquals(3, SITE_SETTINGS_ALL.depth);
42 assertTrue(SITE_SETTINGS_ALL.isSubpage()); 42 assertTrue(SITE_SETTINGS_ALL.isSubpage());
43
44 // Test a non-subpage child of ADVANCED.
45 var CLEAR_BROWSER_DATA = ADVANCED.createChild('/clearBrowserData');
46 assertFalse(CLEAR_BROWSER_DATA.isSubpage());
47 assertEquals('', CLEAR_BROWSER_DATA.section);
43 }); 48 });
44 49
45 test('no duplicate routes', function() { 50 test('no duplicate routes', function() {
46 var paths = new Set(); 51 var paths = new Set();
47 Object.values(settings.Route).forEach(function(route) { 52 Object.values(settings.Route).forEach(function(route) {
48 assertFalse(paths.has(route.path), route.path); 53 assertFalse(paths.has(route.path), route.path);
49 paths.add(route.path); 54 paths.add(route.path);
50 }); 55 });
51 }); 56 });
52 }); 57 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/settings_page/settings_subpage.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698