Bug 1252738 - Stop using CPOWs in this test. r=felipc, a=test-only
authorBlake Kaplan <mrbkap@gmail.com>
Tue, 05 Apr 2016 18:58:00 +0200
changeset 323844 11a1576c661ac9f9f693b7f3dcf03782009c55ba
parent 323843 b60a7bd60e507964e2822ff1a8984cede9273cd3
child 323845 f1c193f20df7ae8c91068d12cd04eaa55ad46d50
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipc, test-only
bugs1252738
milestone47.0a2
Bug 1252738 - Stop using CPOWs in this test. r=felipc, a=test-only
dom/indexedDB/test/browser_permissionsPrompt.html
dom/indexedDB/test/browser_permissionsPromptDeny.js
--- a/dom/indexedDB/test/browser_permissionsPrompt.html
+++ b/dom/indexedDB/test/browser_permissionsPrompt.html
@@ -1,14 +1,15 @@
 <!--
   Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/
 -->
 <html>
   <head>
+    <meta charset=UTF-8>
     <title>Indexed Database Test</title>
 
     <script type="text/javascript;version=1.7">
       function testSteps()
       {
         const name = window.location.pathname;
 
         let request = indexedDB.open(name, { version: 1,
--- a/dom/indexedDB/test/browser_permissionsPromptDeny.js
+++ b/dom/indexedDB/test/browser_permissionsPromptDeny.js
@@ -15,24 +15,26 @@ function setUsePrivateBrowsing(browser, 
 
   return ContentTask.spawn(browser, val, function* (val) {
     docShell.QueryInterface(Ci.nsILoadContext).usePrivateBrowsing = val;
   });
 };
 
 
 function promiseMessage(aMessage) {
-  return new Promise(function(resolve, reject) {
-    content.addEventListener("message", function messageListener(event) {
-      content.removeEventListener("message", messageListener);
-      is(event.data, aMessage, "received " + aMessage);
-      if (event.data == aMessage)
-        resolve();
-      else
-        reject();
+  return ContentTask.spawn(gBrowser.selectedBrowser, aMessage, function* (aMessage) {
+    yield new Promise((resolve, reject) => {
+      content.addEventListener("message", function messageListener(event) {
+        content.removeEventListener("message", messageListener);
+        is(event.data, aMessage, "received " + aMessage);
+        if (event.data == aMessage)
+          resolve();
+        else
+          reject();
+      });
     });
   });
 }
 
 add_task(function test1() {
   removePermission(testPageURL, "indexedDB");
 
   info("creating tab");