blob: a8b604fe3f79739a39a10a01377abf398e396ab5 (
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
|
<!doctype html>
<html>
<head>
<title>XMLHttpRequest: abort() during DONE</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<link rel="help" href="https://xhr.spec.whatwg.org/#the-abort()-method" data-tested-assertations="following-sibling::ol/li[4] following-sibling::ol/li[5]" />
</head>
<body>
<div id="log"></div>
<script>
var test = async_test()
test.step(function() {
var client = new XMLHttpRequest(),
result = [],
expected = [1, 4] // open() -> 1, send() -> 4
client.onreadystatechange = function() {
test.step(function() {
result.push(client.readyState)
})
}
client.open("GET", "resources/well-formed.xml", false)
client.send(null)
assert_equals(client.readyState, 4)
client.abort()
assert_equals(client.readyState, 0)
assert_array_equals(result, expected)
test.done()
})
</script>
</body>
</html>
|