| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_CALLBACKS_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_MOCK_INDEXED_DB_CALLBACKS_H_ |
| 6 #define CONTENT_BROWSER_INDEXED_DB_MOCK_INDEXED_DB_CALLBACKS_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_MOCK_INDEXED_DB_CALLBACKS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "content/browser/indexed_db/indexed_db_callbacks.h" | 13 #include "content/browser/indexed_db/indexed_db_callbacks.h" |
| 14 #include "content/browser/indexed_db/indexed_db_connection.h" | 14 #include "content/browser/indexed_db/indexed_db_connection.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 | 17 |
| 18 class MockIndexedDBCallbacks : public IndexedDBCallbacks { | 18 class MockIndexedDBCallbacks : public IndexedDBCallbacks { |
| 19 public: | 19 public: |
| 20 MockIndexedDBCallbacks(); | 20 MockIndexedDBCallbacks(); |
| 21 explicit MockIndexedDBCallbacks(bool expect_connection); | 21 explicit MockIndexedDBCallbacks(bool expect_connection); |
| 22 | 22 |
| 23 void OnSuccess() override; | 23 void OnSuccess() override; |
| 24 void OnSuccess(int64_t result) override; | 24 void OnSuccess(int64_t result) override; |
| 25 void OnSuccess(const std::vector<base::string16>& result) override; | 25 void OnSuccess(const std::vector<base::string16>& result) override; |
| 26 void OnSuccess(const IndexedDBKey& key) override; | 26 void OnSuccess(const IndexedDBKey& key) override; |
| 27 void OnSuccess(std::unique_ptr<IndexedDBConnection> connection, | 27 void OnSuccess(std::unique_ptr<IndexedDBConnection> connection, |
| 28 const IndexedDBDatabaseMetadata& metadata) override; | 28 const IndexedDBDatabaseMetadata& metadata) override; |
| 29 bool IsValid() const override; |
| 29 IndexedDBConnection* connection() { return connection_.get(); } | 30 IndexedDBConnection* connection() { return connection_.get(); } |
| 30 | 31 |
| 31 protected: | 32 protected: |
| 32 ~MockIndexedDBCallbacks() override; | 33 ~MockIndexedDBCallbacks() override; |
| 33 | 34 |
| 34 std::unique_ptr<IndexedDBConnection> connection_; | 35 std::unique_ptr<IndexedDBConnection> connection_; |
| 35 | 36 |
| 36 private: | 37 private: |
| 37 bool expect_connection_; | 38 bool expect_connection_; |
| 38 | 39 |
| 39 DISALLOW_COPY_AND_ASSIGN(MockIndexedDBCallbacks); | 40 DISALLOW_COPY_AND_ASSIGN(MockIndexedDBCallbacks); |
| 40 }; | 41 }; |
| 41 | 42 |
| 42 } // namespace content | 43 } // namespace content |
| 43 | 44 |
| 44 #endif // CONTENT_BROWSER_INDEXED_DB_MOCK_INDEXED_DB_CALLBACKS_H_ | 45 #endif // CONTENT_BROWSER_INDEXED_DB_MOCK_INDEXED_DB_CALLBACKS_H_ |
| OLD | NEW |