summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/xhr/responsexml-get-twice.htm
blob: e86a6d59e51ecef0ba0a07e7c53e586ac48a62ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!doctype html>
<meta charset="utf-8">
<title></title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
      async_test(function() {
        var client = new XMLHttpRequest()
        client.open("GET", "resources/well-formed.xml")
        client.responseType = "document"
        assert_equals(client.responseType, "document")
        client.send()
        client.onload = this.step_func_done(function() {
          var first = client.response
          var second = client.response
          assert_not_equals(first, null)
          assert_not_equals(second, null)
          assert_equals(first, second)
        })
      }, "Getting response, then response")

      async_test(function() {
        var client = new XMLHttpRequest()
        client.open("GET", "resources/well-formed.xml")
        client.responseType = "document"
        assert_equals(client.responseType, "document")
        client.send()
        client.onload = this.step_func_done(function() {
          var first = client.responseXML
          var second = client.responseXML
          assert_not_equals(first, null)
          assert_not_equals(second, null)
          assert_equals(first, second)
        })
      }, "Getting responseXML, then responseXML")

      async_test(function() {
        var client = new XMLHttpRequest()
        client.open("GET", "resources/well-formed.xml")
        client.responseType = "document"
        assert_equals(client.responseType, "document")
        client.send()
        client.onload = this.step_func_done(function() {
          var first = client.responseXML
          var second = client.response
          assert_not_equals(first, null)
          assert_not_equals(second, null)
          assert_equals(first, second)
        })
      }, "Getting responseXML, then response")

      async_test(function() {
        var client = new XMLHttpRequest()
        client.open("GET", "resources/well-formed.xml")
        client.responseType = "document"
        assert_equals(client.responseType, "document")
        client.send()
        client.onload = this.step_func_done(function() {
          var first = client.response
          var second = client.responseXML
          assert_not_equals(first, null)
          assert_not_equals(second, null)
          assert_equals(first, second)
        })
      }, "Getting response, then responseXML")
</script>