From 144da2ac2141590fe03f04bb3d8e45f9f45d94fd Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Wed, 23 Sep 2015 19:40:51 +0100 Subject: [PATCH] Bug 1205676 - Enable WPT service-worker/unregister-then-register-new-script.https.html in e10s, r=nsm --- dom/workers/ServiceWorkerManager.cpp | 5 ++--- dom/workers/ServiceWorkerManager.h | 2 -- ...er-then-register-new-script.https.html.ini | 21 +------------------ 3 files changed, 3 insertions(+), 25 deletions(-) diff --git a/dom/workers/ServiceWorkerManager.cpp b/dom/workers/ServiceWorkerManager.cpp index ef6d4d833511..ee0ac647dc91 100644 --- a/dom/workers/ServiceWorkerManager.cpp +++ b/dom/workers/ServiceWorkerManager.cpp @@ -3376,7 +3376,6 @@ ServiceWorkerManager::FindScopeForPath(const nsACString& aScopeKey, return false; } -#ifdef DEBUG /* static */ bool ServiceWorkerManager::HasScope(nsIPrincipal* aPrincipal, const nsACString& aScope) @@ -3397,7 +3396,6 @@ ServiceWorkerManager::HasScope(nsIPrincipal* aPrincipal, return data->mOrderedScopes.Contains(aScope); } -#endif /* static */ void ServiceWorkerManager::RemoveScopeAndRegistration(ServiceWorkerRegistrationInfo* aRegistration) @@ -4636,7 +4634,8 @@ ServiceWorkerManager::MaybeRemoveRegistration(ServiceWorkerRegistrationInfo* aRe { MOZ_ASSERT(aRegistration); nsRefPtr newest = aRegistration->Newest(); - if (!newest) { + if (!newest && HasScope(aRegistration->mPrincipal, aRegistration->mScope)) { + aRegistration->Clear(); RemoveRegistration(aRegistration); } } diff --git a/dom/workers/ServiceWorkerManager.h b/dom/workers/ServiceWorkerManager.h index eb6ed2e18969..aca63dbd6458 100644 --- a/dom/workers/ServiceWorkerManager.h +++ b/dom/workers/ServiceWorkerManager.h @@ -520,10 +520,8 @@ private: const nsACString& aPath, RegistrationDataPerPrincipal** aData, nsACString& aMatch); -#ifdef DEBUG static bool HasScope(nsIPrincipal* aPrincipal, const nsACString& aScope); -#endif static void RemoveScopeAndRegistration(ServiceWorkerRegistrationInfo* aRegistration); diff --git a/testing/web-platform/mozilla/meta/service-workers/service-worker/unregister-then-register-new-script.https.html.ini b/testing/web-platform/mozilla/meta/service-workers/service-worker/unregister-then-register-new-script.https.html.ini index 08e155bbbc90..01c6dd3d5a51 100644 --- a/testing/web-platform/mozilla/meta/service-workers/service-worker/unregister-then-register-new-script.https.html.ini +++ b/testing/web-platform/mozilla/meta/service-workers/service-worker/unregister-then-register-new-script.https.html.ini @@ -1,24 +1,5 @@ [unregister-then-register-new-script.https.html] - type: testharness - disabled: - if e10s: https://bugzilla.mozilla.org/show_bug.cgi?id=1205675 - expected: - if debug and not e10s and (os == "mac") and (version == "OS X 10.10.2") and (processor == "x86_64") and (bits == 64): CRASH - if debug and not e10s and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86_64") and (bits == 64): CRASH - if not debug and e10s and (os == "mac") and (version == "OS X 10.10.2") and (processor == "x86") and (bits == 32): OK - if not debug and not e10s and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86") and (bits == 32): OK - if not debug and not e10s and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86_64") and (bits == 64): OK - if not debug and e10s and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86_64") and (bits == 64): OK - if debug and not e10s and (os == "win") and (version == "5.1.2600") and (processor == "x86") and (bits == 32): CRASH - if not debug and not e10s and (os == "mac") and (version == "OS X 10.10.2") and (processor == "x86") and (bits == 32): OK - if not debug and e10s and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86") and (bits == 32): OK - if not debug and not e10s and (os == "win") and (version == "5.1.2600") and (processor == "x86") and (bits == 32): OK - if not debug and not e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): OK - if not debug and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): OK - if debug and not e10s and (os == "win") and (version == "6.2.9200") and (processor == "x86_64") and (bits == 64): CRASH - if debug and not e10s and (os == "linux") and (version == "Ubuntu 12.04") and (processor == "x86") and (bits == 32): CRASH - if debug and not e10s and (os == "win") and (version == "6.1.7601") and (processor == "x86") and (bits == 32): CRASH - TIMEOUT + [Registering a new script URL while an unregistered registration is in use] expected: FAIL