Clearing all service worker registrations should wait for importing service worker...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Feb 2018 21:08:58 +0000 (21:08 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Feb 2018 21:08:58 +0000 (21:08 +0000)
commit16aa937d2c27957ac67f4e3dd25a6994e9b4d593
tree7bdffbd768c948efcd672c053ba79a8dbb3ee3a4
parente8f8e890669844230df16e04354e99cc6e33d03e
Clearing all service worker registrations should wait for importing service worker registration to finish
https://bugs.webkit.org/show_bug.cgi?id=182407

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-02
Reviewed by Chris Dumez.

Source/WebCore:

Covered by existing tests and the service worker API test being no longer flaky.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::registrationStoreImportComplete):
(WebCore::SWServer::clearAll):
(WebCore::SWServer::clear):
(WebCore::SWServer::getOriginsWithRegistrations):
* workers/service/server/SWServer.h:

Source/WebKit:

Updating API to take a completion handler.

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:

Tools:

Make sure we finish clearing service worker registrations before running tests.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):
(WTR::ClearServiceWorkerRegistrationsCallbackContext::ClearServiceWorkerRegistrationsCallbackContext):
(WTR::clearServiceWorkerRegistrationsCallback):
(WTR::TestController::clearServiceWorkerRegistrations):
* WebKitTestRunner/TestController.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228025 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/workers/service/server/SWServer.cpp
Source/WebCore/workers/service/server/SWServer.h
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp
Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.h
Tools/ChangeLog
Tools/WebKitTestRunner/TestController.cpp
Tools/WebKitTestRunner/TestController.h