test_bug1132395.html (942B)
1 <!-- 2 Any copyright is dedicated to the Public Domain. 3 http://creativecommons.org/publicdomain/zero/1.0/ 4 --> 5 <!DOCTYPE HTML> 6 <html> 7 <head> 8 <title>Test for 1132395</title> 9 <script src="/tests/SimpleTest/SimpleTest.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 11 </head> 12 <body> 13 14 <script class="testbody" type="text/javascript"> 15 16 // This test is full of dummy debug messages. This is because I need to follow 17 // an hard-to-reproduce timeout failure. 18 19 info("test started"); 20 var sw = new SharedWorker('bug1132395_sharedWorker.js'); 21 sw.port.onmessage = function(event) { 22 info("sw.onmessage received"); 23 ok(true, "We didn't crash."); 24 SimpleTest.finish(); 25 } 26 27 sw.onerror = function(event) { 28 ok(false, "Failed to create a ServiceWorker"); 29 SimpleTest.finish(); 30 } 31 32 info("sw.postmessage called"); 33 sw.port.postMessage('go'); 34 35 SimpleTest.waitForExplicitFinish(); 36 37 </script> 38 </pre> 39 </body> 40 </html>