Layout Test http/wpt/beacon/beacon-async-error-logging.html is flaky
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 27 Jan 2018 04:26:11 +0000 (04:26 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 27 Jan 2018 04:26:11 +0000 (04:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=182184
<rdar://problem/36929478>

Reviewed by Youenn Fablet.

Stop relying on a setTimeout(500) to end the test. Instead rely on the
internals.setConsoleMessageListener() API to wait for the console message
we are expecting.

* http/wpt/beacon/beacon-async-error-logging.html:

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

LayoutTests/ChangeLog
LayoutTests/http/wpt/beacon/beacon-async-error-logging.html

index fcfa646..2c61f0e 100644 (file)
@@ -1,3 +1,17 @@
+2018-01-26  Chris Dumez  <cdumez@apple.com>
+
+        Layout Test http/wpt/beacon/beacon-async-error-logging.html is flaky
+        https://bugs.webkit.org/show_bug.cgi?id=182184
+        <rdar://problem/36929478>
+
+        Reviewed by Youenn Fablet.
+
+        Stop relying on a setTimeout(500) to end the test. Instead rely on the
+        internals.setConsoleMessageListener() API to wait for the console message
+        we are expecting.
+
+        * http/wpt/beacon/beacon-async-error-logging.html:
+
 2018-01-26  Ricky Mondello  <rmondello@apple.com>
 
         Use the standard -webkit-autofill color on iOS
index c276cfe..00bc9d7 100644 (file)
@@ -7,11 +7,15 @@
 <body>
 <script>
     async_test(function(t) {
+        if (window.internals) {
+            internals.setConsoleMessageListener(function() {
+                t.done();
+            });
+        } else {
+            setTimeout(function() { t.done(); }, 500);
+        }
         let invalidHost = "http://invalid.localhost";
         assert_true(navigator.sendBeacon(invalidHost, 'test'), "sendBeacon should return true");
-        setTimeout(function() {
-            t.done();
-        }, 500);
     }, "Should log an error message in the console");
 </script>
 </body>