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

Unified Diff: chrome/test/data/webui/md_bookmarks/test_util.js

Issue 2603303002: [MD Bookmarks] Add UI for Material Bookmarks. (Closed)
Patch Set: Created 3 years, 12 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
Index: chrome/test/data/webui/md_bookmarks/test_util.js
diff --git a/chrome/test/data/webui/md_bookmarks/test_util.js b/chrome/test/data/webui/md_bookmarks/test_util.js
index 84c1a6bb185c370fa4494ea8f59f2e62df472543..d5e5c473257f91748344ed782abb665379c6a01f 100644
--- a/chrome/test/data/webui/md_bookmarks/test_util.js
+++ b/chrome/test/data/webui/md_bookmarks/test_util.js
@@ -3,10 +3,13 @@
// found in the LICENSE file.
/**
- * Replace the current body of the test with a new element.
+ * Replace the current primary element of the test with a new element. Useful
tsergeant 2017/01/03 23:31:17 As above, undo all changes to this file.
jiaxi 2017/01/04 02:50:16 Done.
+ * as an alternative to PolymerTest.clearBody() which preserves styling.
* @param {Element} element
*/
function replaceBody(element) {
- PolymerTest.clearBody();
- document.body.appendChild(element);
+ var body = document.body;
+ while (body.children.length > 0)
+ body.removeChild(body.children[0]);
+ body.appendChild(element);
}

Powered by Google App Engine
This is Rietveld 408576698