Removed unused VideoCaptureCapability parameters.
[chromium-blink-merge.git] / content / test / data / workers / worker_common.js
blob675de0de6d1b8fb4b59bee4151e440f86e25e41f
1 // Track the number of clients for this worker - tests can use this to ensure
2 // that shared workers are actually shared, not distinct.
3 var num_clients = 0;
5 if (!self.postMessage) {
6 // This is a shared worker - mimic dedicated worker APIs
7 onconnect = function(event) {
8 num_clients++;
9 event.ports[0].onmessage = function(e) {
10 self.postMessage = function(msg) {
11 event.ports[0].postMessage(msg);
13 self.onmessage(e);
16 } else {
17 num_clients++;
19 onmessage = function(evt) {
20 if (evt.data == "ping")
21 postMessage("pong");
22 else if (evt.data == "auth")
23 importScripts("/auth-basic");
24 else if (evt.data == "close")
25 close();
26 else if (/eval.+/.test(evt.data)) {
27 try {
28 postMessage(eval(evt.data.substr(5)));
29 } catch (ex) {
30 postMessage(ex);