Bug 1027221 - Test that promises can be resolved with a PermanentAtom string; r=terrence
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 18 Jun 2014 14:36:22 -0400
changeset 191254 680aabc0973c93c42bec40af379c462e25b11f5e
parent 191253 0216995f0aa8169b43fb1236baf54ecbf5838a23
child 191255 ce4166ba83b9c5e636879f45f5ed6730004ab8a7
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersterrence
bugs1027221
milestone33.0a1
Bug 1027221 - Test that promises can be resolved with a PermanentAtom string; r=terrence
dom/workers/test/mochitest.ini
dom/workers/test/test_promise_resolved_with_string.html
--- a/dom/workers/test/mochitest.ini
+++ b/dom/workers/test/mochitest.ini
@@ -118,16 +118,17 @@ skip-if = (toolkit == 'gonk' && debug) #
 [test_longThread.html]
 [test_multi_sharedWorker.html]
 [test_multi_sharedWorker_lifetimes.html]
 [test_navigator.html]
 [test_newError.html]
 [test_onLine.html]
 skip-if = (toolkit == 'gonk' && debug) #debug-only failure
 [test_promise.html]
+[test_promise_resolved_with_string.html]
 [test_recursion.html]
 [test_recursiveOnerror.html]
 [test_relativeLoad.html]
 skip-if = buildapp == 'b2g' # b2g(Failed to load script: relativeLoad_import.js) b2g-debug(Failed to load script: relativeLoad_import.js) b2g-desktop(Failed to load script: relativeLoad_import.js)
 [test_resolveWorker-assignment.html]
 [test_resolveWorker.html]
 [test_rvals.html]
 [test_sharedWorker.html]
new file mode 100644
--- /dev/null
+++ b/dom/workers/test/test_promise_resolved_with_string.html
@@ -0,0 +1,41 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1027221
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test for Bug 1027221</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  <script type="application/javascript">
+
+  /** Test for Bug 1027221 **/
+    // Set up a permanent atom
+    SimpleTest.waitForExplicitFinish();
+    var x = "x";
+    // Trigger some incremental gc
+    SpecialPowers.Cu.getJSTestingFunctions().gcslice(0);
+
+    // Kick off a worker that uses this same atom
+    var w = new Worker("data:text/plain,Promise.resolve('x').then(function() { postMessage(1); });");
+    // Maybe trigger some more incremental gc
+    SpecialPowers.Cu.getJSTestingFunctions().gcslice(0);
+
+    w.onmessage = function() {
+      ok(true, "Got here");
+      SimpleTest.finish();
+    };
+
+  </script>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1027221">Mozilla Bug 1027221</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+
+</div>
+<pre id="test">
+</pre>
+</body>
+</html>