Bug 1155153 - [e10s] about:serviceworkers should work in e10s mode. Update B2G implementation. r=baku

This commit is contained in:
Fernando Jimenez 2015-06-10 16:27:17 +02:00
parent 0628a7464e
commit 400735b9ec
2 changed files with 22 additions and 10 deletions

View File

@ -130,7 +130,16 @@ this.AboutServiceWorkers = {
self.sendError(message.id, "MissingScope");
return;
}
gServiceWorkerManager.softUpdate(message.scope);
if (!message.principal ||
!message.principal.originAttributes) {
// XXX This will always error until bug 1171915 is fixed.
self.sendError(message.id, "MissingOriginAttributes");
return;
}
gServiceWorkerManager.propagateSoftUpdate({},
message.scope);
self.sendResult(message.id, true);
break;
@ -166,9 +175,9 @@ this.AboutServiceWorkers = {
Ci.nsIServiceWorkerUnregisterCallback
])
};
gServiceWorkerManager.unregister(principal,
serviceWorkerUnregisterCallback,
message.scope);
gServiceWorkerManager.propagateUnregister(principal,
serviceWorkerUnregisterCallback,
message.scope);
break;
}
}

View File

@ -128,12 +128,15 @@ add_test(function test_swm() {
"SWM.getAllRegistrations exists");
do_check_true(typeof gServiceWorkerManager.getAllRegistrations == "function",
"SWM.getAllRegistrations is a function");
do_check_true(gServiceWorkerManager.softUpdate, "SWM.softUpdate exists");
do_check_true(typeof gServiceWorkerManager.softUpdate == "function",
"SWM.softUpdate is a function");
do_check_true(gServiceWorkerManager.unregister, "SWM.unregister exists");
do_check_true(typeof gServiceWorkerManager.unregister == "function",
"SWM.unregister exists");
do_check_true(gServiceWorkerManager.propagateSoftUpdate,
"SWM.propagateSoftUpdate exists");
do_check_true(typeof gServiceWorkerManager.propagateSoftUpdate == "function",
"SWM.propagateSoftUpdate is a function");
do_check_true(gServiceWorkerManager.propagateUnregister,
"SWM.propagateUnregister exists");
do_check_true(typeof gServiceWorkerManager.propagateUnregister == "function",
"SWM.propagateUnregister exists");
run_next_test();
});