[EFL][WK2] Using different cache directory for each WTR process
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jul 2012 09:59:39 +0000 (09:59 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Jul 2012 09:59:39 +0000 (09:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=91719

Patch by Zoltan Nyul <zoltan.nyul@intel.com> on 2012-07-19
Reviewed by Kenneth Rohde Christiansen.

Source/WebKit2:

Make sure we return a valid application cache directory in
WebContextEfl.

* UIProcess/efl/WebContextEfl.cpp:
(WebKit::WebContext::applicationCacheDirectory):

Tools:

The testrunner script may be running multiple processes in
parallel, and it makes appcache tests fail if they are using the same
directory. I modified the EFL's LayoutTestController to use the
DUMPRENDERTREE_TEMP for application cache directory because it's
different for each process.

* WebKitTestRunner/CMakeLists.txt:
* WebKitTestRunner/InjectedBundle/efl/LayoutTestControllerEfl.cpp:
(WTR::LayoutTestController::platformInitialize):

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/efl/WebContextEfl.cpp
Tools/ChangeLog
Tools/WebKitTestRunner/CMakeLists.txt
Tools/WebKitTestRunner/InjectedBundle/efl/LayoutTestControllerEfl.cpp

index bc32696..c529722 100644 (file)
@@ -1,3 +1,16 @@
+2012-07-19  Zoltan Nyul  <zoltan.nyul@intel.com>
+
+        [EFL][WK2] Using different cache directory for each WTR process
+        https://bugs.webkit.org/show_bug.cgi?id=91719
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Make sure we return a valid application cache directory in
+        WebContextEfl.
+
+        * UIProcess/efl/WebContextEfl.cpp:
+        (WebKit::WebContext::applicationCacheDirectory):
+
 2012-07-18  Christophe Dumez  <christophe.dumez@intel.com>
 
         [EFL][WK2] EFL should use DownloadSoup instead of defining DownloadEfl
index ac77ef3..87f5d66 100644 (file)
 #include "WebContext.h"
 
 #include <WebCore/ApplicationCacheStorage.h>
+#include <WebCore/FileSystem.h>
 #include <WebCore/NotImplemented.h>
 
 namespace WebKit {
 
 String WebContext::applicationCacheDirectory()
 {
-    return WebCore::cacheStorage().cacheDirectory();
+    String cacheDir = WebCore::cacheStorage().cacheDirectory();
+    
+    // The WebKitTestRunner sets the cacheDirectory and
+    // we should not overwrite it.
+    if (cacheDir.isEmpty()) 
+        cacheDir = makeString(WebCore::homeDirectoryPath(), "/.webkit/Applications");
+
+    return cacheDir;
 }
 
 void WebContext::platformInitializeWebProcess(WebProcessCreationParameters&)
index 897ac3a..369ca13 100644 (file)
@@ -1,3 +1,20 @@
+2012-07-19  Zoltan Nyul  <zoltan.nyul@intel.com>
+
+        [EFL][WK2] Using different cache directory for each WTR process
+        https://bugs.webkit.org/show_bug.cgi?id=91719
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        The testrunner script may be running multiple processes in
+        parallel, and it makes appcache tests fail if they are using the same
+        directory. I modified the EFL's LayoutTestController to use the
+        DUMPRENDERTREE_TEMP for application cache directory because it's
+        different for each process.
+
+        * WebKitTestRunner/CMakeLists.txt:
+        * WebKitTestRunner/InjectedBundle/efl/LayoutTestControllerEfl.cpp:
+        (WTR::LayoutTestController::platformInitialize):
+
 2012-07-19  Mario Sanchez Prada  <msanchez@igalia.com>
 
         [WK2][GTK] Complete implementation of AccessibilityController in WKTR for GTK
index 4cc0501..c61c498 100644 (file)
@@ -24,9 +24,11 @@ SET(WebKitTestRunner_INCLUDE_DIRECTORIES
     ${JAVASCRIPTCORE_DIR}
     ${JAVASCRIPTCORE_DIR}/ForwardingHeaders
     ${WEBCORE_DIR}/editing
+    ${WEBCORE_DIR}/page
     ${WEBCORE_DIR}/platform
     ${WEBCORE_DIR}/platform/graphics
     ${WEBCORE_DIR}/platform/network
+    ${WEBCORE_DIR}/platform/sql
     ${WEBCORE_DIR}/platform/text
     ${WEBCORE_DIR}/testing/js
     ${WEBKIT2_DIR}/Shared
index b1b6f84..5f075ec 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "InjectedBundle.h"
 #include <Ecore.h>
+#include <WebCore/ApplicationCacheStorage.h>
 
 namespace WTR {
 
@@ -33,6 +34,11 @@ static Eina_Bool waitToDumpWatchdogTimerCallback(void*)
 
 void LayoutTestController::platformInitialize()
 {
+    // The testrunner script is may be running multiple processes in parallel,
+    // and it makes appcache tests fail if they are using the same directory.
+    // DUMPRENDERTREE_TEMP points to a different directory for each process.
+    String appCacheDirectory = makeString(String::fromUTF8(getenv("DUMPRENDERTREE_TEMP")), "/Applications");
+    WebCore::cacheStorage().setCacheDirectory(appCacheDirectory);
     m_waitToDumpWatchdogTimer = 0;
 }