dom/file/tests/test_fileapi_other_worker.html
author Nicolas Silva <nsilva@mozilla.com>
Mon, 20 Aug 2018 15:23:54 +0200
changeset 432446 202fb9c610d07d734245e8b621eda8f80e3d2250
parent 386665 e81517c2358cb5794de1ebd07d6a9eb1677be61e
child 469641 ba6f655fd68963530c866d0d4a48c3db3d307777
permissions -rw-r--r--
Bug 1482109 - Hook the memory pressure observer up with WebRender. r=sotaro

<!DOCTYPE HTML>
<html>
<head>
  <title>Test for FileReader API in workers</title>
  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
  <script type="text/javascript" src="common_fileReader.js"></script>
</head>

<body>
<script class="testbody" type="text/javascript">

SimpleTest.waitForExplicitFinish();
SimpleTest.requestLongerTimeout(3);

test_setup()
.then(data => {
  let worker = new Worker('worker_fileReader.js');
  worker.postMessage({ tests: 'other', data });

  worker.onmessage = event => {
    if (event.data.type == 'finish') {
      SimpleTest.finish();
      return;
    }

    if (event.data.type == 'check') {
      ok(event.data.status, event.data.msg);
      return;
    }

    ok(false, "Unknown message.");
  }
});

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