dom/url/tests/test_worker_urlApi.html
author danielleleb <danielleleb12@gmail.com>
Tue, 12 Mar 2019 17:38:47 +0000
changeset 521608 f87b1c69a88d995473d2351fa55247774be9c395
parent 343073 85bb953e8fd0b2fd73b216a7c014bd72236bcd1f
child 528458 ba6f655fd68963530c866d0d4a48c3db3d307777
permissions -rw-r--r--
Bug 1532934 - Enable ESLint for dom/url (automatic changes). r=Standard8,baku Differential Revision: https://phabricator.services.mozilla.com/D22736

<!--
  Any copyright is dedicated to the Public Domain.
  http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE HTML>
<html>
<head>
  <title>Test for URL API object in workers</title>
  <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"></pre>
<script class="testbody" type="text/javascript">

  var worker = new Worker("urlApi_worker.js");

  worker.onmessage = function(event) {
    is(event.target, worker);

    if (event.data.type == "finish") {
      SimpleTest.finish();
    } else if (event.data.type == "status") {
      ok(event.data.status, event.data.msg);
    }
  };

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

  worker.postMessage(true);

  SimpleTest.waitForExplicitFinish();

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