Index: javatests/org/chromium/distiller/DomDistillerJsTestCase.java |
diff --git a/javatests/org/chromium/distiller/DomDistillerJsTestCase.java b/javatests/org/chromium/distiller/DomDistillerJsTestCase.java |
index 43dab5b7df74a542bf2eb3f0c99680706c2226f7..e5d4bc02d1deb99a7425b3ba45cd6128d9a5837e 100644 |
--- a/javatests/org/chromium/distiller/DomDistillerJsTestCase.java |
+++ b/javatests/org/chromium/distiller/DomDistillerJsTestCase.java |
@@ -27,13 +27,19 @@ public class DomDistillerJsTestCase extends JsTestCase { |
protected void gwtSetUp() throws Exception { |
mRoot = Document.get().getDocumentElement(); |
JsArray<Node> attrs = DomUtil.getAttributes(mRoot); |
+ String[] attrNames = new String[attrs.length()]; |
for (int i = 0; i < attrs.length(); i++) { |
- mRoot.removeAttribute(attrs.get(i).getNodeName()); |
mdjones
2016/03/11 16:58:09
I'm assuming the problem here was they we were mod
wychen
2016/03/11 21:56:32
Exactly. attrs is not deeply copied, so it didn't
|
+ attrNames[i] = attrs.get(i).getNodeName(); |
} |
+ for (int i = 0; i < attrNames.length; i++) { |
+ mRoot.removeAttribute(attrNames[i]); |
+ } |
+ assertEquals(0, DomUtil.getAttributes(mRoot).length()); |
NodeList<Node> children = mRoot.getChildNodes(); |
for (int i = children.getLength() - 1; i >= 0; i--) { |
children.getItem(i).removeFromParent(); |
} |
+ assertEquals(0, mRoot.getChildNodes().getLength()); |
mHead = Document.get().createElement("head"); |
mRoot.appendChild(mHead); |
mBody = Document.get().createElement("body"); |