[Win] The test storage/indexeddb/modern/handle-user-delete.html is timing out.
authorpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Jun 2016 06:33:07 +0000 (06:33 +0000)
committerpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Jun 2016 06:33:07 +0000 (06:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=158934

Reviewed by Brent Fulgham.

Source/WebKit/win:

Add a method to delete all indexed databases.

* Interfaces/IWebDatabaseManager.idl:
* WebDatabaseManager.cpp:
(WebDatabaseManager::QueryInterface):
(WebDatabaseManager::deleteAllIndexedDatabases):
* WebDatabaseManager.h:

Tools:

DumpRenderTree should also delete indexed databases when clearAllDatabases() is called.

* DumpRenderTree/win/TestRunnerWin.cpp:
(TestRunner::clearAllDatabases):

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

Source/WebKit/win/ChangeLog
Source/WebKit/win/Interfaces/IWebDatabaseManager.idl
Source/WebKit/win/WebDatabaseManager.cpp
Source/WebKit/win/WebDatabaseManager.h
Tools/ChangeLog
Tools/DumpRenderTree/win/TestRunnerWin.cpp

index 28ae854..2fd669a 100644 (file)
@@ -1,3 +1,18 @@
+2016-06-22  Per Arne Vollan  <pvollan@apple.com>
+
+        [Win] The test storage/indexeddb/modern/handle-user-delete.html is timing out.
+        https://bugs.webkit.org/show_bug.cgi?id=158934
+
+        Reviewed by Brent Fulgham.
+
+        Add a method to delete all indexed databases.
+
+        * Interfaces/IWebDatabaseManager.idl:
+        * WebDatabaseManager.cpp:
+        (WebDatabaseManager::QueryInterface):
+        (WebDatabaseManager::deleteAllIndexedDatabases):
+        * WebDatabaseManager.h:
+
 2016-06-17  Per Arne Vollan  <pvollan@apple.com>
 
         [Win] Rendering is not scaled correctly if process is DPI aware.
index 7f0ccbf..7aebcae 100644 (file)
@@ -62,3 +62,11 @@ interface IWebDatabaseManager : IUnknown
 
     HRESULT setQuota([in] BSTR originName, [in] unsigned long long quota);
 }
+
+[
+    uuid(759C2356-181C-4CCF-9E11-6F6242FB8C78)
+]
+interface IWebDatabaseManager2 : IWebDatabaseManager
+{
+    HRESULT deleteAllIndexedDatabases();
+}
index b54015f..629e037 100644 (file)
 #include <WebCore/SecurityOrigin.h>
 #include <wtf/MainThread.h>
 
+#if ENABLE(INDEXED_DATABASE)
+#include "WebDatabaseProvider.h"
+#endif
+
 using namespace WebCore;
 
 static CFStringRef WebDatabaseDirectoryDefaultsKey = CFSTR("WebDatabaseDirectory");
@@ -174,6 +178,8 @@ HRESULT WebDatabaseManager::QueryInterface(_In_ REFIID riid, _COM_Outptr_ void**
         *ppvObject = static_cast<WebDatabaseManager*>(this);
     else if (IsEqualGUID(riid, IID_IWebDatabaseManager))
         *ppvObject = static_cast<WebDatabaseManager*>(this);
+    else if (IsEqualGUID(riid, IID_IWebDatabaseManager2))
+        *ppvObject = static_cast<WebDatabaseManager*>(this);
     else
         return E_NOINTERFACE;
 
@@ -327,6 +333,14 @@ HRESULT WebDatabaseManager::deleteDatabase(_In_ BSTR databaseName, _In_opt_ IWeb
     return S_OK;
 }
 
+HRESULT WebDatabaseManager::deleteAllIndexedDatabases()
+{
+#if ENABLE(INDEXED_DATABASE)
+    WebDatabaseProvider::singleton().deleteAllDatabases();
+#endif
+    return S_OK;
+}
+
 class DidModifyOriginData {
     WTF_MAKE_NONCOPYABLE(DidModifyOriginData);
 public:
index a6ab975..27b345f 100644 (file)
@@ -32,7 +32,7 @@
 #include "WebKit.h"
 #include <WebCore/DatabaseManagerClient.h>
 
-class WebDatabaseManager : public IWebDatabaseManager, private WebCore::DatabaseManagerClient {
+class WebDatabaseManager : public IWebDatabaseManager2, private WebCore::DatabaseManagerClient {
 public:
     static WebDatabaseManager* createInstance();
 
@@ -51,6 +51,9 @@ public:
     virtual HRESULT STDMETHODCALLTYPE deleteDatabase(_In_ BSTR databaseName, _In_opt_ IWebSecurityOrigin*);
     virtual HRESULT STDMETHODCALLTYPE setQuota(_In_ BSTR origin, unsigned long long quota);
 
+    // IWebDatabaseManager2
+    virtual HRESULT STDMETHODCALLTYPE deleteAllIndexedDatabases();
+
     // DatabaseManagerClient
     virtual void dispatchDidModifyOrigin(WebCore::SecurityOrigin*);
     virtual void dispatchDidModifyDatabase(WebCore::SecurityOrigin*, const WTF::String& databaseName);
index 1d1cbe2..dff7f16 100644 (file)
@@ -1,3 +1,15 @@
+2016-06-22  Per Arne Vollan  <pvollan@apple.com>
+
+        [Win] The test storage/indexeddb/modern/handle-user-delete.html is timing out.
+        https://bugs.webkit.org/show_bug.cgi?id=158934
+
+        Reviewed by Brent Fulgham.
+
+        DumpRenderTree should also delete indexed databases when clearAllDatabases() is called.
+
+        * DumpRenderTree/win/TestRunnerWin.cpp:
+        (TestRunner::clearAllDatabases):
+
 2016-06-22  Saam Barati  <sbarati@apple.com>
 
         run-javascriptcore-tests should have some environment variables for commonly used settings
index b66b4bf..511af31 100644 (file)
@@ -159,6 +159,12 @@ void TestRunner::clearAllDatabases()
         return;
 
     databaseManager->deleteAllDatabases();
+
+    COMPtr<IWebDatabaseManager2> databaseManager2;
+    if (FAILED(databaseManager->QueryInterface(&databaseManager2)))
+        return;
+
+    databaseManager2->deleteAllIndexedDatabases();
 }
 
 void TestRunner::setStorageDatabaseIdleInterval(double)