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

Side by Side Diff: LayoutTests/http/tests/xmlhttprequest/workers/resources/upload-onprogress-event.js

Issue 71433002: Enable XHR upload progress events for Workers. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add missing doctype declaration Created 7 years, 1 month 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/workers/resources/upload-onprogress-worker.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 if (window.testRunner) { 1 if (window.testRunner) {
2 testRunner.dumpAsText(); 2 testRunner.dumpAsText();
3 testRunner.waitUntilDone(); 3 testRunner.waitUntilDone();
4 } 4 }
5 5
6 var console_messages = document.createElement("ul"); 6 var console_messages = document.createElement("ul");
7 document.body.appendChild(console_messages); 7 document.body.appendChild(console_messages);
8 8
9 function log(message) 9 function log(message)
10 { 10 {
11 var item = document.createElement("li"); 11 var item = document.createElement("li");
12 item.appendChild(document.createTextNode(message)); 12 item.appendChild(document.createTextNode(message));
13 console_messages.appendChild(item); 13 console_messages.appendChild(item);
14 } 14 }
15 15
16 var worker = createWorker('resources/xmlhttprequest-file-not-found.js'); 16 var progress_ticks = 0;
17 var worker = createWorker('resources/upload-onprogress-worker.js');
17 worker.onmessage = function(evt) 18 worker.onmessage = function(evt)
18 { 19 {
19 if (/log .+/.test(evt.data)) 20 if (/log .+/.test(evt.data)) {
20 log(evt.data.substr(4)); 21 log(evt.data.substr(4));
21 else if (/DONE/.test(evt.data)) { 22 } else if (/tick .+/.test(evt.data)) {
22 log("PASS"); 23 progress_ticks++;
24 } else if (/DONE/.test(evt.data)) {
25 log(progress_ticks >= 1 ? "PASS" : "FAIL");
23 if (window.testRunner) 26 if (window.testRunner)
24 testRunner.notifyDone(); 27 testRunner.notifyDone();
25 } 28 }
26 } 29 }
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/xmlhttprequest/workers/resources/upload-onprogress-worker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698