[Win] DRT should not use disk cache.
authorpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Jun 2017 14:56:43 +0000 (14:56 +0000)
committerpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Jun 2017 14:56:43 +0000 (14:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=173361

Reviewed by Darin Adler.

Like on macOS/iOS, DRT on Windows should only use memory cache.

* DumpRenderTree/win/DumpRenderTree.cpp:
(setDefaultsToConsistentValuesForTesting):
(prepareConsistentTestingEnvironment):

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

Tools/ChangeLog
Tools/DumpRenderTree/win/DumpRenderTree.cpp

index e922f1d..d75b47b 100644 (file)
@@ -1,3 +1,16 @@
+2017-06-14  Per Arne Vollan  <pvollan@apple.com>
+
+        [Win] DRT should not use disk cache.
+        https://bugs.webkit.org/show_bug.cgi?id=173361
+
+        Reviewed by Darin Adler.
+
+        Like on macOS/iOS, DRT on Windows should only use memory cache.
+
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (setDefaultsToConsistentValuesForTesting):
+        (prepareConsistentTestingEnvironment):
+
 2017-06-14  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
 
         MediaSource duration attribute should not be equal to Infinity when set to a value greater than 2^64
index 78d7565..7e36d5d 100644 (file)
@@ -930,9 +930,6 @@ static void setDefaultsToConsistentValuesForTesting()
     CFPreferencesSetAppValue(WebDatabaseDirectoryDefaultsKey, WebCore::pathByAppendingComponent(libraryPath, "Databases").createCFString().get(), appId.get());
     CFPreferencesSetAppValue(WebStorageDirectoryDefaultsKey, WebCore::pathByAppendingComponent(libraryPath, "LocalStorage").createCFString().get(), appId.get());
     CFPreferencesSetAppValue(WebKitLocalCacheDefaultsKey, WebCore::pathByAppendingComponent(libraryPath, "LocalCache").createCFString().get(), appId.get());
-
-    // Create separate cache for each DRT instance
-    setCacheFolder();
 #endif
 }
 
@@ -1469,6 +1466,9 @@ static void prepareConsistentTestingEnvironment(IWebPreferences* standardPrefere
     ASSERT(standardPreferencesPrivate);
     standardPreferences->setAutosaves(FALSE);
 
+    auto newCache = adoptCF(CFURLCacheCreate(kCFAllocatorDefault, 1024 * 1024, 0, nullptr));
+    CFURLCacheSetSharedURLCache(newCache.get());
+
     COMPtr<IWebPreferencesPrivate4> prefsPrivate4(Query, standardPreferences);
     prefsPrivate4->switchNetworkLoaderToNewTestingSession();