2011-02-17 Ilya Tikhonovsky <loislo@chromium.org>
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Feb 2011 16:13:44 +0000 (16:13 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Feb 2011 16:13:44 +0000 (16:13 +0000)
        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

LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/elements-test.js
LayoutTests/inspector/elements/mutate-unknown-node-expected.txt
LayoutTests/inspector/elements/mutate-unknown-node.html

index 899ac86d55c8be0b8c3649d23d25a7faa0e36d54..8316e79660ad061fbf8d00e1e575790f2b3d732d 100644 (file)
@@ -1,3 +1,19 @@
+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
index e8383fda84d01d6666277ed5c8bd03f504a5d4ed..3e7f7c38e7ef973c8b8eaf23d2930f4e0ce8f3ce 100755 (executable)
@@ -193,14 +193,14 @@ InspectorTest.expandElementsTree = function(callback)
 
 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
index a2bb8b310b9839c889538cf8b8881137393597e4..24eccb5145ffb33a247674840af3014017e3d8af 100644 (file)
@@ -1,6 +1,10 @@
 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]
@@ -8,8 +12,5 @@ Tests that elements panel does not receive events upon changes to the undiscover
             P[5]
                 [6]
             DIV[7]
-DOMAgent event fired. Should only happen once for output node: DOMNodeInserted DIV#undefined
-Appended
-Removed
-Attribute modified
+            DIV[8]
 
index 8e2ea88422aba9fe5ebc106734386a63e8df6c34..e271b61128713c7fb16d8f20cfffb827b02c58ef 100644 (file)
@@ -36,9 +36,6 @@ function test()
     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()
@@ -56,6 +53,14 @@ function test()
     function step3()
     {
         InspectorTest.addResult("Attribute modified");
+        InspectorTest.evaluateInPage("true", step4);
+    }
+
+    function step4()
+    {
+        InspectorTest.addResult("========= Result DOMAgent tree ========");
+        InspectorTest.dumpDOMAgentTree();
+
         InspectorTest.completeTest();
     }
 }