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

Side by Side Diff: content/browser/indexed_db/mock_indexed_db_factory.h

Issue 2642943002: Allow closing IndexedDB database before deleting (Closed)
Patch Set: Fixed compilation errors in tests Created 3 years, 11 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 unified diff | Download patch
OLDNEW
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 <memory> 10 #include <memory>
(...skipping 27 matching lines...) Expand all
38 // Googlemock can't deal with move-only types, so *Proxy() is a workaround. 38 // Googlemock can't deal with move-only types, so *Proxy() is a workaround.
39 virtual void Open( 39 virtual void Open(
40 const base::string16& name, 40 const base::string16& name,
41 std::unique_ptr<IndexedDBPendingConnection> connection, 41 std::unique_ptr<IndexedDBPendingConnection> connection,
42 scoped_refptr<net::URLRequestContextGetter> request_context_getter, 42 scoped_refptr<net::URLRequestContextGetter> request_context_getter,
43 const url::Origin& origin, 43 const url::Origin& origin,
44 const base::FilePath& data_directory) { 44 const base::FilePath& data_directory) {
45 OpenProxy(name, connection.get(), request_context_getter, origin, 45 OpenProxy(name, connection.get(), request_context_getter, origin,
46 data_directory); 46 data_directory);
47 } 47 }
48 MOCK_METHOD5( 48 MOCK_METHOD6(
49 DeleteDatabase, 49 DeleteDatabase,
50 void(const base::string16& name, 50 void(const base::string16& name,
51 scoped_refptr<net::URLRequestContextGetter> request_context_getter, 51 scoped_refptr<net::URLRequestContextGetter> request_context_getter,
52 scoped_refptr<IndexedDBCallbacks> callbacks, 52 scoped_refptr<IndexedDBCallbacks> callbacks,
53 const url::Origin& origin, 53 const url::Origin& origin,
54 const base::FilePath& data_directory)); 54 const base::FilePath& data_directory,
55 bool force_close));
55 MOCK_METHOD1(HandleBackingStoreFailure, void(const url::Origin& origin)); 56 MOCK_METHOD1(HandleBackingStoreFailure, void(const url::Origin& origin));
56 MOCK_METHOD2(HandleBackingStoreCorruption, 57 MOCK_METHOD2(HandleBackingStoreCorruption,
57 void(const url::Origin& origin, 58 void(const url::Origin& origin,
58 const IndexedDBDatabaseError& error)); 59 const IndexedDBDatabaseError& error));
59 // The Android NDK implements a subset of STL, and the gtest templates can't 60 // The Android NDK implements a subset of STL, and the gtest templates can't
60 // deal with std::pair's. This means we can't use GoogleMock for this method 61 // deal with std::pair's. This means we can't use GoogleMock for this method
61 OriginDBs GetOpenDatabasesForOrigin(const url::Origin& origin) const override; 62 OriginDBs GetOpenDatabasesForOrigin(const url::Origin& origin) const override;
62 MOCK_METHOD1(ForceClose, void(const url::Origin& origin)); 63 MOCK_METHOD1(ForceClose, void(const url::Origin& origin));
63 MOCK_METHOD0(ContextDestroyed, void()); 64 MOCK_METHOD0(ContextDestroyed, void());
64 MOCK_METHOD1(DatabaseDeleted, 65 MOCK_METHOD1(DatabaseDeleted,
(...skipping 27 matching lines...) Expand all
92 bool first_time, 93 bool first_time,
93 leveldb::Status* s)); 94 leveldb::Status* s));
94 95
95 private: 96 private:
96 DISALLOW_COPY_AND_ASSIGN(MockIndexedDBFactory); 97 DISALLOW_COPY_AND_ASSIGN(MockIndexedDBFactory);
97 }; 98 };
98 99
99 } // namespace content 100 } // namespace content
100 101
101 #endif // CONTENT_BROWSER_INDEXED_DB_MOCK_INDEXED_DB_FACTORY_H_ 102 #endif // CONTENT_BROWSER_INDEXED_DB_MOCK_INDEXED_DB_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698