Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1033)

Unified Diff: content/browser/indexed_db/mock_indexed_db_factory.h

Issue 1963293002: Replacing Indexed DB Chromium IPC with Mojo Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactoring after Passing URLRequestContextGetter. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/indexed_db/mock_indexed_db_factory.h
diff --git a/content/browser/indexed_db/mock_indexed_db_factory.h b/content/browser/indexed_db/mock_indexed_db_factory.h
index c6d734d6174e2e5b9eebc252e9bc060fbd90429e..bce5d2626379e955f57c1eabd5ea0ec70bbc4f30 100644
--- a/content/browser/indexed_db/mock_indexed_db_factory.h
+++ b/content/browser/indexed_db/mock_indexed_db_factory.h
@@ -12,20 +12,22 @@
#include "base/macros.h"
#include "content/browser/indexed_db/indexed_db_factory.h"
+#include "net/url_request/url_request_context_getter.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace content {
+class IndexedDBDatabaseError;
+
class MockIndexedDBFactory : public IndexedDBFactory {
public:
MockIndexedDBFactory();
MOCK_METHOD2(ReleaseDatabase,
void(const IndexedDBDatabase::Identifier& identifier,
bool forced_close));
- MOCK_METHOD4(
+ MOCK_METHOD3(
GetDatabaseNames,
- void(scoped_refptr<IndexedDBCallbacks> callbacks,
- const url::Origin& origin,
+ void(const url::Origin& origin,
const base::FilePath& data_directory,
scoped_refptr<net::URLRequestContextGetter> request_context_getter));
MOCK_METHOD5(
@@ -46,12 +48,22 @@ class MockIndexedDBFactory : public IndexedDBFactory {
data_directory);
}
MOCK_METHOD5(
- DeleteDatabase,
+ DeleteProxy,
void(const base::string16& name,
scoped_refptr<net::URLRequestContextGetter> request_context_getter,
- scoped_refptr<IndexedDBCallbacks> callbacks,
+ IndexedDBPendingDelete* pending_delete,
const url::Origin& origin,
const base::FilePath& data_directory));
+ // Googlemock can't deal with move-only types, so *Proxy() is a workaround.
+ void DeleteDatabase(
+ const base::string16& name,
+ scoped_refptr<net::URLRequestContextGetter> request_context_getter,
+ std::unique_ptr<IndexedDBPendingDelete> pending_delete,
+ const url::Origin& origin,
+ const base::FilePath& data_directory) {
+ DeleteProxy(name, request_context_getter, pending_delete.get(), origin,
+ data_directory);
+ }
MOCK_METHOD1(HandleBackingStoreFailure, void(const url::Origin& origin));
MOCK_METHOD2(HandleBackingStoreCorruption,
void(const url::Origin& origin,
@@ -67,6 +79,7 @@ class MockIndexedDBFactory : public IndexedDBFactory {
MOCK_METHOD2(ReportOutstandingBlobs,
void(const url::Origin& origin, bool blobs_outstanding));
+ MOCK_CONST_METHOD0(context, IndexedDBContext*());
protected:
virtual ~MockIndexedDBFactory();

Powered by Google App Engine
This is Rietveld 408576698