dom/src/threads/test/test_regExpStatics.html
author L. David Baron <dbaron@dbaron.org>
Wed, 06 May 2009 13:46:04 -0700
changeset 28048 8f7b73d88f6bbedec99c6c8ef48b243ab922d05c
parent 27179 dee21486da6754af4d8fe75c53349f9380ebcdec
child 72853 baeec0ca76327b0a6011aae1dbaaf05a9202a028
permissions -rw-r--r--
Switch HTML mochitests from using MochiKit.js to packed.js. (Bug 490955) r=sayrer

<!DOCTYPE HTML>
<html>
<!--
Tests of DOM Worker Threads RegExp statics
-->
<head>
  <title>Test for DOM Worker Threads RegExp statics</title>
  <script type="text/javascript" src="/MochiKit/packed.js"></script>
  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none">

</div>
<pre id="test">
<script class="testbody" type="text/javascript">

  const WORKER_COUNT = 25;

  var doneWorkers = 0;
  function onmessage(event) {
    if (++doneWorkers == WORKER_COUNT) {
      ok(true, "All messages received from workers");
      SimpleTest.finish();
    }
  }

  function onerror(event) {
    ok(false, "Worker had an error: " + event.data);
    SimpleTest.finish();
  };

  for (var i = 0; i < WORKER_COUNT; i++) {
    var worker = new Worker("regExpStatics_worker.js");
    worker.onmessage = onmessage;
    worker.onerror = onerror;
    worker.postMessage("start");
  }

  SimpleTest.waitForExplicitFinish();

</script>
</pre>
</body>
</html>