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

Side by Side Diff: chrome/test/data/webui/polymer_browser_test_base.js

Issue 2936333002: WebUI: Replace vulcanize with polymer-bundler (Closed)
Patch Set: Address comments. Created 3 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 | « chrome/browser/resources/vulcanize_gn.py ('k') | docs/optimizing_web_uis.md » ('j') | 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 /** 5 /**
6 * @fileoverview Framework for running JavaScript tests of Polymer elements. 6 * @fileoverview Framework for running JavaScript tests of Polymer elements.
7 */ 7 */
8 8
9 /** 9 /**
10 * Test fixture for Polymer element testing. 10 * Test fixture for Polymer element testing.
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 document.head.appendChild(script); 151 document.head.appendChild(script);
152 return promise; 152 return promise;
153 }; 153 };
154 154
155 /** 155 /**
156 * Removes all content from the body. In a vulcanized build, this retains the 156 * Removes all content from the body. In a vulcanized build, this retains the
157 * inlined tags so stylesheets and dom-modules are not discarded. 157 * inlined tags so stylesheets and dom-modules are not discarded.
158 */ 158 */
159 PolymerTest.clearBody = function() { 159 PolymerTest.clearBody = function() {
160 // Save the div where vulcanize inlines content before clearing the page. 160 // Save the div where vulcanize inlines content before clearing the page.
161 var vulcanizeDiv = document.querySelector('body > div[hidden][by-vulcanize]'); 161 var vulcanizeDiv = document.querySelector(
162 'body > div[hidden][by-polymer-bundler]');
162 document.body.innerHTML = ''; 163 document.body.innerHTML = '';
163 if (vulcanizeDiv) 164 if (vulcanizeDiv)
164 document.body.appendChild(vulcanizeDiv); 165 document.body.appendChild(vulcanizeDiv);
165 }; 166 };
166 167
167 /** 168 /**
168 * Helper function to return the list of extra libraries relative to basePath. 169 * Helper function to return the list of extra libraries relative to basePath.
169 */ 170 */
170 PolymerTest.getLibraries = function(basePath) { 171 PolymerTest.getLibraries = function(basePath) {
171 // Ensure basePath ends in '/'. 172 // Ensure basePath ends in '/'.
(...skipping 10 matching lines...) Expand all
182 * https://github.com/Polymer/web-component-tester/blob/master/browser/environme nt/helpers.js#L97 183 * https://github.com/Polymer/web-component-tester/blob/master/browser/environme nt/helpers.js#L97
183 */ 184 */
184 PolymerTest.flushTasks = function() { 185 PolymerTest.flushTasks = function() {
185 Polymer.dom.flush(); 186 Polymer.dom.flush();
186 // Promises have microtask timing, so we use setTimeout to explicity force a 187 // Promises have microtask timing, so we use setTimeout to explicity force a
187 // new task. 188 // new task.
188 return new Promise(function(resolve, reject) { 189 return new Promise(function(resolve, reject) {
189 window.setTimeout(resolve, 0); 190 window.setTimeout(resolve, 0);
190 }); 191 });
191 }; 192 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/vulcanize_gn.py ('k') | docs/optimizing_web_uis.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698