gecko-dev/dom/serviceworkers
Blake Kaplan 19781c9ae7 Bug 1517406 - Resolve a race between the controlled iframe and the SW. r=asuth
Summary:

This test first creates a service worker and then an iframe. It expects the
iframe's first load to be through the network (and for the page's script to
fail to load). Once the page is set up and controlled by the SW, it reloads it
(a soft reload) and the script load is intercepted by the service worker and
we load a script that calls back into the test. However, there is currently no
guarantee that the service worker won't activate before the iframe load and
end up controlling the first load of the iframe.

With this patch, we delay the service worker's activation until we start
loading the iframe, allowing the first load to always be uncontrolled, thereby
resolving the race.

Reviewers: asuth

Reviewed By: asuth

Bug #: 1517406

Differential Revision: https://phabricator.services.mozilla.com/D15637

--HG--
extra : rebase_source : ff63b131b1a395289cda85ec4b46daa3022b08b4
2019-01-29 15:41:10 -05:00
..
test Bug 1517406 - Resolve a race between the controlled iframe and the SW. r=asuth 2019-01-29 15:41:10 -05:00
IPCServiceWorkerDescriptor.ipdlh Bug 1471706 P1 Track each registration state change with a version number stored on the descriptor. r=mrbkap 2018-07-02 07:44:19 -07:00
IPCServiceWorkerRegistrationDescriptor.ipdlh Bug 1459209 P14 Implement RemoteServiceWorkerContainerImpl::GetRegistrations() across IPC to the parent-side SWM. r=mrbkap 2018-07-09 16:02:41 -07:00
moz.build Bug 1509135 - Only define UnregisterCallback once r=mrbkap 2018-11-27 00:58:44 +00:00
PServiceWorker.ipdl Bug 1459209 P8 Implement RemoteServiceWorkerImpl::PostMessage() across IPC and to the parent-side SWM. r=mrbkap 2018-07-09 16:02:40 -07:00
PServiceWorkerContainer.ipdl Bug 1459209 P15 Implement RemoteServiceWorkerContainerImpl::GetReady() across IPC to the parent-side SWM. r=mrbkap 2018-07-09 16:02:41 -07:00
PServiceWorkerManager.ipdl
PServiceWorkerRegistration.ipdl Bug 1510809 - Fire updatefound correctly for SWC.register r=asuth 2018-11-29 23:06:32 +00:00
PServiceWorkerUpdater.ipdl
RemoteServiceWorkerContainerImpl.cpp Bug 1512298 - Make IPDL MozPromise exclusive. r=gerald,froydnj 2018-12-11 19:22:26 +00:00
RemoteServiceWorkerContainerImpl.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
RemoteServiceWorkerImpl.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
RemoteServiceWorkerImpl.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
RemoteServiceWorkerRegistrationImpl.cpp Bug 1512298 - Make IPDL MozPromise exclusive. r=gerald,froydnj 2018-12-11 19:22:26 +00:00
RemoteServiceWorkerRegistrationImpl.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorker.cpp Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre 2019-01-18 10:16:18 +01:00
ServiceWorker.h Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre 2019-01-18 10:16:18 +01:00
ServiceWorkerActors.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerActors.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerChild.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerChild.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerCloneData.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerCloneData.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerContainer.cpp Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre 2019-01-18 10:16:18 +01:00
ServiceWorkerContainer.h Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug 2019-01-03 17:48:33 +01:00
ServiceWorkerContainerChild.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerContainerChild.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerContainerImpl.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerContainerImpl.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerContainerParent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerContainerParent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerContainerProxy.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerContainerProxy.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerDescriptor.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerDescriptor.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerEvents.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerEvents.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerImpl.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerImpl.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerInfo.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerInfo.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerInterceptController.cpp Bug 1511303 - Ensure that visiting a page with an iframe does not cause an entry to be injected in the Cookies subpanel in the Control Centre; r=baku 2018-12-18 23:20:30 +00:00
ServiceWorkerInterceptController.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerIPCUtils.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerJob.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerJob.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerJobQueue.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerJobQueue.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerManager.cpp Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre 2019-01-18 10:16:18 +01:00
ServiceWorkerManager.h Bug 1512456 - P6. Tidy up some MozPromise usage. r=gerald 2018-12-11 10:54:48 +00:00
ServiceWorkerManagerChild.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerManagerChild.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerManagerParent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerManagerParent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerManagerService.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerManagerService.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerParent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerParent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerPrivate.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerPrivate.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerProxy.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerProxy.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerRegisterJob.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerRegisterJob.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerRegistrar.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerRegistrar.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerRegistrarTypes.ipdlh
ServiceWorkerRegistration.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerRegistration.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerRegistrationChild.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerRegistrationChild.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerRegistrationDescriptor.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerRegistrationDescriptor.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerRegistrationImpl.cpp Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug 2019-01-03 17:48:33 +01:00
ServiceWorkerRegistrationImpl.h Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug 2019-01-03 17:48:33 +01:00
ServiceWorkerRegistrationInfo.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerRegistrationInfo.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerRegistrationListener.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerRegistrationParent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerRegistrationParent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerRegistrationProxy.cpp Bug 1512456 - P3. Minor cleanup usage of GenericPromise. r=gerald 2018-12-11 10:46:21 +00:00
ServiceWorkerRegistrationProxy.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerScriptCache.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerScriptCache.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerUnregisterCallback.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerUnregisterCallback.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerUnregisterJob.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerUnregisterJob.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerUpdateJob.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerUpdateJob.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerUpdaterChild.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerUpdaterChild.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerUpdaterParent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerUpdaterParent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerUtils.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ServiceWorkerUtils.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00