Title: [94648] trunk/LayoutTests
Revision
94648
Author
[email protected]
Date
2011-09-07 00:55:30 -0700 (Wed, 07 Sep 2011)

Log Message

fast/dom/replaceChild.html may not test what it's supposed to test and may sometimes be flaky
https://bugs.webkit.org/show_bug.cgi?id=67629

Patch by Xianzhu Wang <[email protected]> on 2011-09-07
Reviewed by Darin Adler.

The test is supposed to test Node.replaceChild() called from a frame.
However, in most cases, it's not executed because the test finishes before
the iframe's onload event handler. For now, the expected result is just
the original render tree before replaceChild(). In chance that iframe's
onload is executed earlier, the actual result might be different from
expected (that is, replaceChild() is executed and the DOM is actually changed.)

Use waitUntilDone() and notifyDone() to ensure the frame's onload handler
is called.

BTW changed it to a pure text test to avoid platform branches.

* fast/dom/replaceChild.html:
* fast/dom/replaceChild-expected.txt: Added.
* fast/dom/resources/replaceChildHelper.html:
* platform/chromium-linux/fast/dom/replaceChild-expected.png: Removed.
* platform/chromium-mac/fast/dom/replaceChild-expected.png: Removed.
* platform/chromium-win/fast/dom/replaceChild-expected.png: Removed.
* platform/chromium-win/fast/dom/replaceChild-expected.txt: Removed.
* platform/gtk/fast/dom/replaceChild-expected.png: Removed.
* platform/gtk/fast/dom/replaceChild-expected.txt: Removed.
* platform/mac-leopard/fast/dom/replaceChild-expected.png: Removed.
* platform/mac/fast/dom/replaceChild-expected.png: Removed.
* platform/mac/fast/dom/replaceChild-expected.txt: Removed.
* platform/qt/fast/dom/replaceChild-expected.png: Removed.
* platform/qt/fast/dom/replaceChild-expected.txt: Removed.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (94647 => 94648)


--- trunk/LayoutTests/ChangeLog	2011-09-07 07:50:23 UTC (rev 94647)
+++ trunk/LayoutTests/ChangeLog	2011-09-07 07:55:30 UTC (rev 94648)
@@ -1,3 +1,37 @@
+2011-09-07  Xianzhu Wang  <[email protected]>
+
+        fast/dom/replaceChild.html may not test what it's supposed to test and may sometimes be flaky
+        https://bugs.webkit.org/show_bug.cgi?id=67629
+
+        Reviewed by Darin Adler.
+
+        The test is supposed to test Node.replaceChild() called from a frame.
+        However, in most cases, it's not executed because the test finishes before
+        the iframe's onload event handler. For now, the expected result is just
+        the original render tree before replaceChild(). In chance that iframe's
+        onload is executed earlier, the actual result might be different from
+        expected (that is, replaceChild() is executed and the DOM is actually changed.)
+
+        Use waitUntilDone() and notifyDone() to ensure the frame's onload handler
+        is called.
+
+        BTW changed it to a pure text test to avoid platform branches.
+
+        * fast/dom/replaceChild.html:
+        * fast/dom/replaceChild-expected.txt: Added.
+        * fast/dom/resources/replaceChildHelper.html:
+        * platform/chromium-linux/fast/dom/replaceChild-expected.png: Removed.
+        * platform/chromium-mac/fast/dom/replaceChild-expected.png: Removed.
+        * platform/chromium-win/fast/dom/replaceChild-expected.png: Removed.
+        * platform/chromium-win/fast/dom/replaceChild-expected.txt: Removed.
+        * platform/gtk/fast/dom/replaceChild-expected.png: Removed.
+        * platform/gtk/fast/dom/replaceChild-expected.txt: Removed.
+        * platform/mac-leopard/fast/dom/replaceChild-expected.png: Removed.
+        * platform/mac/fast/dom/replaceChild-expected.png: Removed.
+        * platform/mac/fast/dom/replaceChild-expected.txt: Removed.
+        * platform/qt/fast/dom/replaceChild-expected.png: Removed.
+        * platform/qt/fast/dom/replaceChild-expected.txt: Removed.
+
 2011-09-07  Csaba Osztrogonác  <[email protected]>
 
         [Qt] Unreviewed gardening. Add platform specific expected results for new passing tests.

Added: trunk/LayoutTests/fast/dom/replaceChild-expected.txt (0 => 94648)


--- trunk/LayoutTests/fast/dom/replaceChild-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/replaceChild-expected.txt	2011-09-07 07:55:30 UTC (rev 94648)
@@ -0,0 +1,3 @@
+test 1
+test 2
+PASS

Modified: trunk/LayoutTests/fast/dom/replaceChild.html (94647 => 94648)


--- trunk/LayoutTests/fast/dom/replaceChild.html	2011-09-07 07:50:23 UTC (rev 94647)
+++ trunk/LayoutTests/fast/dom/replaceChild.html	2011-09-07 07:55:30 UTC (rev 94648)
@@ -16,15 +16,21 @@
 	}
 </style>
 <script language="_javascript_" type="text/_javascript_">
+	if (window.layoutTestController) {
+		layoutTestController.waitUntilDone();
+		layoutTestController.dumpAsText();
+	}
 	function loadMenu(m){
 		var w = document.getElementById("menu_content_area");
 		w.replaceChild(m, document.getElementById("menu_import"));
+		document.body.appendChild(document.createTextNode("PASS"));
+		if (window.layoutTestController)
+			layoutTestController.notifyDone();
 	}
 </script>
 </head>
 
 <body>
-
 	<div id="menu_content_area"><iframe src="" id="menu_import" name="menu_import" ></iframe></div>
 
 </body>

Modified: trunk/LayoutTests/fast/dom/resources/replaceChildHelper.html (94647 => 94648)


--- trunk/LayoutTests/fast/dom/resources/replaceChildHelper.html	2011-09-07 07:50:23 UTC (rev 94647)
+++ trunk/LayoutTests/fast/dom/resources/replaceChildHelper.html	2011-09-07 07:55:30 UTC (rev 94648)
@@ -13,11 +13,12 @@
 	window._onload_ = doLoad;
 </script>
 </head>
+<body>
 	<div id="menu">
 		<div>test 1</div>
 		<div>test 2</div>
 	</div>
-<body>
+	FAIL (This test may fail in a real browser due to security restrictions)
 </body>
 </html>
 

Deleted: trunk/LayoutTests/platform/chromium-linux/fast/dom/replaceChild-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/platform/chromium-mac/fast/dom/replaceChild-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/platform/chromium-win/fast/dom/replaceChild-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/platform/chromium-win/fast/dom/replaceChild-expected.txt (94647 => 94648)


--- trunk/LayoutTests/platform/chromium-win/fast/dom/replaceChild-expected.txt	2011-09-07 07:50:23 UTC (rev 94647)
+++ trunk/LayoutTests/platform/chromium-win/fast/dom/replaceChild-expected.txt	2011-09-07 07:55:30 UTC (rev 94648)
@@ -1,19 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x152
-  RenderBlock {HTML} at (0,0) size 800x152
-    RenderBody {BODY} at (0,0) size 800x152 [bgcolor=#CCFFCC]
-      RenderBlock {DIV} at (0,0) size 800x152
-        RenderPartObject {IFRAME} at (0,0) size 152x152 [border: (1px solid #000000)]
-          layer at (0,0) size 150x150
-            RenderView at (0,0) size 150x150
-          layer at (0,0) size 150x56
-            RenderBlock {HTML} at (0,0) size 150x56
-              RenderBody {BODY} at (8,8) size 134x40
-                RenderBlock {DIV} at (0,0) size 134x40
-                  RenderBlock {DIV} at (0,0) size 134x20
-                    RenderText {#text} at (0,0) size 33x19
-                      text run at (0,0) width 33: "test 1"
-                  RenderBlock {DIV} at (0,20) size 134x20
-                    RenderText {#text} at (0,0) size 33x19
-                      text run at (0,0) width 33: "test 2"

Deleted: trunk/LayoutTests/platform/gtk/fast/dom/replaceChild-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/platform/gtk/fast/dom/replaceChild-expected.txt (94647 => 94648)


--- trunk/LayoutTests/platform/gtk/fast/dom/replaceChild-expected.txt	2011-09-07 07:50:23 UTC (rev 94647)
+++ trunk/LayoutTests/platform/gtk/fast/dom/replaceChild-expected.txt	2011-09-07 07:55:30 UTC (rev 94648)
@@ -1,19 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x152
-  RenderBlock {HTML} at (0,0) size 800x152
-    RenderBody {BODY} at (0,0) size 800x152 [bgcolor=#CCFFCC]
-      RenderBlock {DIV} at (0,0) size 800x152
-        RenderPartObject {IFRAME} at (0,0) size 152x152 [border: (1px solid #000000)]
-          layer at (0,0) size 150x150
-            RenderView at (0,0) size 150x150
-          layer at (0,0) size 150x54
-            RenderBlock {HTML} at (0,0) size 150x54
-              RenderBody {BODY} at (8,8) size 134x38
-                RenderBlock {DIV} at (0,0) size 134x38
-                  RenderBlock {DIV} at (0,0) size 134x19
-                    RenderText {#text} at (0,0) size 33x19
-                      text run at (0,0) width 33: "test 1"
-                  RenderBlock {DIV} at (0,19) size 134x19
-                    RenderText {#text} at (0,0) size 33x19
-                      text run at (0,0) width 33: "test 2"

Deleted: trunk/LayoutTests/platform/mac/fast/dom/replaceChild-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/platform/mac/fast/dom/replaceChild-expected.txt (94647 => 94648)


--- trunk/LayoutTests/platform/mac/fast/dom/replaceChild-expected.txt	2011-09-07 07:50:23 UTC (rev 94647)
+++ trunk/LayoutTests/platform/mac/fast/dom/replaceChild-expected.txt	2011-09-07 07:55:30 UTC (rev 94648)
@@ -1,19 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x152
-  RenderBlock {HTML} at (0,0) size 800x152
-    RenderBody {BODY} at (0,0) size 800x152 [bgcolor=#CCFFCC]
-      RenderBlock {DIV} at (0,0) size 800x152
-        RenderPartObject {IFRAME} at (0,0) size 152x152 [border: (1px solid #000000)]
-          layer at (0,0) size 150x150
-            RenderView at (0,0) size 150x150
-          layer at (0,0) size 150x52
-            RenderBlock {HTML} at (0,0) size 150x52
-              RenderBody {BODY} at (8,8) size 134x36
-                RenderBlock {DIV} at (0,0) size 134x36
-                  RenderBlock {DIV} at (0,0) size 134x18
-                    RenderText {#text} at (0,0) size 33x18
-                      text run at (0,0) width 33: "test 1"
-                  RenderBlock {DIV} at (0,18) size 134x18
-                    RenderText {#text} at (0,0) size 33x18
-                      text run at (0,0) width 33: "test 2"

Deleted: trunk/LayoutTests/platform/mac-leopard/fast/dom/replaceChild-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/platform/qt/fast/dom/replaceChild-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/platform/qt/fast/dom/replaceChild-expected.txt (94647 => 94648)


--- trunk/LayoutTests/platform/qt/fast/dom/replaceChild-expected.txt	2011-09-07 07:50:23 UTC (rev 94647)
+++ trunk/LayoutTests/platform/qt/fast/dom/replaceChild-expected.txt	2011-09-07 07:55:30 UTC (rev 94648)
@@ -1,19 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x152
-  RenderBlock {HTML} at (0,0) size 800x152
-    RenderBody {BODY} at (0,0) size 800x152 [bgcolor=#CCFFCC]
-      RenderBlock {DIV} at (0,0) size 800x152
-        RenderPartObject {IFRAME} at (0,0) size 152x152 [border: (1px solid #000000)]
-          layer at (0,0) size 150x150
-            RenderView at (0,0) size 150x150
-          layer at (0,0) size 150x60
-            RenderBlock {HTML} at (0,0) size 150x60
-              RenderBody {BODY} at (8,8) size 134x44
-                RenderBlock {DIV} at (0,0) size 134x44
-                  RenderBlock {DIV} at (0,0) size 134x22
-                    RenderText {#text} at (0,0) size 35x22
-                      text run at (0,0) width 35: "test 1"
-                  RenderBlock {DIV} at (0,22) size 134x22
-                    RenderText {#text} at (0,0) size 35x22
-                      text run at (0,0) width 35: "test 2"
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to