OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_INDEXED_DB_MOCK_MOJO_INDEXED_DB_DATABASE_CALLBACKS_H_ |
| 6 #define CONTENT_BROWSER_INDEXED_DB_MOCK_MOJO_INDEXED_DB_DATABASE_CALLBACKS_H_ |
| 7 |
| 8 #include <stdint.h> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "content/common/indexed_db/indexed_db.mojom.h" |
| 12 #include "mojo/public/cpp/bindings/associated_binding.h" |
| 13 #include "testing/gmock/include/gmock/gmock.h" |
| 14 |
| 15 namespace content { |
| 16 |
| 17 class MockMojoIndexedDBDatabaseCallbacks |
| 18 : public ::indexed_db::mojom::DatabaseCallbacks { |
| 19 public: |
| 20 MockMojoIndexedDBDatabaseCallbacks(); |
| 21 ~MockMojoIndexedDBDatabaseCallbacks(); |
| 22 |
| 23 ::indexed_db::mojom::DatabaseCallbacksAssociatedPtrInfo |
| 24 CreateInterfacePtrAndBind(); |
| 25 |
| 26 MOCK_METHOD0(ForcedClose, void()); |
| 27 MOCK_METHOD2(VersionChange, void(int64_t old_version, int64_t new_version)); |
| 28 MOCK_METHOD3(Abort, |
| 29 void(int64_t transaction_id, |
| 30 int32_t code, |
| 31 const base::string16& message)); |
| 32 MOCK_METHOD1(Complete, void(int64_t transaction_id)); |
| 33 |
| 34 MOCK_METHOD1(MockedChanges, |
| 35 void(::indexed_db::mojom::ObserverChangesPtr* changes)); |
| 36 void Changes(::indexed_db::mojom::ObserverChangesPtr changes) override { |
| 37 MockedChanges(&changes); |
| 38 } |
| 39 |
| 40 private: |
| 41 mojo::AssociatedBinding<::indexed_db::mojom::DatabaseCallbacks> binding_; |
| 42 |
| 43 DISALLOW_COPY_AND_ASSIGN(MockMojoIndexedDBDatabaseCallbacks); |
| 44 }; |
| 45 |
| 46 } // namespace content |
| 47 |
| 48 #endif // CONTENT_BROWSER_INDEXED_DB_MOCK_MOJO_INDEXED_DB_DATABASE_CALLBACKS_H_ |
OLD | NEW |