Sync web-platform-tests up to revision a5b95cb31914507088a4eda16f7674bbc6f3313f
[WebKit-https.git] / LayoutTests / imported / w3c / web-platform-tests / XMLHttpRequest / send-sync-timeout.htm
1 <!doctype html>
2 <html>
3   <head>
4     <title>XMLHttpRequest: timeout during sync send() should not run</title>
5     <script src="/resources/testharness.js"></script>
6     <script src="/resources/testharnessreport.js"></script>
7     <link rel="help" href="https://xhr.spec.whatwg.org/#the-send()-method"/>
8   </head>
9   <body>
10     <div id="log"></div>
11     <script>
12       var test = async_test(),
13           hasrun = false
14       test.step(function() {
15         client = new XMLHttpRequest()
16         client.open("GET", "folder.txt", false)
17         test.step_timeout(() => { hasrun = true }, 0)
18         client.onreadystatechange = function() {
19           test.step(function() {
20             assert_equals(client.readyState, 4)
21             assert_false(hasrun)
22           })
23         }
24         client.send(null)
25         test.done()
26       })
27     </script>
28   </body>
29 </html>