00bc9d7a65238c0aca4f0b0fa8c724a2ffd60af7
[WebKit-https.git] / LayoutTests / http / wpt / beacon / beacon-async-error-logging.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="/resources/testharness.js"></script>
5 <script src="/resources/testharnessreport.js"></script>
6 </head>
7 <body>
8 <script>
9     async_test(function(t) {
10         if (window.internals) {
11             internals.setConsoleMessageListener(function() {
12                 t.done();
13             });
14         } else {
15             setTimeout(function() { t.done(); }, 500);
16         }
17         let invalidHost = "http://invalid.localhost";
18         assert_true(navigator.sendBeacon(invalidHost, 'test'), "sendBeacon should return true");
19     }, "Should log an error message in the console");
20 </script>
21 </body>
22 </html>