| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_INDEXED_DB_MOCK_INDEXED_DB_FACTORY_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_MOCK_INDEXED_DB_FACTORY_H_ |
| 6 #define CONTENT_BROWSER_INDEXED_DB_MOCK_INDEXED_DB_FACTORY_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_MOCK_INDEXED_DB_FACTORY_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "content/browser/indexed_db/indexed_db_factory.h" | 13 #include "content/browser/indexed_db/indexed_db_factory.h" |
| 14 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 | 17 |
| 18 class MockIndexedDBFactory : public IndexedDBFactory { | 18 class MockIndexedDBFactory : public IndexedDBFactory { |
| 19 public: | 19 public: |
| 20 MockIndexedDBFactory(); | 20 MockIndexedDBFactory(); |
| 21 MOCK_METHOD2(ReleaseDatabase, | 21 MOCK_METHOD2(ReleaseDatabase, |
| 22 void(const IndexedDBDatabase::Identifier& identifier, | 22 void(const IndexedDBDatabase::Identifier& identifier, |
| 23 bool forced_close)); | 23 bool forced_close)); |
| 24 MOCK_METHOD4(GetDatabaseNames, | 24 MOCK_METHOD4(GetDatabaseNames, |
| 25 void(scoped_refptr<IndexedDBCallbacks> callbacks, | 25 void(scoped_refptr<IndexedDBCallbacks> callbacks, |
| 26 const GURL& origin_url, | 26 const url::Origin& origin_url, |
| 27 const base::FilePath& data_directory, | 27 const base::FilePath& data_directory, |
| 28 net::URLRequestContext* request_context)); | 28 net::URLRequestContext* request_context)); |
| 29 MOCK_METHOD5(Open, | 29 MOCK_METHOD5(Open, |
| 30 void(const base::string16& name, | 30 void(const base::string16& name, |
| 31 const IndexedDBPendingConnection& connection, | 31 const IndexedDBPendingConnection& connection, |
| 32 net::URLRequestContext* request_context, | 32 net::URLRequestContext* request_context, |
| 33 const GURL& origin_url, | 33 const url::Origin& origin, |
| 34 const base::FilePath& data_directory)); | 34 const base::FilePath& data_directory)); |
| 35 MOCK_METHOD5(DeleteDatabase, | 35 MOCK_METHOD5(DeleteDatabase, |
| 36 void(const base::string16& name, | 36 void(const base::string16& name, |
| 37 net::URLRequestContext* request_context, | 37 net::URLRequestContext* request_context, |
| 38 scoped_refptr<IndexedDBCallbacks> callbacks, | 38 scoped_refptr<IndexedDBCallbacks> callbacks, |
| 39 const GURL& origin_url, | 39 const url::Origin& origin, |
| 40 const base::FilePath& data_directory)); | 40 const base::FilePath& data_directory)); |
| 41 MOCK_METHOD1(HandleBackingStoreFailure, void(const GURL& origin_url)); | 41 MOCK_METHOD1(HandleBackingStoreFailure, void(const GURL& origin_url)); |
| 42 MOCK_METHOD2(HandleBackingStoreCorruption, | 42 MOCK_METHOD2(HandleBackingStoreCorruption, |
| 43 void(const GURL& origin_url, | 43 void(const GURL& origin_url, |
| 44 const IndexedDBDatabaseError& error)); | 44 const IndexedDBDatabaseError& error)); |
| 45 // The Android NDK implements a subset of STL, and the gtest templates can't | 45 // The Android NDK implements a subset of STL, and the gtest templates can't |
| 46 // deal with std::pair's. This means we can't use GoogleMock for this method | 46 // deal with std::pair's. This means we can't use GoogleMock for this method |
| 47 OriginDBs GetOpenDatabasesForOrigin(const GURL& origin_url) const override; | 47 OriginDBs GetOpenDatabasesForOrigin(const GURL& origin_url) const override; |
| 48 MOCK_METHOD1(ForceClose, void(const GURL& origin_url)); | 48 MOCK_METHOD1(ForceClose, void(const GURL& origin_url)); |
| 49 MOCK_METHOD0(ContextDestroyed, void()); | 49 MOCK_METHOD0(ContextDestroyed, void()); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 78 bool first_time, | 78 bool first_time, |
| 79 leveldb::Status* s)); | 79 leveldb::Status* s)); |
| 80 | 80 |
| 81 private: | 81 private: |
| 82 DISALLOW_COPY_AND_ASSIGN(MockIndexedDBFactory); | 82 DISALLOW_COPY_AND_ASSIGN(MockIndexedDBFactory); |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 } // namespace content | 85 } // namespace content |
| 86 | 86 |
| 87 #endif // CONTENT_BROWSER_INDEXED_DB_MOCK_INDEXED_DB_FACTORY_H_ | 87 #endif // CONTENT_BROWSER_INDEXED_DB_MOCK_INDEXED_DB_FACTORY_H_ |
| OLD | NEW |