mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-24 08:07:30 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
31
dom/tests/mochitest/fetch/sw_reroute.js
Normal file
31
dom/tests/mochitest/fetch/sw_reroute.js
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
var gRegistration;
|
||||
|
||||
function testScript(script) {
|
||||
function setupSW(registration) {
|
||||
gRegistration = registration;
|
||||
|
||||
var iframe = document.createElement("iframe");
|
||||
iframe.src = "reroute.html?" + script.replace(".js", "");
|
||||
document.body.appendChild(iframe);
|
||||
}
|
||||
|
||||
SpecialPowers.pushPrefEnv({
|
||||
"set": [["dom.serviceWorkers.enabled", true],
|
||||
["dom.serviceWorkers.testing.enabled", true],
|
||||
["dom.serviceWorkers.exemptFromPerDomainMax", true]]
|
||||
}, function() {
|
||||
navigator.serviceWorker.ready.then(setupSW);
|
||||
var scriptURL = location.href.includes("sw_empty_reroute.html")
|
||||
? "empty.js" : "reroute.js";
|
||||
navigator.serviceWorker.register(scriptURL, {scope: "/"});
|
||||
});
|
||||
}
|
||||
|
||||
function finishTest() {
|
||||
gRegistration.unregister().then(SimpleTest.finish, function(e) {
|
||||
dump("unregistration failed: " + e + "\n");
|
||||
SimpleTest.finish();
|
||||
});
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
Loading…
Add table
Add a link
Reference in a new issue