mirror of
https://github.com/servo/servo.git
synced 2025-07-27 09:10:28 +01:00
29 lines
1 KiB
HTML
29 lines
1 KiB
HTML
<!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>
|