Title: [254546] trunk/LayoutTests
Revision
254546
Author
[email protected]
Date
2020-01-14 17:11:13 -0800 (Tue, 14 Jan 2020)

Log Message

REGRESSION: fast/shadow-dom/link-element-in-shadow-tree.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=171784
<rdar://problem/58123584>

Reviewed by Antti Koivisto.

The timeout is likely caused by the stylesheet not loading within 100ms timeout in the very first test case.
Load and cache the stylesheet before any test cases run to avoid this timeout.

* fast/shadow-dom/link-element-in-shadow-tree.html:
* platform/mac-wk2/TestExpectations: Removed the flaky test expectation.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (254545 => 254546)


--- trunk/LayoutTests/ChangeLog	2020-01-15 01:08:32 UTC (rev 254545)
+++ trunk/LayoutTests/ChangeLog	2020-01-15 01:11:13 UTC (rev 254546)
@@ -1,3 +1,17 @@
+2020-01-14  Ryosuke Niwa  <[email protected]>
+
+        REGRESSION: fast/shadow-dom/link-element-in-shadow-tree.html is flaky
+        https://bugs.webkit.org/show_bug.cgi?id=171784
+        <rdar://problem/58123584>
+
+        Reviewed by Antti Koivisto.
+
+        The timeout is likely caused by the stylesheet not loading within 100ms timeout in the very first test case.
+        Load and cache the stylesheet before any test cases run to avoid this timeout.
+
+        * fast/shadow-dom/link-element-in-shadow-tree.html:
+        * platform/mac-wk2/TestExpectations: Removed the flaky test expectation.
+
 2020-01-14  Said Abou-Hallawa  <[email protected]>
 
         Supported mime types for encoding should be supported mime types for loading

Modified: trunk/LayoutTests/fast/shadow-dom/link-element-in-shadow-tree.html (254545 => 254546)


--- trunk/LayoutTests/fast/shadow-dom/link-element-in-shadow-tree.html	2020-01-15 01:08:32 UTC (rev 254545)
+++ trunk/LayoutTests/fast/shadow-dom/link-element-in-shadow-tree.html	2020-01-15 01:11:13 UTC (rev 254546)
@@ -21,12 +21,29 @@
 }
 
 let test_iframe;
-function create_iframe() {
+let stylesheet_ready = null;
+async function create_iframe() {
+    if (!stylesheet_ready) { // Cache the stylesheet first to avoid timeout in the very first test case.
+        stylesheet_ready = new Promise((resolve) => {
+            const link = document.createElement('link');
+            link.rel = 'stylesheet';
+            link.href = '';
+            link.addEventListener('load', () => {
+                link.remove();
+                resolve();
+            });
+            document.body.appendChild(link);
+        });
+    }
+    await create_iframe;
+
     if (test_iframe)
         test_iframe.remove();
 
     test_iframe = document.createElement('iframe');
-    return wait_for_onload().then(() => test_iframe.contentWindow, () => {
+    return stylesheet_ready.then(() => {
+        return wait_for_onload();
+    }).then(() => test_iframe.contentWindow, () => {
         document.body.appendChild(test_iframe);
     }).then(function () {
         const doc = test_iframe.contentWindow.document;

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (254545 => 254546)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2020-01-15 01:08:32 UTC (rev 254545)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2020-01-15 01:11:13 UTC (rev 254546)
@@ -926,6 +926,4 @@
 
 webkit.org/b/205301 [ Mojave+ ] inspector/canvas/requestShaderSource-webgpu.html [ Pass Failure ]
 
-webkit.org/b/171784 fast/shadow-dom/link-element-in-shadow-tree.html [ Pass Failure ]
-
 webkit.org/b/205808 fast/text/international/unicode-bidi-other-neutrals.html [ Pass Failure ]
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to