Bug 1039846 - Patch 6: Basic test runner. r=bkelly
authorNikhil Marathe <nsm.nikhil@gmail.com>
Fri, 02 Jan 2015 14:38:28 -0800
changeset 223599 8443140d7fcf57e0af143efd3fd19a0270dc6b8c
parent 223598 27b9f23fc9e50604d4fdde9bf88259cdf6f94e44
child 223600 c326a68d7bfab875be19aa5498a98fe47cde7737
push id28098
push userkwierso@gmail.com
push dateWed, 14 Jan 2015 00:52:19 +0000
treeherdermozilla-central@e978b8bc5c45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbkelly
bugs1039846
milestone38.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1039846 - Patch 6: Basic test runner. r=bkelly
dom/tests/mochitest/fetch/test_fetch_basic_worker.html
new file mode 100644
--- /dev/null
+++ b/dom/tests/mochitest/fetch/test_fetch_basic_worker.html
@@ -0,0 +1,48 @@
+<!--
+  Any copyright is dedicated to the Public Domain.
+  http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<!DOCTYPE HTML>
+<html>
+<head>
+  <title>Bug 1039846 - Test fetch() function in worker</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">
+
+  function runTest() {
+    var worker = new Worker("worker_test_fetch_basic.js");
+    worker.onmessage = function(event) {
+
+      if (event.data.type == 'finish') {
+        SimpleTest.finish();
+      } else if (event.data.type == 'status') {
+        ok(event.data.status, event.data.msg);
+      }
+    }
+
+    worker.onerror = function(event) {
+      ok(false, "Worker had an error: " + event.message + " at " + event.lineno);
+      SimpleTest.finish();
+    };
+
+    worker.postMessage(true);
+  }
+
+  SimpleTest.waitForExplicitFinish();
+
+  SpecialPowers.pushPrefEnv({"set": [
+    ["dom.fetch.enabled", true]
+  ]}, function() {
+    runTest();
+  });
+</script>
+</pre>
+</body>
+</html>
+