зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 8ea3cf306727 (bug 1130570)
This commit is contained in:
Родитель
43d92156e1
Коммит
b4ce75fd92
|
@ -17,11 +17,11 @@
|
||||||
|
|
||||||
// Make sure to use good, unique messages, since the actual expression will not show up in test results.
|
// Make sure to use good, unique messages, since the actual expression will not show up in test results.
|
||||||
function my_ok(result, msg) {
|
function my_ok(result, msg) {
|
||||||
parent.postMessage({status: "ok", result: result, message: msg}, "*");
|
window.opener.postMessage({status: "ok", result: result, message: msg}, "*");
|
||||||
}
|
}
|
||||||
|
|
||||||
function finish() {
|
function finish() {
|
||||||
parent.postMessage({status: "done"}, "*");
|
window.opener.postMessage({status: "done"}, "*");
|
||||||
}
|
}
|
||||||
|
|
||||||
navigator.serviceWorker.ready.then(function(swr) {
|
navigator.serviceWorker.ready.then(function(swr) {
|
||||||
|
|
|
@ -15,9 +15,6 @@
|
||||||
<pre id="test"></pre>
|
<pre id="test"></pre>
|
||||||
<script class="testbody" type="text/javascript">
|
<script class="testbody" type="text/javascript">
|
||||||
|
|
||||||
var content;
|
|
||||||
var iframe;
|
|
||||||
|
|
||||||
function simpleRegister() {
|
function simpleRegister() {
|
||||||
// We use the control scope for the less specific registration. The window will register a worker on controller/
|
// 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" });
|
return navigator.serviceWorker.register("worker.js", { scope: "./control" });
|
||||||
|
@ -30,23 +27,17 @@
|
||||||
ok(e.data.result, e.data.message);
|
ok(e.data.result, e.data.message);
|
||||||
} else if (e.data.status == "done") {
|
} else if (e.data.status == "done") {
|
||||||
window.onmessage = null;
|
window.onmessage = null;
|
||||||
content.removeChild(iframe);
|
w.close();
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
content = document.getElementById("content");
|
var w = window.open("controller/index.html");
|
||||||
ok(content, "Parent exists.");
|
|
||||||
|
|
||||||
iframe = document.createElement("iframe");
|
|
||||||
iframe.setAttribute('src', "controller/index.html");
|
|
||||||
content.appendChild(iframe);
|
|
||||||
|
|
||||||
return p;
|
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() {
|
function runTest() {
|
||||||
simpleRegister()
|
simpleRegister()
|
||||||
.then(testController)
|
.then(testController)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче