summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/workers/support/Worker-structure-message.js
blob: 81cd98243b4d6d21977da64d8fa858747b6ddbe3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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.");
}