OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <script src="../resources/testharness.js"></script> | 4 <script src="../resources/testharness.js"></script> |
5 <script src="../resources/testharnessreport.js"></script> | 5 <script src="../resources/testharnessreport.js"></script> |
6 <script type="text/javascript"> | 6 <script type="text/javascript"> |
7 | 7 |
8 // Interval prepared to wait until deciding if 'abort' has been delivered (or no
t.) | 8 // Interval prepared to wait until deciding if 'abort' has been delivered (or no
t.) |
9 var TIME_DELAY_ABORT_DELIVERY = 200; | 9 var TIME_DELAY_ABORT_DELIVERY = 200; |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 default: | 39 default: |
40 assert_unreached("Unexpected readyState: " + xhr.readyState); | 40 assert_unreached("Unexpected readyState: " + xhr.readyState); |
41 return; | 41 return; |
42 } | 42 } |
43 }); | 43 }); |
44 xhr.onabort = this.step_func(function () { | 44 xhr.onabort = this.step_func(function () { |
45 assert_unreached("Unexpected 'abort' event in state OPENED."); | 45 assert_unreached("Unexpected 'abort' event in state OPENED."); |
46 }); | 46 }); |
47 xhr.open("GET", "resources/test.ogv", true); | 47 xhr.open("GET", "resources/test.ogv", true); |
48 xhr.abort(); | 48 xhr.abort(); |
49 assert_equals(xhr.readyState, xhr.UNSENT, "xhr.readyState after abort() call
"); | 49 assert_equals(xhr.readyState, xhr.OPENED, "xhr.readyState after abort() call
"); |
50 assert_array_equals(seenStates, [xhr.OPENED]); | 50 assert_array_equals(seenStates, [xhr.OPENED]); |
51 }, "Test onreadystatechange + onabort invocation when abort()-ed in OPENED state
."); | 51 }, "Test onreadystatechange + onabort invocation when abort()-ed in OPENED state
."); |
52 | 52 |
53 var abortAfterSendTest = async_test("Test onreadystatechange + onabort invocatio
n when abort()-ed right after calling send()."); | 53 var abortAfterSendTest = async_test("Test onreadystatechange + onabort invocatio
n when abort()-ed right after calling send()."); |
54 abortAfterSendTest.step(function() | 54 abortAfterSendTest.step(function() |
55 { | 55 { |
56 var xhr = new XMLHttpRequest; | 56 var xhr = new XMLHttpRequest; |
57 var seenStates = []; | 57 var seenStates = []; |
58 xhr.onreadystatechange = this.step_func(function() { | 58 xhr.onreadystatechange = this.step_func(function() { |
59 seenStates.push(xhr.readyState); | 59 seenStates.push(xhr.readyState); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 }); | 194 }); |
195 xhr.onabort = abortInDoneTest.step_func(function () { | 195 xhr.onabort = abortInDoneTest.step_func(function () { |
196 assert_unreached("abort() should not cause the abort event to fire"); | 196 assert_unreached("abort() should not cause the abort event to fire"); |
197 }); | 197 }); |
198 xhr.open("GET", "resources/test.ogv", true); | 198 xhr.open("GET", "resources/test.ogv", true); |
199 xhr.send(); | 199 xhr.send(); |
200 }); | 200 }); |
201 </script> | 201 </script> |
202 </body> | 202 </body> |
203 </html> | 203 </html> |
OLD | NEW |