mirror of
https://github.com/servo/servo.git
synced 2025-06-24 09:04:33 +01:00
- Update CSS tests to revision e05bfd5e30ed662c2f8a353577003f8eed230180. - Update web-platform-tests to revision a052787dd5c069a340031011196b73affbd68cd9.
38 lines
1.3 KiB
HTML
38 lines
1.3 KiB
HTML
<!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)
|
|
assert_equals(client.status, 200)
|
|
assert_equals(client.responseXML.documentElement.localName, "html")
|
|
client.abort()
|
|
assert_equals(client.readyState, 0)
|
|
assert_equals(client.status, 0)
|
|
assert_equals(client.statusText, "")
|
|
assert_equals(client.responseXML, null)
|
|
assert_equals(client.getAllResponseHeaders(), "")
|
|
assert_array_equals(result, expected)
|
|
test.done()
|
|
})
|
|
</script>
|
|
</body>
|
|
</html>
|