blob: 60a6eeecd83b82ea7a9b394ad783043e87061bb6 [file] [log] [blame]
<!doctype html>
<html>
<head>
<title>XMLHttpRequest: abort() during OPEN</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]" />
<link rel="help" href="https://xhr.spec.whatwg.org/#the-send()-method" data-tested-assertations="following-sibling::ol/li[1]" />
</head>
<body>
<div id="log"></div>
<script>
var test = async_test()
test.step(function() {
var client = new XMLHttpRequest()
client.open("GET", "...")
client.onreadystatechange = function() {
test.step(function() {
assert_unreached()
})
}
client.abort()
assert_equals(client.readyState, 0)
assert_throws("InvalidStateError", function() { client.send("test") }, "calling send() after abort()")
})
test.done()
</script>
</body>
</html>