4 <p>Test that pages and workers can send Structure Message to one another.</p>
5 <p>On success, you will see a series of "PASS" messages, followed by "DONE".</p>
10 document.getElementById("result").innerHTML += message + "<br>";
13 if (window.layoutTestController) {
14 layoutTestController.dumpAsText();
15 layoutTestController.waitUntilDone();
18 var worker = new Worker("resources/worker-structure-message.js");
19 worker.onmessage = function(evt) {
21 if (evt.data.indexOf("FAIL") == 0) {
24 worker.onmessage = function(evt) {
25 if (evt.data.operation == 'find-edges' &&
26 ArrayBuffer.prototype.isPrototypeOf(evt.data.input) &&
27 evt.data.input.byteLength == 20 &&
28 evt.data.threshold == 0.6) {
29 log("PASS: Receive correct structure message from Worker.");
32 log("FAIL: Receive error structure message from Worker.");
37 var buf = new ArrayBuffer(20);
39 operation: 'find-edges',
47 if (window.layoutTestController)
48 layoutTestController.notifyDone();