1 self.onmessage = function(evt) {
2 if (evt.data.operation == 'find-edges' &&
3 ArrayBuffer.prototype.isPrototypeOf(evt.data.input) &&
4 evt.data.input.byteLength == 20 &&
5 evt.data.threshold == 0.6) {
6 self.postMessage("PASS: Worker receives correct structure message.");
8 operation: evt.data.operation,
10 threshold: evt.data.threshold
14 self.postMessage("FAIL: Worker receives error structure message.");