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

Unified Diff: chrome/test/data/workers/worker_common.js

Issue 490023: Enabled a number of worker tests on various platforms. (Closed)
Patch Set: Removed erroneous edit to websharedworker_stub.cc Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/workers/single_worker.html ('k') | chrome/test/data/workers/worker_utils.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/workers/worker_common.js
diff --git a/chrome/test/data/workers/worker_common.js b/chrome/test/data/workers/worker_common.js
index 583c6a55eb0ddb2d1f7fbf814951f22f9e28e5b8..8caa6227fa97efa2c34ed3ceabc211130344bd5d 100644
--- a/chrome/test/data/workers/worker_common.js
+++ b/chrome/test/data/workers/worker_common.js
@@ -1,3 +1,14 @@
+if (!self.postMessage) {
+ // This is a shared worker - mimic dedicated worker APIs
+ onconnect = function(event) {
+ event.ports[0].onmessage = function(e) {
+ self.onmessage(e);
+ };
+ self.postMessage = function(msg, ports) {
+ event.ports[0].postMessage(msg, ports);
+ };
+ };
+}
onmessage = function(evt) {
if (evt.data == "ping")
postMessage("pong");
« no previous file with comments | « chrome/test/data/workers/single_worker.html ('k') | chrome/test/data/workers/worker_utils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698