Bug 1066410 - Serious color distortion happened when plays WebRTC. r=jesup, a=bajaj
[gecko.git] / dom / workers / test / test_fibonacci.html
blobd93eb12d4099a413250894df6996c5da1b91ff1c
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 <!--
8 Tests of DOM Worker Threads with Fibonacci
9 -->
10 <head>
11 <title>Test for DOM Worker Threads with Fibonacci</title>
12 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
13 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
14 </head>
15 <body>
16 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=450452">DOM Worker Threads Fibonacci</a>
17 <p id="display"></p>
18 <div id="content" style="display: none">
20 </div>
21 <pre id="test">
22 <script class="testbody" type="text/javascript">
24 const seqNum = 5;
26 function recursivefib(n) {
27 return n < 2 ? n : recursivefib(n - 1) + recursivefib(n - 2);
30 var worker = new Worker("fibonacci_worker.js");
32 worker.onmessage = function(event) {
33 is(event.target, worker);
34 is(event.data, recursivefib(seqNum));
35 SimpleTest.finish();
38 worker.onerror = function(event) {
39 is(event.target, worker);
40 ok(false, "Worker had an error: " + event.message);
41 SimpleTest.finish();
44 worker.postMessage(seqNum);
46 SimpleTest.waitForExplicitFinish();
48 </script>
49 </pre>
50 </body>
51 </html>