Title: [258423] trunk/LayoutTests
Revision
258423
Author
cdu...@apple.com
Date
2020-03-13 13:19:16 -0700 (Fri, 13 Mar 2020)

Log Message

[Mac wk2 ] fast/dom/attr_dead_doc.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=207668
<rdar://problem/59404606>

Reviewed by Geoffrey Garen.

The test was doing a navigation to about:blank and relying on a 100ms timer to update the src
attribute of the img element. We now remove the frame from the document instead since it
detaches the document synchronously. It gets rid of the 100ms timer and replaces it with a
0 timer which will reliably give the same output.

* fast/dom/attr_dead_doc-expected.txt:
* fast/dom/attr_dead_doc.html:
* platform/mac-wk2/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (258422 => 258423)


--- trunk/LayoutTests/ChangeLog	2020-03-13 20:07:20 UTC (rev 258422)
+++ trunk/LayoutTests/ChangeLog	2020-03-13 20:19:16 UTC (rev 258423)
@@ -1,3 +1,20 @@
+2020-03-13  Chris Dumez  <cdu...@apple.com>
+
+        [Mac wk2 ] fast/dom/attr_dead_doc.html is flaky failing.
+        https://bugs.webkit.org/show_bug.cgi?id=207668
+        <rdar://problem/59404606>
+
+        Reviewed by Geoffrey Garen.
+
+        The test was doing a navigation to about:blank and relying on a 100ms timer to update the src
+        attribute of the img element. We now remove the frame from the document instead since it
+        detaches the document synchronously. It gets rid of the 100ms timer and replaces it with a
+        0 timer which will reliably give the same output.
+
+        * fast/dom/attr_dead_doc-expected.txt:
+        * fast/dom/attr_dead_doc.html:
+        * platform/mac-wk2/TestExpectations:
+
 2020-03-13  Jason Lawrence  <lawrenc...@apple.com>
 
         [ Mac wk1 Debug] inspector/injected-script/avoid-getter-invocation.html is flaky failing.

Modified: trunk/LayoutTests/fast/dom/attr_dead_doc-expected.txt (258422 => 258423)


--- trunk/LayoutTests/fast/dom/attr_dead_doc-expected.txt	2020-03-13 20:07:20 UTC (rev 258422)
+++ trunk/LayoutTests/fast/dom/attr_dead_doc-expected.txt	2020-03-13 20:19:16 UTC (rev 258423)
@@ -1,12 +1,3 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderIFrame {IFRAME} at (0,0) size 304x154 [border: (2px inset #000000)]
-        layer at (0,0) size 300x150
-          RenderView at (0,0) size 300x150
-        layer at (0,0) size 300x150
-          RenderBlock {HTML} at (0,0) size 300x150
-            RenderBody {BODY} at (8,8) size 284x134
-      RenderText {#text} at (0,0) size 0x0
+Tests that setting the src attribute of an img element inside a detached document does not crash.
+
+

Modified: trunk/LayoutTests/fast/dom/attr_dead_doc.html (258422 => 258423)


--- trunk/LayoutTests/fast/dom/attr_dead_doc.html	2020-03-13 20:07:20 UTC (rev 258422)
+++ trunk/LayoutTests/fast/dom/attr_dead_doc.html	2020-03-13 20:19:16 UTC (rev 258423)
@@ -1,32 +1,27 @@
+<!DOCTYPE html>
 <html>
-<head>
+<body>
+<p>Tests that setting the src attribute of an img element inside a detached document does not crash.</p>
+<iframe id="testFrame" src=""
 <script>
-var im;
-function getImg() {
-    im =  document.getElementById("right").contentDocument.getElementById("img");
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
 }
-function setImg() {
-    im.src = ""
+
+_onload_ = () => {
+    image = testFrame.contentDocument.getElementById("img");
+    testFrame.remove();
+    setTimeout(() => {
+        image.src = ""
+        setTimeout(() => {
+            if (window.testRunner)
+                testRunner.notifyDone();
+        }, 0);
+    }, 0);
 }
 
-function init() {
-    if (window.testRunner) {
-        window.testRunner.waitUntilDone();
-    }
-    getImg();
-    document.getElementById("right").contentWindow.location.href = ""
-    if (window.testRunner) {
-        setTimeout("setImg(); window.testRunner.notifyDone();",100);
-    }
-    else {
-        setTimeout("setImg();",100);
-    }
-
-}
 </script>
-</head>
-<body _onload_=init()>
-<iframe id="right" src=""
 </body>
 </html>
 

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (258422 => 258423)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2020-03-13 20:07:20 UTC (rev 258422)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2020-03-13 20:19:16 UTC (rev 258423)
@@ -1015,8 +1015,6 @@
 
 webkit.org/b/207638 webgpu/whlsl/whlsl.html [ Pass ImageOnlyFailure ]
 
-webkit.org/b/207688 fast/dom/attr_dead_doc.html [ Pass Failure ]
-
 webkit.org/b/206852 inspector/canvas/updateShader-webgpu-sharedVertexFragment.html [ Pass Failure ]
 
 webkit.org/b/207700 webgpu/whlsl/return-local-variable.html [ Pass ImageOnlyFailure ]
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to