Chromium Code Reviews| 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); |
| } |