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

Unified Diff: LayoutTests/http/tests/xmlhttprequest/workers/resources/upload-onprogress-worker.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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/xmlhttprequest/workers/resources/upload-onprogress-worker.js
diff --git a/LayoutTests/http/tests/xmlhttprequest/workers/resources/upload-onprogress-worker.js b/LayoutTests/http/tests/xmlhttprequest/workers/resources/upload-onprogress-worker.js
new file mode 100644
index 0000000000000000000000000000000000000000..c254f45cee8dd8c8c501ebcee2381ff3b2f6af75
--- /dev/null
+++ b/LayoutTests/http/tests/xmlhttprequest/workers/resources/upload-onprogress-worker.js
@@ -0,0 +1,29 @@
+importScripts("worker-pre.js");
+
+function log(message)
+{
+ postMessage("log " + message);
+}
+
+function onLoad()
+{
+ postMessage("DONE");
+}
+
+function onProgress(e)
+{
+ postMessage("tick " + e.loaded);
+}
+
+function init()
+{
+ try {
+ var xhr = new XMLHttpRequest();
+ xhr.upload.onprogress = onProgress;
+ xhr.onload = onLoad;
+ xhr.open("POST", "../../resources/post-echo.cgi");
+ xhr.send((new Array(100000)).join("aa"));
+ } catch (e) {
+ log("Exception received.");
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698