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

Side by Side Diff: LayoutTests/http/tests/xmlhttprequest/infoOnProgressEvent-response-type-blob.html

Issue 23444058: Use downloadToFile option when XHR downloads a Blob (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase test style and XHR Created 7 years 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
OLDNEW
1 <html> 1 <html>
2 <head/> 2 <head/>
3 <body> 3 <body>
4 <p> Test case for bug 13596: Implement .onprogress handler on XMLHttpRequest obj ects to support progressive download content length information </p> 4 <p> .onprogress handler on XMLHttpRequest objects with response type "blob" work s to support progressive download content length information </p>
5 <p> You should see type, bubble, cancelable, eventPhase, target and current targ et.</p> 5 <p> You should see type, bubble, cancelable, eventPhase, target and current targ et.</p>
6 <script type="text/javascript"> 6 <script type="text/javascript">
7 function log (msg) 7 function log (msg)
8 { 8 {
9 document.body.appendChild(document.createTextNode(msg)); 9 document.body.appendChild(document.createTextNode(msg));
10 insertNewLine(); 10 insertNewLine();
11 } 11 }
12 12
13 function insertNewLine() 13 function insertNewLine()
14 { 14 {
15 document.body.appendChild(document.createElement("br")); 15 document.body.appendChild(document.createElement("br"));
16 } 16 }
17 17
18 function onProgress(e) { 18 function onProgress(e) {
19 log("Type: " + e.type); 19 log("Type: " + e.type);
20 log("Bubble: " + e.bubbles); 20 log("Bubble: " + e.bubbles);
21 log("Cancelable: " + e.cancelable); 21 log("Cancelable: " + e.cancelable);
22 log("EventPhase: " + e.eventPhase); 22 log("EventPhase: " + e.eventPhase);
23 log("Target: " + e.target); 23 log("Target: " + e.target);
24 log("Current target: " + e.currentTarget); 24 log("Current target: " + e.currentTarget);
25 e.currentTarget.onprogress = null; 25 e.currentTarget.onprogress = null;
26 if (window.testRunner) 26 if (window.testRunner)
27 testRunner.notifyDone(); 27 testRunner.notifyDone();
28 } 28 }
29 29
30 function onError(e) {
31 alert("Error " + e.target.status + " occurred while receiving the document.");
32 }
33
34 var shouldNotify = false;
35
36 if (window.testRunner) { 30 if (window.testRunner) {
37 testRunner.dumpAsText(); 31 testRunner.dumpAsText();
38 testRunner.waitUntilDone(); 32 testRunner.waitUntilDone();
39 } 33 }
40 34
41 var req = new XMLHttpRequest(); 35 var req = new XMLHttpRequest();
36 req.responseType = "blob";
42 req.onprogress = onProgress; 37 req.onprogress = onProgress;
43 req.open("GET", "resources/1251.html", true); 38 req.open("GET", "resources/get.txt", true);
44 req.send(null); 39 req.send(null);
45 </script> 40 </script>
46 </body> 41 </body>
47 </html> 42 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698