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

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

Issue 2660383002: [MD settings] idle load basic and advanced pages (Closed)
Patch Set: review changes Created 3 years, 10 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 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 * @return {!PolymerElement} The PolymerElement for the page. 55 * @return {!PolymerElement} The PolymerElement for the page.
56 */ 56 */
57 getPage: function(type) { 57 getPage: function(type) {
58 var settingsUi = document.querySelector('settings-ui'); 58 var settingsUi = document.querySelector('settings-ui');
59 assertTrue(!!settingsUi); 59 assertTrue(!!settingsUi);
60 var settingsMain = settingsUi.$$('settings-main'); 60 var settingsMain = settingsUi.$$('settings-main');
61 assertTrue(!!settingsMain); 61 assertTrue(!!settingsMain);
62 var pageType = 'settings-' + type + '-page'; 62 var pageType = 'settings-' + type + '-page';
63 var page = settingsMain.$$(pageType); 63 var page = settingsMain.$$(pageType);
64 assertTrue(!!page); 64 assertTrue(!!page);
65 var idleRender = page.$$('[is=settings-idle-render]')
dpapad 2017/01/31 23:10:13 Can we be more specific in the selector, as follow
dschuyler 2017/01/31 23:53:03 Done.
66 if (idleRender) {
67 idleRender.get();
68 Polymer.dom.flush();
69 }
65 return page; 70 return page;
66 }, 71 },
67 72
68 /** 73 /**
69 * @param {!PolymerElement} page The PolymerElement for the page containing 74 * @param {!PolymerElement} page The PolymerElement for the page containing
70 * |section|. 75 * |section|.
71 * @param {string} section The settings page section, e.g. 'appearance'. 76 * @param {string} section The settings page section, e.g. 'appearance'.
72 * @return {Node|undefined} The DOM node for the section. 77 * @return {Node|undefined} The DOM node for the section.
73 */ 78 */
74 getSection: function(page, section) { 79 getSection: function(page, section) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 // Any other stamped subpages should not be visible. 114 // Any other stamped subpages should not be visible.
110 var subpages = stampedChildren.filter(function(element) { 115 var subpages = stampedChildren.filter(function(element) {
111 return element.getAttribute('route-path') != 'default'; 116 return element.getAttribute('route-path') != 'default';
112 }); 117 });
113 for (var subpage of subpages) { 118 for (var subpage of subpages) {
114 assertEquals(subpage.offsetHeight, 0, 'Expected subpage #' + subpage.id + 119 assertEquals(subpage.offsetHeight, 0, 'Expected subpage #' + subpage.id +
115 ' in ' + section.section + ' not to be visible.'); 120 ' in ' + section.section + ' not to be visible.');
116 } 121 }
117 }, 122 },
118 }; 123 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698