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

Side by Side Diff: third_party/WebKit/Source/modules/indexeddb/MockWebIDBDatabase.h

Issue 2511403003: Send IndexedDB observations through IDBDatabaseCallbacks. (Closed)
Patch Set: Rebased. Created 4 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 MockWebIDBDatabase_h 5 #ifndef MockWebIDBDatabase_h
6 #define MockWebIDBDatabase_h 6 #define MockWebIDBDatabase_h
7 7
8 #include "modules/indexeddb/IDBKey.h" 8 #include "modules/indexeddb/IDBKey.h"
9 #include "modules/indexeddb/IDBKeyRange.h" 9 #include "modules/indexeddb/IDBKeyRange.h"
10 #include "public/platform/modules/indexeddb/WebIDBDatabase.h" 10 #include "public/platform/modules/indexeddb/WebIDBDatabase.h"
11 #include "public/platform/modules/indexeddb/WebIDBKeyRange.h" 11 #include "public/platform/modules/indexeddb/WebIDBKeyRange.h"
12 #include "public/platform/modules/indexeddb/WebIDBObserver.h"
13 #include <gmock/gmock.h> 12 #include <gmock/gmock.h>
14 #include <memory> 13 #include <memory>
15 14
16 namespace blink { 15 namespace blink {
17 16
18 class MockWebIDBDatabase : public testing::StrictMock<WebIDBDatabase> { 17 class MockWebIDBDatabase : public testing::StrictMock<WebIDBDatabase> {
19 public: 18 public:
20 virtual ~MockWebIDBDatabase(); 19 virtual ~MockWebIDBDatabase();
21 20
22 static std::unique_ptr<MockWebIDBDatabase> create(); 21 static std::unique_ptr<MockWebIDBDatabase> create();
(...skipping 28 matching lines...) Expand all
51 bool multiEntry)); 50 bool multiEntry));
52 MOCK_METHOD3(deleteIndex, 51 MOCK_METHOD3(deleteIndex,
53 void(long long transactionId, 52 void(long long transactionId,
54 long long objectStoreId, 53 long long objectStoreId,
55 long long indexId)); 54 long long indexId));
56 MOCK_METHOD4(renameIndex, 55 MOCK_METHOD4(renameIndex,
57 void(long long transactionId, 56 void(long long transactionId,
58 long long objectStoreId, 57 long long objectStoreId,
59 long long indexId, 58 long long indexId,
60 const WebString& newName)); 59 const WebString& newName));
61 60 MOCK_METHOD6(
62 // Gmock does not support movable type, so cannot use MOCK_METHOD for 61 addObserver,
63 // addObserver. Issue: https://github.com/google/googletest/issues/395. 62 void(long long transactionId,
64 int32_t addObserver(std::unique_ptr<WebIDBObserver>, 63 int32_t observerId,
65 long long transactionId) { 64 bool includeTransaction,
66 return -1; 65 bool noRecords,
67 } 66 bool values,
67 const std::bitset<WebIDBOperationTypeCount>& operationTypes));
68 MOCK_CONST_METHOD1(containsObserverId, bool(int32_t id)); 68 MOCK_CONST_METHOD1(containsObserverId, bool(int32_t id));
69 MOCK_METHOD1(removeObservers, 69 MOCK_METHOD1(removeObservers,
70 void(const WebVector<int32_t>& observerIdsToRemove)); 70 void(const WebVector<int32_t>& observerIdsToRemove));
71 MOCK_METHOD6(get, 71 MOCK_METHOD6(get,
72 void(long long transactionId, 72 void(long long transactionId,
73 long long objectStoreId, 73 long long objectStoreId,
74 long long indexId, 74 long long indexId,
75 const WebIDBKeyRange&, 75 const WebIDBKeyRange&,
76 bool keyOnly, 76 bool keyOnly,
77 WebIDBCallbacks*)); 77 WebIDBCallbacks*));
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 WebIDBCallbacks*)); 129 WebIDBCallbacks*));
130 MOCK_METHOD1(ackReceivedBlobs, void(const WebVector<WebString>& uuids)); 130 MOCK_METHOD1(ackReceivedBlobs, void(const WebVector<WebString>& uuids));
131 131
132 private: 132 private:
133 MockWebIDBDatabase(); 133 MockWebIDBDatabase();
134 }; 134 };
135 135
136 } // namespace blink 136 } // namespace blink
137 137
138 #endif // MockWebIDBDatabase_h 138 #endif // MockWebIDBDatabase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698