blob: 3471db1b4aa408b73ec0d4936e407a51d95f6731 [file] [log] [blame]
// Code to provide a consistent test interface for workers and shared workers.
if (self.postMessage) {
if (self.init)
init();
} else {
self.onconnect = function(event) {
self.postMessage = function(message) { event.ports[0].postMessage(message); };
event.ports[0].onmessage = function (evt) {
if (self.onmessage)
self.onmessage(evt);
};
if (self.init)
init();
};
}