blob: d57592c0ba30249f6ccf0db45a48ac2c6f50a334 [file] [log] [blame]
Anne van Kesteren66b54172010-08-11 18:02:171<!DOCTYPE html>
2<html>
3 <head>
4 <title>XMLHttpRequest: open() - send() - open()</title>
5 <script src="/resources/testharness.js"></script>
Ms2ger6f083e72012-08-05 08:38:146 <script src="/resources/testharnessreport.js"></script>
Ms2ger91fef142014-11-01 09:24:377 <link rel="help" href="https://xhr.spec.whatwg.org/#the-open()-method" data-tested-assertations="following::ol/li[14]/ul/li[1] following::ol/li[14]/ul/li[2] following::ol/li[15]/ol/li[1] following::ol/li[15]/ol/li[2]" />
Anne van Kesteren66b54172010-08-11 18:02:178 </head>
9 <body>
10 <div id="log"></div>
11 <script>
12 var test = async_test()
13 test.step(function() {
14 var client = new XMLHttpRequest(),
15 result = [],
Hallvord R. M. Steen2e4af782013-05-13 22:00:4716 expected = [1, 'a', 'b', 'c']
Anne van Kesteren66b54172010-08-11 18:02:1717 client.onreadystatechange = function() {
18 test.step(function() {
19 result.push(client.readyState)
20 })
21 }
22 client.open("GET", "folder.txt")
Hallvord R. M. Steen2e4af782013-05-13 22:00:4723 result.push('a')
Anne van Kesteren66b54172010-08-11 18:02:1724 client.send()
Hallvord R. M. Steen2e4af782013-05-13 22:00:4725 result.push('b')
Anne van Kesteren66b54172010-08-11 18:02:1726 client.open("GET", "folder.txt")
Hallvord R. M. Steen2e4af782013-05-13 22:00:4727 result.push('c')
Anne van Kesteren66b54172010-08-11 18:02:1728 assert_array_equals(result, expected)
29 test.done()
30 })
31 </script>
32 </body>
33</html>