Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Side by Side Diff: LayoutTests/http/tests/xmlhttprequest/simple-cross-origin-progress-events.html

Issue 20560007: On request error, always fire events on the XMLHttpRequestUpload before the XMLHttpRequest (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/simple-cross-origin-progress-events-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/simple-cross-origin-progress-events-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698