Unreviewed, rolling out r243551.
[WebKit-https.git] / LayoutTests / imported / w3c / web-platform-tests / xhr / event-error-order.sub.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4     <meta name="assert" content="Check the order of events fired when the request has failed.">
5     <script src="/resources/testharness.js"></script>
6     <script src="/resources/testharnessreport.js"></script>
7     <script src="resources/xmlhttprequest-event-order.js"></script>
8     <title>XMLHttpRequest: event - error (order of events)</title>
9 </head>
10
11 <body>
12     <div id="log"></div>
13
14     <script type="text/javascript">
15         var test = async_test();
16
17         test.step(function()
18         {
19             var xhr = new XMLHttpRequest();
20             prepare_xhr_for_event_order_test(xhr);
21
22             xhr.addEventListener("loadend", function() {
23                 test.step(function() {
24                     // no progress events due to CORS failure
25                     assert_xhr_event_order_matches([1, "loadstart(0,0,false)", "upload.loadstart(0,12,true)", 2, 4, "upload.error(0,0,false)", "upload.loadend(0,0,false)", "error(0,0,false)", "loadend(0,0,false)"]);
26                     test.done();
27                 });
28             });
29
30             xhr.open("POST", "http://nonexistent.{{host}}:{{ports[http][0]}}", true);
31             xhr.send("Test Message");
32         });
33     </script>
34 </body>
35 </html>