Revision 826375a734caf3cbe9b757ca69dbef9d578aa76d authored by Robert Ma on 26 March 2018, 20:24:51 UTC, committed by GitHub on 26 March 2018, 20:24:51 UTC
1 parent 7988e17
open-during-abort.htm
<!doctype html>
<html>
<head>
<title>XMLHttpRequest: open() during abort()</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id="log"></div>
<script>
test(function() {
var client = new XMLHttpRequest(),
abort_flag = false,
result = [],
expected = [1, 4, 1] // open() => 1, abort() => 4, open() => 1
client.onreadystatechange = this.step_func(function() {
result.push(client.readyState)
if (abort_flag) {
abort_flag = false
client.open("GET", "...")
}
})
client.open("GET", "resources/well-formed.xml")
client.send(null)
abort_flag = true
client.abort()
assert_array_equals(result, expected)
assert_equals(client.readyState, 1) // abort() should only set state to UNSENT when DONE
})
</script>
</body>
</html>
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...