Title: [114776] trunk/Tools
Revision
114776
Author
commit-qu...@webkit.org
Date
2012-04-20 13:28:03 -0700 (Fri, 20 Apr 2012)

Log Message

[EFL] Make it possible to define offline storage quota per origin
https://bugs.webkit.org/show_bug.cgi?id=84170

Improved LayoutTestController::setDatabaseQuota to set quota based on
origin which was causing some tests to fail. Also align the default
quota for testing (5MB) with others ports.

When dumpDatabaseCallbacks is set to true by, also dump some database
information when quota is exceed, which is also required by some tests.

Patch by Thiago Marcos P. Santos <thiago.san...@intel.com> on 2012-04-20
Reviewed by Antonio Gomes.

* DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
(DumpRenderTreeChrome::resetDefaultsToConsistentValues):
* DumpRenderTree/efl/DumpRenderTreeView.cpp:
(onExceededDatabaseQuota):
(drtViewAdd):
* DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
(LayoutTestController::setDatabaseQuota):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (114775 => 114776)


--- trunk/Tools/ChangeLog	2012-04-20 20:22:03 UTC (rev 114775)
+++ trunk/Tools/ChangeLog	2012-04-20 20:28:03 UTC (rev 114776)
@@ -1,3 +1,25 @@
+2012-04-20  Thiago Marcos P. Santos  <thiago.san...@intel.com>
+
+        [EFL] Make it possible to define offline storage quota per origin
+        https://bugs.webkit.org/show_bug.cgi?id=84170
+
+        Improved LayoutTestController::setDatabaseQuota to set quota based on
+        origin which was causing some tests to fail. Also align the default
+        quota for testing (5MB) with others ports.
+
+        When dumpDatabaseCallbacks is set to true by, also dump some database
+        information when quota is exceed, which is also required by some tests.
+
+        Reviewed by Antonio Gomes.
+
+        * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
+        (DumpRenderTreeChrome::resetDefaultsToConsistentValues):
+        * DumpRenderTree/efl/DumpRenderTreeView.cpp:
+        (onExceededDatabaseQuota):
+        (drtViewAdd):
+        * DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
+        (LayoutTestController::setDatabaseQuota):
+
 2012-04-20  Sudarsana Nagineni  <sudarsana.nagin...@linux.intel.com>
 
         [EFL] [DRT] Send double click event from EventSender

Modified: trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp (114775 => 114776)


--- trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp	2012-04-20 20:22:03 UTC (rev 114775)
+++ trunk/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp	2012-04-20 20:28:03 UTC (rev 114776)
@@ -178,6 +178,9 @@
     ewk_settings_icon_database_clear();
     ewk_settings_icon_database_path_set(0);
 
+    ewk_settings_web_database_clear();
+    ewk_settings_web_database_default_quota_set(5 * 1024 * 1024);
+
     ewk_view_setting_private_browsing_set(mainView(), EINA_FALSE);
     ewk_view_setting_spatial_navigation_set(mainView(), EINA_FALSE);
     ewk_view_setting_enable_frame_flattening_set(mainView(), EINA_FALSE);

Modified: trunk/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp (114775 => 114776)


--- trunk/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp	2012-04-20 20:22:03 UTC (rev 114775)
+++ trunk/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp	2012-04-20 20:28:03 UTC (rev 114776)
@@ -104,6 +104,22 @@
     ecore_idler_add(onWindowCloseDelayed, view);
 }
 
+static uint64_t onExceededDatabaseQuota(Ewk_View_Smart_Data* smartData, Evas_Object* frame, const char* databaseName, uint64_t currentSize, uint64_t expectedSize)
+{
+    if (!gLayoutTestController->dumpDatabaseCallbacks())
+        return 0;
+
+    Ewk_Security_Origin* origin = ewk_frame_security_origin_get(frame);
+    printf("UI DELEGATE DATABASE CALLBACK: exceededDatabaseQuotaForSecurityOrigin:{%s, %s, %i} database:%s\n",
+            ewk_security_origin_protocol_get(origin),
+            ewk_security_origin_host_get(origin),
+            ewk_security_origin_port_get(origin),
+            databaseName);
+    ewk_security_origin_free(origin);
+
+    return 5 * 1024 * 1024;
+}
+
 static bool shouldUseSingleBackingStore()
 {
     const char* useSingleBackingStore = getenv("DRT_USE_SINGLE_BACKING_STORE");
@@ -131,6 +147,7 @@
     api.run_javascript_prompt = onJavaScriptPrompt;
     api.window_create = onWindowCreate;
     api.window_close = onWindowClose;
+    api.exceeded_database_quota = onExceededDatabaseQuota;
 
     return evas_object_smart_add(evas, evas_smart_class_new(&api.sc));
 }

Modified: trunk/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp (114775 => 114776)


--- trunk/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp	2012-04-20 20:22:03 UTC (rev 114775)
+++ trunk/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp	2012-04-20 20:28:03 UTC (rev 114776)
@@ -575,7 +575,9 @@
 
 void LayoutTestController::setDatabaseQuota(unsigned long long quota)
 {
-    ewk_settings_web_database_default_quota_set(quota);
+    Ewk_Security_Origin* origin = ewk_frame_security_origin_get(browser->mainFrame());
+    ewk_security_origin_web_database_quota_set(origin, quota);
+    ewk_security_origin_free(origin);
 }
 
 JSValueRef LayoutTestController::originsWithLocalStorage(JSContextRef context)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to