Title: [96405] trunk
Revision
96405
Author
qi.2.zh...@nokia.com
Date
2011-09-30 10:26:14 -0700 (Fri, 30 Sep 2011)

Log Message

WebKitTestRunner needs layoutTestController.setAppCacheMaximumSize
https://bugs.webkit.org/show_bug.cgi?id=42698

Reviewed by Andreas Kling.

Source/WebKit2:

Implemented layoutTestController.setAppCacheMaximumSize and layoutTestController.clearApplicationCache,
and call clearApplicationCache when layoutTest start up.

* WebProcess/ApplicationCache/WebApplicationCacheManager.cpp:
(WebKit::WebApplicationCacheManager::setAppCacheMaximumSize):
* WebProcess/ApplicationCache/WebApplicationCacheManager.h:
* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleClearApplicationCache):
(WKBundleSetAppCacheMaximumSize):
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::clearApplicationCache):
(WebKit::InjectedBundle::setAppCacheMaximumSize):
* WebProcess/InjectedBundle/InjectedBundle.h:

Tools:

Implemented layoutTestController.setAppCacheMaximumSize and layoutTestController.clearApplicationCache,
and call clearApplicationCache when layoutTest start up.

* WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
(WTR::LayoutTestController::clearAllApplicationCaches):
(WTR::LayoutTestController::setAppCacheMaximumSize):
* WebKitTestRunner/InjectedBundle/LayoutTestController.h:

LayoutTests:

Removed http/tests/appcache/max-size.html from skipped list, and also the "failed" expected file for http/tests/appcache/interrupted-update-expected.html

* platform/mac-wk2/http/tests/appcache: Removed.
* platform/mac-wk2/http/tests/appcache/interrupted-update-expected.txt: Removed.
* platform/wk2/Skipped:

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (96404 => 96405)


--- trunk/LayoutTests/ChangeLog	2011-09-30 17:05:22 UTC (rev 96404)
+++ trunk/LayoutTests/ChangeLog	2011-09-30 17:26:14 UTC (rev 96405)
@@ -1,3 +1,16 @@
+2011-09-30  Qi Zhang  <qi.2.zh...@nokia.com>
+
+        WebKitTestRunner needs layoutTestController.setAppCacheMaximumSize
+        https://bugs.webkit.org/show_bug.cgi?id=42698
+
+        Reviewed by Andreas Kling.
+
+        Removed http/tests/appcache/max-size.html from skipped list, and also the "failed" expected file for http/tests/appcache/interrupted-update-expected.html
+
+        * platform/mac-wk2/http/tests/appcache: Removed.
+        * platform/mac-wk2/http/tests/appcache/interrupted-update-expected.txt: Removed.
+        * platform/wk2/Skipped:
+
 2011-09-30  Ned Holbrook  <nholbr...@apple.com>
 
         Complex spaces with synthetic bold are too wide

Deleted: trunk/LayoutTests/platform/mac-wk2/http/tests/appcache/interrupted-update-expected.txt (96404 => 96405)


--- trunk/LayoutTests/platform/mac-wk2/http/tests/appcache/interrupted-update-expected.txt	2011-09-30 17:05:22 UTC (rev 96404)
+++ trunk/LayoutTests/platform/mac-wk2/http/tests/appcache/interrupted-update-expected.txt	2011-09-30 17:26:14 UTC (rev 96405)
@@ -1,7 +0,0 @@
-Test that an application cache update works again after interruption.
-
-CHECKING
-NOUPDATE
-
-FAIL - the cache was already present, so we couldn't test initial loading
-

Modified: trunk/LayoutTests/platform/wk2/Skipped (96404 => 96405)


--- trunk/LayoutTests/platform/wk2/Skipped	2011-09-30 17:05:22 UTC (rev 96404)
+++ trunk/LayoutTests/platform/wk2/Skipped	2011-09-30 17:26:14 UTC (rev 96405)
@@ -709,10 +709,6 @@
 # <https://bugs.webkit.org/show_bug.cgi?id=42696>
 security/set-form-autocomplete-attribute.html
 
-# WebKitTestRunner needs layoutTestController.setAppCacheMaximumSize
-# <https://bugs.webkit.org/show_bug.cgi?id=42698>
-http/tests/appcache/max-size.html
-
 # WebKitTestRunner needs layoutTestController.setWillSendRequestClearHeader
 # <https://bugs.webkit.org/show_bug.cgi?id=42699>
 http/tests/security/no-referrer.html

Modified: trunk/Source/WebKit2/ChangeLog (96404 => 96405)


--- trunk/Source/WebKit2/ChangeLog	2011-09-30 17:05:22 UTC (rev 96404)
+++ trunk/Source/WebKit2/ChangeLog	2011-09-30 17:26:14 UTC (rev 96405)
@@ -1,3 +1,25 @@
+2011-09-30  Qi Zhang  <qi.2.zh...@nokia.com>
+
+        WebKitTestRunner needs layoutTestController.setAppCacheMaximumSize
+        https://bugs.webkit.org/show_bug.cgi?id=42698
+
+        Reviewed by Andreas Kling.
+
+        Implemented layoutTestController.setAppCacheMaximumSize and layoutTestController.clearApplicationCache,
+        and call clearApplicationCache when layoutTest start up.
+
+        * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp:
+        (WebKit::WebApplicationCacheManager::setAppCacheMaximumSize):
+        * WebProcess/ApplicationCache/WebApplicationCacheManager.h:
+        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
+        (WKBundleClearApplicationCache):
+        (WKBundleSetAppCacheMaximumSize):
+        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::clearApplicationCache):
+        (WebKit::InjectedBundle::setAppCacheMaximumSize):
+        * WebProcess/InjectedBundle/InjectedBundle.h:
+
 2011-09-30  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [UNIX] Add a method to get information for an already loaded plugin module

Modified: trunk/Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.cpp (96404 => 96405)


--- trunk/Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.cpp	2011-09-30 17:05:22 UTC (rev 96404)
+++ trunk/Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.cpp	2011-09-30 17:26:14 UTC (rev 96405)
@@ -99,4 +99,11 @@
     cacheStorage().deleteAllEntries();
 }
 
+void WebApplicationCacheManager::setAppCacheMaximumSize(uint64_t size)
+{
+    WebProcess::LocalTerminationDisabler terminationDisabler(WebProcess::shared());
+
+    cacheStorage().setMaximumSize(size);
+}
+
 } // namespace WebKit

Modified: trunk/Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.h (96404 => 96405)


--- trunk/Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.h	2011-09-30 17:05:22 UTC (rev 96404)
+++ trunk/Source/WebKit2/WebProcess/ApplicationCache/WebApplicationCacheManager.h	2011-09-30 17:26:14 UTC (rev 96405)
@@ -47,12 +47,13 @@
 
     void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
 
+    void deleteAllEntries();
+    void setAppCacheMaximumSize(uint64_t);
 private:
     WebApplicationCacheManager();
     
     void getApplicationCacheOrigins(uint64_t callbackID);
     void deleteEntriesForOrigin(const SecurityOriginData&);
-    void deleteAllEntries();
 
     void didReceiveWebApplicationCacheManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
 };

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp (96404 => 96405)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp	2011-09-30 17:05:22 UTC (rev 96404)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp	2011-09-30 17:26:14 UTC (rev 96405)
@@ -191,6 +191,16 @@
     toImpl(bundleRef)->setDatabaseQuota(quota);
 }
 
+void WKBundleClearApplicationCache(WKBundleRef bundleRef)
+{
+    toImpl(bundleRef)->clearApplicationCache();
+}
+
+void WKBundleSetAppCacheMaximumSize(WKBundleRef bundleRef, uint64_t size)
+{
+    toImpl(bundleRef)->setAppCacheMaximumSize(size);
+}
+
 int WKBundleNumberOfPages(WKBundleRef bundleRef, WKBundleFrameRef frameRef, double pageWidthInPixels, double pageHeightInPixels)
 {
     return toImpl(bundleRef)->numberOfPages(toImpl(frameRef), pageWidthInPixels, pageHeightInPixels);

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h (96404 => 96405)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h	2011-09-30 17:05:22 UTC (rev 96404)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h	2011-09-30 17:26:14 UTC (rev 96405)
@@ -73,6 +73,8 @@
 WK_EXPORT void WKBundleSetAuthorAndUserStylesEnabled(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
 WK_EXPORT void WKBundleClearAllDatabases(WKBundleRef bundle);
 WK_EXPORT void WKBundleSetDatabaseQuota(WKBundleRef bundle, uint64_t);
+WK_EXPORT void WKBundleClearApplicationCache(WKBundleRef bundle);
+WK_EXPORT void WKBundleSetAppCacheMaximumSize(WKBundleRef bundle, uint64_t size);
 WK_EXPORT int WKBundleNumberOfPages(WKBundleRef bundle, WKBundleFrameRef frameRef, double pageWidthInPixels, double pageHeightInPixels);
 WK_EXPORT int WKBundlePageNumberForElementById(WKBundleRef bundle, WKBundleFrameRef frameRef, WKStringRef idRef, double pageWidthInPixels, double pageHeightInPixels);
 WK_EXPORT WKStringRef WKBundlePageSizeAndMarginsInPixels(WKBundleRef bundle, WKBundleFrameRef frameRef, int, int, int, int, int, int, int);

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (96404 => 96405)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2011-09-30 17:05:22 UTC (rev 96404)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp	2011-09-30 17:26:14 UTC (rev 96405)
@@ -33,6 +33,7 @@
 #include "InjectedBundleUserMessageCoders.h"
 #include "WKAPICast.h"
 #include "WKBundleAPICast.h"
+#include "WebApplicationCacheManager.h"
 #include "WebContextMessageKinds.h"
 #include "WebCoreArgumentCoders.h"
 #include "WebDatabaseManager.h"
@@ -193,6 +194,16 @@
     WebDatabaseManager::shared().setQuotaForOrigin("file:///", quota);
 }
 
+void InjectedBundle::clearApplicationCache()
+{
+    WebApplicationCacheManager::shared().deleteAllEntries();
+}
+
+void InjectedBundle::setAppCacheMaximumSize(uint64_t size)
+{
+    WebApplicationCacheManager::shared().setAppCacheMaximumSize(size);
+}
+
 int InjectedBundle::numberOfPages(WebFrame* frame, double pageWidthInPixels, double pageHeightInPixels)
 {
     Frame* coreFrame = frame ? frame->coreFrame() : 0;

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h (96404 => 96405)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h	2011-09-30 17:05:22 UTC (rev 96404)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h	2011-09-30 17:26:14 UTC (rev 96405)
@@ -123,6 +123,10 @@
     void clearAllDatabases();
     void setDatabaseQuota(uint64_t);
 
+    // Application Cache API
+    void clearApplicationCache();
+    void setAppCacheMaximumSize(uint64_t);
+
     // Garbage collection API
     void garbageCollectJavaScriptObjects();
     void garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging(bool waitUntilDone);

Modified: trunk/Tools/ChangeLog (96404 => 96405)


--- trunk/Tools/ChangeLog	2011-09-30 17:05:22 UTC (rev 96404)
+++ trunk/Tools/ChangeLog	2011-09-30 17:26:14 UTC (rev 96405)
@@ -1,3 +1,21 @@
+2011-09-30  Qi Zhang  <qi.2.zh...@nokia.com>
+
+        WebKitTestRunner needs layoutTestController.setAppCacheMaximumSize
+        https://bugs.webkit.org/show_bug.cgi?id=42698
+
+        Reviewed by Andreas Kling.
+
+        Implemented layoutTestController.setAppCacheMaximumSize and layoutTestController.clearApplicationCache,
+        and call clearApplicationCache when layoutTest start up.
+
+        * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+        (WTR::InjectedBundle::beginTesting):
+        * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+        (WTR::LayoutTestController::clearAllApplicationCaches):
+        (WTR::LayoutTestController::setAppCacheMaximumSize):
+        * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+
 2011-09-30  Zeno Albisser  <zeno.albis...@nokia.com>
 
         [Qt][WK2] Change WebKitTestRunner to use QMouseEvents instead of QGraphicsSceneMouseEvents

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl (96404 => 96405)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl	2011-09-30 17:05:22 UTC (rev 96404)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl	2011-09-30 17:26:14 UTC (rev 96405)
@@ -96,6 +96,10 @@
         void setDatabaseQuota(in unsigned long long quota);
         DOMString pathToLocalResource(in DOMString url);
 
+        // Application Cache API
+        void clearAllApplicationCaches();
+        void setAppCacheMaximumSize(in unsigned long long size);
+
         // Compositing testing.
         DOMString layerTreeAsText();
 

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (96404 => 96405)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp	2011-09-30 17:05:22 UTC (rev 96404)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp	2011-09-30 17:26:14 UTC (rev 96405)
@@ -190,6 +190,7 @@
     page()->reset();
 
     WKBundleClearAllDatabases(m_bundle);
+    WKBundleClearApplicationCache(m_bundle);
     WKBundleResetOriginAccessWhitelists(m_bundle);
 }
 

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp (96404 => 96405)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp	2011-09-30 17:05:22 UTC (rev 96404)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp	2011-09-30 17:26:14 UTC (rev 96405)
@@ -327,6 +327,16 @@
     return WKBundleSetDatabaseQuota(InjectedBundle::shared().bundle(), quota);
 }
 
+void LayoutTestController::clearAllApplicationCaches()
+{
+    WKBundleClearApplicationCache(InjectedBundle::shared().bundle());
+}
+
+void LayoutTestController::setAppCacheMaximumSize(uint64_t size)
+{
+    WKBundleSetAppCacheMaximumSize(InjectedBundle::shared().bundle(), size);
+}
+
 bool LayoutTestController::isCommandEnabled(JSStringRef name)
 {
     return WKBundlePageIsEditingCommandEnabled(InjectedBundle::shared().page()->page(), toWK(name).get());

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h (96404 => 96405)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h	2011-09-30 17:05:22 UTC (rev 96404)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h	2011-09-30 17:26:14 UTC (rev 96405)
@@ -125,6 +125,10 @@
     void setDatabaseQuota(uint64_t);
     JSRetainPtr<JSStringRef> pathToLocalResource(JSStringRef);
 
+    // Application Cache
+    void clearAllApplicationCaches();
+    void setAppCacheMaximumSize(uint64_t);
+
     // Printing
     int numberOfPages(double pageWidthInPixels, double pageHeightInPixels);
     int pageNumberForElementById(JSStringRef, double pageWidthInPixels, double pageHeightInPixels);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to