blob: cc81c52239485837dc8a23f1d685959e5ea9dea5 [file] [log] [blame]
Andrew Top61a84952019-04-30 15:07:33 -07001<!DOCTYPE html>
2<html>
3 <head>
4 <title>XMLHttpRequest: open() (sync) - send() - open()</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-open()-method" data-tested-assertations="following::ol[1]/li[14]/ul/li[1] following::ol[1]/li[14]/ul/li[2] following::ol[1]/li[14]/ul/li[3] following::ol[1]/li[15]/ol/li[1] following::ol[1]/li[15]/ol/li[2]" />
8 <link rel="help" href="https://xhr.spec.whatwg.org/#the-responsexml-attribute" data-tested-assertations="following::ol[1]/li[2]" />
9 <link rel="help" href="https://xhr.spec.whatwg.org/#the-responsetext-attribute" data-tested-assertations="following::ol[1]/li[2]" />
10 <link rel="help" href="https://xhr.spec.whatwg.org/#the-status-attribute" data-tested-assertations="following::ol[1]/li[1]" />
11 <link rel="help" href="https://xhr.spec.whatwg.org/#the-statustext-attribute" data-tested-assertations="following::ol[1]/li[1]" />
12 <link rel="help" href="https://xhr.spec.whatwg.org/#the-getallresponseheaders()-method" data-tested-assertations="following::ol[1]/li[1]" />
13
14 </head>
15 <body>
16 <div id="log"></div>
17 <script>
18 var test = async_test()
19 test.step(function() {
20 var client = new XMLHttpRequest(),
21 result = [],
22 expected = [1]
23 client.onreadystatechange = function() {
24 test.step(function() {
25 result.push(client.readyState)
26 })
27 }
28 client.open("GET", "folder.txt")
29 client.send(null)
30 client.open("GET", "folder.txt", false)
31 assert_array_equals(result, expected)
32 assert_equals(client.responseXML, null)
33 assert_equals(client.responseText, "")
34 assert_equals(client.status, 0)
35 assert_equals(client.statusText, "")
36 assert_equals(client.getAllResponseHeaders(), "")
37 test.done()
38 })
39 </script>
40 </body>
41</html>