mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Update web-platform-tests to revision dc5cbf088edcdb266541d4e5a76149a2c6e716a0
This commit is contained in:
parent
1d40075f03
commit
079092dfea
2381 changed files with 90360 additions and 17722 deletions
|
@ -3,6 +3,7 @@
|
|||
<head>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/xmlhttprequest-event-order.js"></script>
|
||||
<title>XMLHttpRequest: The send() method: event order when synchronous flag is set</title>
|
||||
<link rel="help" href="https://xhr.spec.whatwg.org/#handler-xhr-onloadstart" data-tested-assertations="../.." />
|
||||
<link rel="help" href="https://xhr.spec.whatwg.org/#handler-xhr-onloadend" data-tested-assertations="../.." />
|
||||
|
@ -21,30 +22,13 @@
|
|||
<script type="text/javascript">
|
||||
test(function () {
|
||||
var xhr = new XMLHttpRequest();
|
||||
var expect = [4, "load", "loadend"];
|
||||
var actual = [];
|
||||
|
||||
xhr.onreadystatechange = function()
|
||||
{
|
||||
if (xhr.readyState == 4)
|
||||
{
|
||||
actual.push(xhr.readyState);
|
||||
}
|
||||
};
|
||||
|
||||
xhr.onloadstart = function(e){ actual.push(e.type); };
|
||||
xhr.onload = function(e){ actual.push(e.type); };
|
||||
xhr.onloadend = function(e){ actual.push(e.type); };
|
||||
|
||||
xhr.upload.onload = function(e){ actual.push("upload." + e.type); };
|
||||
xhr.upload.onloadstart = function(e){ actual.push("upload." + e.type); };
|
||||
xhr.upload.onloadend = function(e){ actual.push("upload." + e.type);};
|
||||
prepare_xhr_for_event_order_test(xhr);
|
||||
|
||||
xhr.open("POST", "./resources/content.py", false);
|
||||
xhr.send("Test Message");
|
||||
|
||||
assert_equals(xhr.response, "Test Message");
|
||||
assert_array_equals(actual, expect);
|
||||
assert_xhr_event_order_matches([1, 4, "load(12,12,true)", "loadend(12,12,true)"]);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue