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

Unified Diff: chrome/test/data/webui/polymer_browser_test_base.js

Issue 2829383002: PolymerTest.clearBody: don't remove vulcanized styles (Closed)
Patch Set: comment Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/polymer_browser_test_base.js
diff --git a/chrome/test/data/webui/polymer_browser_test_base.js b/chrome/test/data/webui/polymer_browser_test_base.js
index b63110cd36f562c154c2028349724d90f5e5038f..4165afc4b42fb28c96a80d1cfcc5d7da415ab637 100644
--- a/chrome/test/data/webui/polymer_browser_test_base.js
+++ b/chrome/test/data/webui/polymer_browser_test_base.js
@@ -188,10 +188,15 @@ PolymerTest.loadScript = function(src) {
};
/**
- * Removes all content from the body.
+ * Removes all content from the body. In a vulcanized build, this retains the
+ * inlined tags so stylesheets and dom-modules are not discarded.
*/
PolymerTest.clearBody = function() {
+ // Save the div where vulcanize inlines content before clearing the page.
+ var vulcanizeDiv = document.querySelector('body > div[hidden][by-vulcanize]');
document.body.innerHTML = '';
+ if (vulcanizeDiv)
+ document.body.appendChild(vulcanizeDiv);
};
/**
« 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