LayoutTest http/tests/inspector/network/fetch-network-data.html is a flaky timeout
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 May 2017 22:30:38 +0000 (22:30 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 May 2017 22:30:38 +0000 (22:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=166038
<rdar://problem/29488489>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-05-03
Reviewed by Matt Baker.

* platform/mac/TestExpectations:
* http/tests/inspector/network/fetch-network-data.html:
* http/tests/inspector/network/xhr-request-data-encoded-correctly.html:
Use singleFireEventListener instead of awaitEvent so that the follow-up event handlers
can be added synchronously instead of in a microtask. When the microtask happened later
than other incoming events then the follow-up handlers would have been added too late.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216150 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/network/fetch-network-data.html
LayoutTests/http/tests/inspector/network/xhr-request-data-encoded-correctly.html
LayoutTests/platform/mac/TestExpectations

index f21c160f4f0c6d84ec8e438139cad26281d88978..9949b7242b9d56b8c2ae1cc51734bc41f1abb2f9 100644 (file)
@@ -1,3 +1,18 @@
+2017-05-03  Joseph Pecoraro  <pecoraro@apple.com>
+
+        LayoutTest http/tests/inspector/network/fetch-network-data.html is a flaky timeout
+        https://bugs.webkit.org/show_bug.cgi?id=166038
+        <rdar://problem/29488489>
+
+        Reviewed by Matt Baker.
+
+        * platform/mac/TestExpectations:
+        * http/tests/inspector/network/fetch-network-data.html:
+        * http/tests/inspector/network/xhr-request-data-encoded-correctly.html:
+        Use singleFireEventListener instead of awaitEvent so that the follow-up event handlers
+        can be added synchronously instead of in a microtask. When the microtask happened later
+        than other incoming events then the follow-up handlers would have been added too late.
+
 2017-05-03  Matt Lewis  <jlewis3@apple.com>
 
         Mark imported/w3c/web-platform-tests/html/webappapis/timers/negative-settimeout.html as flaky.
index dcc6018b647927dd753430f4c3d48145ab92578b..f48b6d13ea04c69132780004511e3168b49f2f9b 100644 (file)
@@ -12,7 +12,7 @@ function test()
         suite.addTestCase({
             name, test(resolve, reject) {
                 InspectorTest.evaluateInPage(expression);
-                WebInspector.Frame.awaitEvent(WebInspector.Frame.Event.ResourceWasAdded).then((event) => {
+                WebInspector.Frame.singleFireEventListener(WebInspector.Frame.Event.ResourceWasAdded, (event) => {
                     let resource = event.data.resource;
                     InspectorTest.expectEqual(resource.type, WebInspector.Resource.Type.Fetch, "Resource should be Fetch type.");
                     if (loadedHandler) {
index d6fd1ada15f2b051e2cf5110ba7fcde2f71dcb7d..ec9108b6b67ab69bf144397fda7d8e7fef7d4460 100644 (file)
@@ -18,19 +18,18 @@ function test()
         name: "XHRWithRequestDataIsEncodedCorrectly",
         description: "XHR with request data is encoded correctly.",
         test(resolve, reject) {
-            WebInspector.Frame.awaitEvent(WebInspector.Frame.Event.ResourceWasAdded)
-            .then((event) => {
+            InspectorTest.evaluateInPage(`createXHRResource()`);
+            WebInspector.Frame.singleFireEventListener(WebInspector.Frame.Event.ResourceWasAdded, (event) => {
                 let resource = event.data.resource;
                 InspectorTest.expectThat(resource instanceof WebInspector.Resource, "Resource should be created.");
                 InspectorTest.expectThat(resource.requestData === "utf8=👍", "Request data should have expected content.");
-                return resource.awaitEvent(WebInspector.Resource.Event.LoadingDidFinish);
-            })
-            .then((event) => {
-                InspectorTest.pass("Resource load should finish.");
-            })
-            .then(resolve, reject);
-
-            InspectorTest.evaluateInPage("createXHRResource()");
+                resource.awaitEvent(WebInspector.Resource.Event.LoadingDidFinish)
+                    .then((event) => { InspectorTest.pass("Resource load should finish.") })
+                    .then(resolve, reject);
+                resource.awaitEvent(WebInspector.Resource.Event.LoadingDidFail)
+                    .then(() => { InspectorTest.fail("Resource should not have failed to load.") })
+                    .then(reject, reject);
+            });
         }
     });
 
@@ -39,6 +38,6 @@ function test()
 </script>
 </head>
 <body onload="runTest()">
-    <p>Tests XHR network resource payload is shown with correct encoding.</p>
+<p>Tests XHR network resource payload is shown with correct encoding.</p>
 </body>
-</html>
\ No newline at end of file
+</html>
index b547114ef9b21cd6b1869c91c95a6d05473d8e37..0dc964bb84c5486d91e0a93236981f84662ed3c7 100644 (file)
@@ -1455,9 +1455,6 @@ webkit.org/b/116621 fast/replaced/preferred-widths.html [ Pass Failure ]
 
 webkit.org/b/164277 fast/preloader/image-srcset.html [ Pass Failure ]
 
-webkit.org/b/166038 http/tests/inspector/network/fetch-network-data.html [ Pass Timeout ]
-webkit.org/b/164033 http/tests/inspector/network/xhr-request-data-encoded-correctly.html [ Pass Timeout ]
-
 webkit.org/b/165222 [ Debug ] imported/w3c/web-platform-tests/IndexedDB/idbindex-multientry.htm [ Pass Failure ]
 webkit.org/b/165222 [ Debug ] imported/w3c/web-platform-tests/IndexedDB/idbindex-rename-abort.html [ Pass Failure ]
 webkit.org/b/165222 [ Debug ] imported/w3c/web-platform-tests/IndexedDB/idbindex-rename-errors.html [ Pass Failure ]