Reviewed by Yury Semikhatsky.
Web Inspector: [Chromium] inspector/elements/mutate-unknown-node.html test is flaky.
https://bugs.webkit.org/show_bug.cgi?id=54635
It was a race condition. Sometimes Inspector was loaded before domContentLoaded event but sometimes not.
As result it receives second setDocument and got new ids for the DOM elements.
* http/tests/inspector/elements-test.js:
(initialize_ElementTest.InspectorTest.dumpDOMAgentTree):
(initialize_ElementTest):
* inspector/elements/mutate-unknown-node-expected.txt:
* inspector/elements/mutate-unknown-node.html:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@78831
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-02-17 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: [Chromium] inspector/elements/mutate-unknown-node.html test is flaky.
+ https://bugs.webkit.org/show_bug.cgi?id=54635
+
+ It was a race condition. Sometimes Inspector was loaded before domContentLoaded event but sometimes not.
+ As result it receives second setDocument and got new ids for the DOM elements.
+
+ * http/tests/inspector/elements-test.js:
+ (initialize_ElementTest.InspectorTest.dumpDOMAgentTree):
+ (initialize_ElementTest):
+ * inspector/elements/mutate-unknown-node-expected.txt:
+ * inspector/elements/mutate-unknown-node.html:
+
2011-02-17 Adam Roben <aroben@apple.com>
Skip a new spinbutton test on Windows
InspectorTest.dumpDOMAgentTree = function()
{
- function dump(node, prefix)
+ function dump(node, prefix, startIndex)
{
- InspectorTest.addResult(prefix + node.nodeName + "[" + node.id + "]");
+ InspectorTest.addResult(prefix + node.nodeName + "[" + (node.id - startIndex)+ "]");
var children = node.children;
for (var i = 0; children && i < children.length; ++i)
- dump(children[i], prefix + " ");
+ dump(children[i], prefix + " ", startIndex);
}
- dump(WebInspector.domAgent.document, "");
+ dump(WebInspector.domAgent.document, "", WebInspector.domAgent.document.id - 1);
};
};
\ No newline at end of file
Tests that elements panel does not receive events upon changes to the undiscovered nodes.
-========= Original ========
+Appended
+DOMAgent event fired. Should only happen once for output node: DOMNodeInserted DIV#undefined
+Removed
+Attribute modified
+========= Result DOMAgent tree ========
#document[1]
HTML[2]
HEAD[3]
P[5]
[6]
DIV[7]
-DOMAgent event fired. Should only happen once for output node: DOMNodeInserted DIV#undefined
-Appended
-Removed
-Attribute modified
+ DIV[8]
WebInspector.domAgent.document.addEventListener("DOMNodeInserted", listener.bind(this, "DOMNodeInserted"));
WebInspector.domAgent.document.addEventListener("DOMNodeRemoved", listener.bind(this, "DOMNodeRemoved"));
- InspectorTest.addResult("========= Original ========");
- InspectorTest.dumpDOMAgentTree();
-
InspectorTest.evaluateInPage("appendChild()", step1);
function step1()
function step3()
{
InspectorTest.addResult("Attribute modified");
+ InspectorTest.evaluateInPage("true", step4);
+ }
+
+ function step4()
+ {
+ InspectorTest.addResult("========= Result DOMAgent tree ========");
+ InspectorTest.dumpDOMAgentTree();
+
InspectorTest.completeTest();
}
}