Skip to content
  • commit-queue@webkit.org's avatar
    WebKitTestRunner needs layoutTestController.dumpDatabaseCallbacks · 4c837870
    commit-queue@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=57570
    
    Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-09-14
    Reviewed by Kenneth Rohde Christiansen.
    
    Source/WebKit2:
    
    Add new didExceedDatabaseQuota callback to WKBundlePageUIClient
    and call it from WebChromeClient::exceededDatabaseQuota().
    This is needed by WebKitTestRunner to dump information about
    database callbacks.
    
    * Shared/APIClientTraits.h:
    * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
    * WebProcess/InjectedBundle/InjectedBundle.cpp:
    (WebKit::InjectedBundle::setDatabaseQuota): Call WebDatabaseManager::setQuotaForOrigin()
    with "file__0" instead of "file:///" as origin identifier. WebDatabaseManager expects
    a database identifier, not a string representation of the security origin. "file__0" is
    the string that is used as databaseIdentifier of local files. This bug was causing the
    database quota not to be set. The test cases would therefore fail due to the quota being
    0 instead of the value explicitly set.
    * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
    (WebKit::InjectedBundlePageUIClient::didExceedDatabaseQuota):
    (WebKit):
    * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
    (InjectedBundlePageUIClient):
    * WebProcess/WebCoreSupport/WebChromeClient.cpp:
    (WebKit::WebChromeClient::exceededDatabaseQuota):
    
    Tools:
    
    Implement testRunner.dumpDatabaseCallbacks in WebKitTestRunner
    and dump the information expected by the test cases.
    
    * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
    * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
    (WTR::InjectedBundle::beginTesting): Explicitly set the default
    database quota.
    * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
    (WTR::securityOriginToStr): New convenience function to convert
    a security origin to the string expected in test results.
    (WTR):
    (WTR::InjectedBundlePage::InjectedBundlePage):
    (WTR::InjectedBundlePage::didExceedDatabaseQuota):
    (WTR::InjectedBundlePage::didReachApplicationCacheOriginQuota): Minor
    refactoring to share code with didExceedDatabaseQuota.
    * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
    (InjectedBundlePage):
    * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
    (WTR::TestRunner::TestRunner):
    * WebKitTestRunner/InjectedBundle/TestRunner.h:
    (WTR::TestRunner::dumpDatabaseCallbacks):
    (WTR::TestRunner::shouldDumpDatabaseCallbacks):
    (TestRunner):
    
    LayoutTests:
    
    Unskip several test cases which require implementation of
    testRunner.dumpDatabaseCallbacks in WebKitTestRunner.
    
    * platform/wk2/Skipped:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    4c837870