chromium/third_party/blink/web_tests/external/wpt/workers/support/Worker-structure-message.js

self.onmessage = function(evt) {
    if (evt.data.operation == 'find-edges' &&
        ArrayBuffer.prototype.isPrototypeOf(evt.data.input) &&
        evt.data.input.byteLength == 20 &&
        evt.data.threshold == 0.6) {
        self.postMessage("PASS: Worker receives correct structure message.");
        self.postMessage({
            operation: evt.data.operation,
            input: evt.data.input,
            threshold: evt.data.threshold
        });
    }
    else
        self.postMessage("FAIL: Worker receives error structure message.");
}