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

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

Issue 2170583002: MD Settings: fix route query in tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 var router = document.querySelector('cr-settings').$$('settings-ui') 79 var router = document.querySelector('cr-settings').$$('settings-ui')
80 .$$('settings-router'); 80 .$$('settings-router');
81 assert(!!router); 81 assert(!!router);
82 return router; 82 return router;
83 }, 83 },
84 84
85 /** 85 /**
86 * @return {boolean} True if the router's state is a root page, e.g. Basic. 86 * @return {boolean} True if the router's state is a root page, e.g. Basic.
87 */ 87 */
88 isAtRoot: function() { 88 isAtRoot: function() {
89 var router = this.getRouter(); 89 var route = this.getRouter().currentRoute;
90 return router.section == '' && router.subpage.length == 0; 90 return route.section == '' && route.subpage.length == 0;
tommycli 2016/07/20 21:33:02 Also perhaps it would be even clearer to check ro
91 }, 91 },
92 92
93 /** Navigates to the current root page, e.g. Basic. */ 93 /** Navigates to the current root page, e.g. Basic. */
94 backToRoot: function() { 94 backToRoot: function() {
95 var router = document.querySelector('cr-settings').$$('settings-ui') 95 var router = document.querySelector('cr-settings').$$('settings-ui')
96 .$$('settings-router'); 96 .$$('settings-router');
97 router.currentRoute = { 97 router.currentRoute = {
98 page: router.currentRoute.page, 98 page: router.currentRoute.page,
99 section: '', 99 section: '',
100 subpage: [], 100 subpage: [],
(...skipping 27 matching lines...) Expand all
128 // Any other stamped subpages should not be visible. 128 // Any other stamped subpages should not be visible.
129 var subpages = stampedChildren.filter(function(element) { 129 var subpages = stampedChildren.filter(function(element) {
130 return element.id != 'main'; 130 return element.id != 'main';
131 }); 131 });
132 for (var subpage of subpages) { 132 for (var subpage of subpages) {
133 assertEquals(subpage.offsetHeight, 0, 'Expected subpage #' + subpage.id + 133 assertEquals(subpage.offsetHeight, 0, 'Expected subpage #' + subpage.id +
134 ' in ' + section.section + ' not to be visible.'); 134 ' in ' + section.section + ' not to be visible.');
135 } 135 }
136 }, 136 },
137 }; 137 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698