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

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

Issue 2224163002: Settings Router Refactor: Replace route.subpage usage with route.path (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/test/data/webui/settings/route_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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 /** @fileoverview Prototype for Settings page tests. */ 5 /** @fileoverview Prototype for Settings page tests. */
6 6
7 /** @const {string} Path to root from chrome/test/data/webui/settings/. */ 7 /** @const {string} Path to root from chrome/test/data/webui/settings/. */
8 var ROOT_PATH = '../../../../../'; 8 var ROOT_PATH = '../../../../../';
9 9
10 // Polymer BrowserTest fixture. 10 // Polymer BrowserTest fixture.
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 if (!pages) 85 if (!pages)
86 return; 86 return;
87 87
88 var children = pages.getContentChildren(); 88 var children = pages.getContentChildren();
89 var stampedChildren = children.filter(function(element) { 89 var stampedChildren = children.filter(function(element) {
90 return element.tagName != 'TEMPLATE'; 90 return element.tagName != 'TEMPLATE';
91 }); 91 });
92 92
93 // The section's main child should be stamped and visible. 93 // The section's main child should be stamped and visible.
94 var main = stampedChildren.filter(function(element) { 94 var main = stampedChildren.filter(function(element) {
95 return element.id == 'main'; 95 return element.getAttribute('route-path') == 'default';
96 }); 96 });
97 assertEquals(main.length, 1, '#main not found for section ' + 97 assertEquals(main.length, 1, 'default card not found for section ' +
98 section.section); 98 section.section);
99 assertGT(main[0].offsetHeight, 0); 99 assertGT(main[0].offsetHeight, 0);
100 100
101 // Any other stamped subpages should not be visible. 101 // Any other stamped subpages should not be visible.
102 var subpages = stampedChildren.filter(function(element) { 102 var subpages = stampedChildren.filter(function(element) {
103 return element.id != 'main'; 103 return element.getAttribute('route-path') != 'default';
104 }); 104 });
105 for (var subpage of subpages) { 105 for (var subpage of subpages) {
106 assertEquals(subpage.offsetHeight, 0, 'Expected subpage #' + subpage.id + 106 assertEquals(subpage.offsetHeight, 0, 'Expected subpage #' + subpage.id +
107 ' in ' + section.section + ' not to be visible.'); 107 ' in ' + section.section + ' not to be visible.');
108 } 108 }
109 }, 109 },
110 }; 110 };
OLDNEW
« no previous file with comments | « chrome/test/data/webui/settings/route_tests.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698