Backed out changeset 8ea3cf306727 (bug 1130570)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Tue, 17 Feb 2015 09:35:24 +0100
changeset 229442 b8e16e872989355a2fa5aed560dd47148730e64d
parent 229441 7cf148116396c911d129400f54a5a9ef111eeff0
child 229443 fc8879aec5fb30d7405f6b37000d056fcb9906f7
push id11352
push userryanvm@gmail.com
push dateTue, 17 Feb 2015 19:29:37 +0000
treeherderfx-team@b6c56fab513d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1130570
milestone38.0a1
backs out8ea3cf306727006ff4b82557f1b159b7957364b7
Backed out changeset 8ea3cf306727 (bug 1130570)
dom/workers/test/serviceworkers/controller/index.html
dom/workers/test/serviceworkers/test_controller.html
--- a/dom/workers/test/serviceworkers/controller/index.html
+++ b/dom/workers/test/serviceworkers/controller/index.html
@@ -12,21 +12,21 @@
 <body>
 <p id="display"></p>
 <div id="content" style="display: none"></div>
 <pre id="test"></pre>
 <script class="testbody" type="text/javascript">
 
   // Make sure to use good, unique messages, since the actual expression will not show up in test results.
   function my_ok(result, msg) {
-    parent.postMessage({status: "ok", result: result, message: msg}, "*");
+    window.opener.postMessage({status: "ok", result: result, message: msg}, "*");
   }
 
   function finish() {
-    parent.postMessage({status: "done"}, "*");
+    window.opener.postMessage({status: "done"}, "*");
   }
 
   navigator.serviceWorker.ready.then(function(swr) {
     my_ok(swr.scope.match(/serviceworkers\/control$/),
           "This page should be controlled by upper level registration");
     my_ok(swr.installing == undefined,
           "Upper level registration should not have a installing worker.");
     if (navigator.serviceWorker.controller) {
--- a/dom/workers/test/serviceworkers/test_controller.html
+++ b/dom/workers/test/serviceworkers/test_controller.html
@@ -10,48 +10,39 @@
   <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 content;
-  var iframe;
-
   function simpleRegister() {
     // We use the control scope for the less specific registration. The window will register a worker on controller/
     return navigator.serviceWorker.register("worker.js", { scope: "./control" });
   }
 
   function testController() {
     var p = new Promise(function(resolve, reject) {
       window.onmessage = function(e) {
         if (e.data.status == "ok") {
           ok(e.data.result, e.data.message);
         } else if (e.data.status == "done") {
           window.onmessage = null;
-          content.removeChild(iframe);
+          w.close();
           resolve();
         }
       }
     });
 
-    content = document.getElementById("content");
-    ok(content, "Parent exists.");
-
-    iframe = document.createElement("iframe");
-    iframe.setAttribute('src', "controller/index.html");
-    content.appendChild(iframe);
-
+    var w = window.open("controller/index.html");
     return p;
   }
 
-  // This document just flips the prefs and opens the iframe for the actual test.
+  // This document just flips the prefs and opens the window for the actual test.
   function runTest() {
     simpleRegister()
       .then(testController)
       .then(function() {
         SimpleTest.finish();
       }).catch(function(e) {
         ok(false, "Some test failed with error " + e);
         SimpleTest.finish();