OLD | NEW |
1 <html> | 1 <html> |
2 <body> | 2 <body> |
3 <p>Test that upload progress events are not dispatched for simple cross-origin r
equests | 3 <p>Test that upload progress events are not dispatched for simple cross-origin r
equests |
4 (i.e. if the listener is set after calling send(), and there are no other reason
s to make a preflight request).</p> | 4 (i.e. if the listener is set after calling send(), and there are no other reason
s to make a preflight request).</p> |
5 <pre id="console"></pre> | 5 <pre id="console"></pre> |
6 <script> | 6 <script> |
7 if (window.testRunner) { | 7 if (window.testRunner) { |
8 testRunner.dumpAsText(); | 8 testRunner.dumpAsText(); |
9 testRunner.waitUntilDone(); | 9 testRunner.waitUntilDone(); |
10 } | 10 } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 var xhr = new XMLHttpRequest(); | 96 var xhr = new XMLHttpRequest(); |
97 xhr.onprogress = progress; | 97 xhr.onprogress = progress; |
98 xhr.open("POST", "http://localhost:8000/xmlhttprequest/resources/cross-site-
progress-events.cgi", true); | 98 xhr.open("POST", "http://localhost:8000/xmlhttprequest/resources/cross-site-
progress-events.cgi", true); |
99 xhr.setRequestHeader("Content-Type", "text/plain"); | 99 xhr.setRequestHeader("Content-Type", "text/plain"); |
100 xhr.upload.onloadstart = function() { log("upload.onloadstart") } | 100 xhr.upload.onloadstart = function() { log("upload.onloadstart") } |
101 xhr.send(stringToSend); | 101 xhr.send(stringToSend); |
102 xhr.upload.onprogress = uploadProgress; | 102 xhr.upload.onprogress = uploadProgress; |
103 xhr.upload.onload = function() { log("FAIL: upload.onload") } | 103 xhr.upload.onload = function() { log("FAIL: upload.onload") } |
104 xhr.upload.onerror = function() { | 104 xhr.upload.onerror = function() { |
105 log("upload.onerror (expected)") | 105 log("upload.onerror (expected)") |
106 if (window.testRunner) | |
107 testRunner.notifyDone(); | |
108 } | 106 } |
109 xhr.onerror = function() { | 107 xhr.onerror = function() { |
110 log("onerror (expected)"); | 108 log("onerror (expected)"); |
111 log("Response length: " + xhr.responseText.length); | 109 log("Response length: " + xhr.responseText.length); |
| 110 if (window.testRunner) |
| 111 testRunner.notifyDone(); |
112 } | 112 } |
113 xhr.onload = function() { | 113 xhr.onload = function() { |
114 log("onload"); | 114 log("onload"); |
115 } | 115 } |
116 } | 116 } |
117 | 117 |
118 test1(); | 118 test1(); |
119 </script> | 119 </script> |
120 </body> | 120 </body> |
121 </html> | 121 </html> |
OLD | NEW |