1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/workers/test/test_importScripts.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,53 @@ 1.4 +<!-- 1.5 + Any copyright is dedicated to the Public Domain. 1.6 + http://creativecommons.org/publicdomain/zero/1.0/ 1.7 +--> 1.8 +<!DOCTYPE HTML> 1.9 +<html> 1.10 +<!-- 1.11 +Tests of DOM Worker Threads (Bug 437152) 1.12 +--> 1.13 +<head> 1.14 + <title>Test for DOM Worker Threads (Bug 437152)</title> 1.15 + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.16 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 1.17 +</head> 1.18 +<body> 1.19 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=437152">DOM Worker Threads Bug 437152</a> 1.20 +<p id="display"></p> 1.21 +<div id="content" style="display: none"> 1.22 + 1.23 +</div> 1.24 +<pre id="test"> 1.25 +<script class="testbody" type="text/javascript"> 1.26 + 1.27 + var worker = new Worker("importScripts_worker.js"); 1.28 + 1.29 + worker.onmessage = function(event) { 1.30 + switch (event.data) { 1.31 + case "started": 1.32 + worker.postMessage("stop"); 1.33 + break; 1.34 + case "stopped": 1.35 + ok(true, "worker correctly stopped"); 1.36 + SimpleTest.finish(); 1.37 + break; 1.38 + default: 1.39 + ok(false, "Unexpected message:" + event.data); 1.40 + SimpleTest.finish(); 1.41 + } 1.42 + }; 1.43 + 1.44 + worker.onerror = function(event) { 1.45 + ok(false, "Worker had an error:" + event.message); 1.46 + SimpleTest.finish(); 1.47 + } 1.48 + 1.49 + worker.postMessage("start"); 1.50 + 1.51 + SimpleTest.waitForExplicitFinish(); 1.52 + 1.53 +</script> 1.54 +</pre> 1.55 +</body> 1.56 +</html>