mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Bug 1186856 ServiceWorker .register() should always stop current registration from uninstalling. r=jdm
This commit is contained in:
parent
30e9c14eff
commit
f1ab7986b2
@ -945,10 +945,10 @@ public:
|
||||
mRegistration = swm->GetRegistration(mPrincipal, mScope);
|
||||
|
||||
if (mRegistration) {
|
||||
mRegistration->mPendingUninstall = false;
|
||||
RefPtr<ServiceWorkerInfo> newest = mRegistration->Newest();
|
||||
if (newest && mScriptSpec.Equals(newest->ScriptSpec()) &&
|
||||
mScriptSpec.Equals(mRegistration->mScriptSpec)) {
|
||||
mRegistration->mPendingUninstall = false;
|
||||
swm->StoreRegistration(mPrincipal, mRegistration);
|
||||
Succeed();
|
||||
|
||||
|
@ -1,8 +0,0 @@
|
||||
[unregister-then-register-new-script.https.html]
|
||||
type: testharness
|
||||
[Registering a new script URL while an unregistered registration is in use]
|
||||
expected: FAIL
|
||||
|
||||
[Registering a new script URL that fails to install does not resurrect an unregistered registration]
|
||||
expected: FAIL
|
||||
|
@ -103,14 +103,14 @@ async_test(function(t) {
|
||||
return with_iframe(scope);
|
||||
})
|
||||
.then(function(frame) {
|
||||
assert_equals(frame.contentWindow.navigator.serviceWorker.controller,
|
||||
null,
|
||||
'document should not load with a controller');
|
||||
assert_equals(frame.contentWindow.navigator.serviceWorker.controller.scriptURL,
|
||||
normalizeURL(worker_url),
|
||||
'register() should always abort uninstalling the registration');
|
||||
frame.remove();
|
||||
t.done();
|
||||
})
|
||||
.catch(unreached_rejection(t));
|
||||
}, 'Registering a new script URL that 404s does not resurrect an ' +
|
||||
}, 'Registering a new script URL that 404s does resurrect an ' +
|
||||
'unregistered registration');
|
||||
|
||||
async_test(function(t) {
|
||||
@ -144,9 +144,9 @@ async_test(function(t) {
|
||||
return with_iframe(scope);
|
||||
})
|
||||
.then(function(frame) {
|
||||
assert_equals(frame.contentWindow.navigator.serviceWorker.controller,
|
||||
null,
|
||||
'document should not load with a controller');
|
||||
assert_equals(frame.contentWindow.navigator.serviceWorker.controller.scriptURL,
|
||||
normalizeURL(worker_url),
|
||||
'register() should always abort uninstalling the registration');
|
||||
frame.remove();
|
||||
return registration.unregister();
|
||||
})
|
||||
@ -154,6 +154,6 @@ async_test(function(t) {
|
||||
t.done();
|
||||
})
|
||||
.catch(unreached_rejection(t));
|
||||
}, 'Registering a new script URL that fails to install does not resurrect ' +
|
||||
}, 'Registering a new script URL that fails to install does resurrect ' +
|
||||
'an unregistered registration');
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user