Add API test to validate setting of service worker and cache storage directories
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Mar 2018 23:18:28 +0000 (23:18 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Mar 2018 23:18:28 +0000 (23:18 +0000)
commit6ac1a0000757cdc500f836e888b682e5286a9d9c
tree49c0c85420991f2c353bae93832f0d2178d13233
parentb31d9cf706507e524e131cf0a37a96e174110a39
Add API test to validate setting of service worker and cache storage directories
https://bugs.webkit.org/show_bug.cgi?id=182543

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

Source/WebCore:

Covered by API tests.

Add getters to service worker registration directory.

* testing/Internals.cpp:
(WebCore::Internals::serviceWorkerRegistrationDirectory):
* testing/Internals.h:
* testing/Internals.idl:
* workers/service/SWClientConnection.h:
* workers/service/server/RegistrationDatabase.h:
(WebCore::RegistrationDatabase::serviceWorkerRegistrationDirectory const):
* workers/service/server/RegistrationStore.h:
(WebCore::RegistrationStore::serviceWorkerRegistrationDirectory const):
* workers/service/server/SWServer.h:
(WebCore::SWServer::serviceWorkerRegistrationDirectory const):

Source/WebKit:

Add cache engine directory path to its representation dump.
This is used in API tests to check that the path is correctly set.

Add a way for to know whether a service worker was registered from a WKWebsiteDataStore.
This is used in API tests to check that the path is correctly set.

* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::representation):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _hasRegisteredServiceWorker]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:

LayoutTests:

Updated tests according new engine representation.

* http/tests/cache-storage/cache-clearing-origin.https.html:
* http/tests/cache-storage/cache-origins.https.html:
* http/tests/cache-storage/cache-representation.https.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/cache-storage/cache-clearing-origin.https.html
LayoutTests/http/tests/cache-storage/cache-origins.https.html
LayoutTests/http/tests/cache-storage/cache-representation.https.html
Source/WebCore/ChangeLog
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp
Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm