Different WebKitTestRunner instances should use different service worker registration...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Dec 2017 19:36:32 +0000 (19:36 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Dec 2017 19:36:32 +0000 (19:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=180589

Reviewed by Brady Eidson.

Source/WebKit:

* UIProcess/API/C/WKContextConfigurationRef.cpp:
(WKContextConfigurationCopyServiceWorkerDatabaseDirectory):
(WKContextConfigurationSetServiceWorkerDatabaseDirectory):
* UIProcess/API/C/WKContextConfigurationRef.h:

Tools:

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::generateContextConfiguration const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225690 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/C/WKContextConfigurationRef.cpp
Source/WebKit/UIProcess/API/C/WKContextConfigurationRef.h
Tools/ChangeLog
Tools/WebKitTestRunner/TestController.cpp

index 12311ae..1705c50 100644 (file)
@@ -1,3 +1,15 @@
+2017-12-08  Chris Dumez  <cdumez@apple.com>
+
+        Different WebKitTestRunner instances should use different service worker registrations databases
+        https://bugs.webkit.org/show_bug.cgi?id=180589
+
+        Reviewed by Brady Eidson.
+
+        * UIProcess/API/C/WKContextConfigurationRef.cpp:
+        (WKContextConfigurationCopyServiceWorkerDatabaseDirectory):
+        (WKContextConfigurationSetServiceWorkerDatabaseDirectory):
+        * UIProcess/API/C/WKContextConfigurationRef.h:
+
 2017-12-08  Alex Christensen  <achristensen@webkit.org>
 
         Pass std::optional<WebsitePolicies> instead of WebsitePolicies
index 8ac81dd..66d96c2 100644 (file)
@@ -78,6 +78,16 @@ void WKContextConfigurationSetIndexedDBDatabaseDirectory(WKContextConfigurationR
     toImpl(configuration)->setIndexedDBDatabaseDirectory(toImpl(indexedDBDatabaseDirectory)->string());
 }
 
+WKStringRef WKContextConfigurationCopyServiceWorkerDatabaseDirectory(WKContextConfigurationRef configuration)
+{
+    return toCopiedAPI(toImpl(configuration)->serviceWorkerRegistrationDirectory());
+}
+
+void WKContextConfigurationSetServiceWorkerDatabaseDirectory(WKContextConfigurationRef configuration, WKStringRef swDatabaseDirectory)
+{
+    toImpl(configuration)->setServiceWorkerRegistrationDirectory(toImpl(swDatabaseDirectory)->string());
+}
+
 WKStringRef WKContextConfigurationCopyInjectedBundlePath(WKContextConfigurationRef configuration)
 {
     return toCopiedAPI(toImpl(configuration)->injectedBundlePath());
index d69bb85..59094cf 100644 (file)
@@ -44,6 +44,9 @@ WK_EXPORT void WKContextConfigurationSetDiskCacheDirectory(WKContextConfiguratio
 WK_EXPORT WKStringRef WKContextConfigurationCopyIndexedDBDatabaseDirectory(WKContextConfigurationRef configuration);
 WK_EXPORT void WKContextConfigurationSetIndexedDBDatabaseDirectory(WKContextConfigurationRef configuration, WKStringRef indexedDBDatabaseDirectory);
 
+WK_EXPORT WKStringRef WKContextConfigurationCopyServiceWorkerDatabaseDirectory(WKContextConfigurationRef configuration);
+WK_EXPORT void WKContextConfigurationSetServiceWorkerDatabaseDirectory(WKContextConfigurationRef configuration, WKStringRef swDatabaseDirectory);
+
 WK_EXPORT WKStringRef WKContextConfigurationCopyInjectedBundlePath(WKContextConfigurationRef configuration);
 WK_EXPORT void WKContextConfigurationSetInjectedBundlePath(WKContextConfigurationRef configuration, WKStringRef injectedBundlePath);
 
index 9105e62..93fe344 100644 (file)
@@ -1,3 +1,13 @@
+2017-12-08  Chris Dumez  <cdumez@apple.com>
+
+        Different WebKitTestRunner instances should use different service worker registrations databases
+        https://bugs.webkit.org/show_bug.cgi?id=180589
+
+        Reviewed by Brady Eidson.
+
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::generateContextConfiguration const):
+
 2017-12-08  Fujii Hironori  <Hironori.Fujii@sony.com>
 
         Tools/ImageDiff/cg/PlatformImageCG.cpp doesn't need to include <wtf/MathExtras.h>
index 38fab6f..9527149 100644 (file)
@@ -411,6 +411,7 @@ WKRetainPtr<WKContextConfigurationRef> TestController::generateContextConfigurat
         WKContextConfigurationSetApplicationCacheDirectory(configuration.get(), toWK(temporaryFolder + separator + "ApplicationCache").get());
         WKContextConfigurationSetDiskCacheDirectory(configuration.get(), toWK(temporaryFolder + separator + "Cache").get());
         WKContextConfigurationSetIndexedDBDatabaseDirectory(configuration.get(), toWK(temporaryFolder + separator + "Databases" + separator + "IndexedDB").get());
+        WKContextConfigurationSetServiceWorkerDatabaseDirectory(configuration.get(), toWK(temporaryFolder + separator + "ServiceWorkers").get());
         WKContextConfigurationSetLocalStorageDirectory(configuration.get(), toWK(temporaryFolder + separator + "LocalStorage").get());
         WKContextConfigurationSetWebSQLDatabaseDirectory(configuration.get(), toWK(temporaryFolder + separator + "Databases" + separator + "WebSQL").get());
         WKContextConfigurationSetMediaKeysStorageDirectory(configuration.get(), toWK(temporaryFolder + separator + "MediaKeys").get());