test_sharedWorker_lifetime.html (714B)
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 MessagePort and SharedWorkers</title> 9 <meta http-equiv="content-type" content="text/html; charset=UTF-8"> 10 <script src="/tests/SimpleTest/SimpleTest.js"></script> 11 </head> 12 <body> 13 <script class="testbody" type="text/javascript"> 14 15 var gced = false; 16 17 var sw = new SharedWorker('sharedWorker_lifetime.js'); 18 sw.port.onmessage = function(event) { 19 ok(gced, "The SW is still alive also after GC"); 20 SimpleTest.finish(); 21 } 22 23 sw = null; 24 SpecialPowers.forceGC(); 25 gced = true; 26 27 SimpleTest.waitForExplicitFinish(); 28 </script> 29 </body> 30 </html>