Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / content / browser / indexed_db / mock_indexed_db_callbacks.h
blobfecfd1abb29dd05cf03835c2eb3a6e9cc63550ec
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_INDEXED_DB_MOCK_INDEXED_DB_CALLBACKS_H_
6 #define CONTENT_BROWSER_INDEXED_DB_MOCK_INDEXED_DB_CALLBACKS_H_
8 #include <vector>
10 #include "content/browser/indexed_db/indexed_db_callbacks.h"
11 #include "content/browser/indexed_db/indexed_db_connection.h"
13 namespace content {
15 class MockIndexedDBCallbacks : public IndexedDBCallbacks {
16 public:
17 MockIndexedDBCallbacks();
18 explicit MockIndexedDBCallbacks(bool expect_connection);
20 virtual void OnSuccess() OVERRIDE;
21 virtual void OnSuccess(int64 result) OVERRIDE;
22 virtual void OnSuccess(const std::vector<base::string16>& result) OVERRIDE;
23 virtual void OnSuccess(const IndexedDBKey& key) OVERRIDE;
24 virtual void OnSuccess(scoped_ptr<IndexedDBConnection> connection,
25 const IndexedDBDatabaseMetadata& metadata) OVERRIDE;
26 IndexedDBConnection* connection() { return connection_.get(); }
28 protected:
29 virtual ~MockIndexedDBCallbacks();
31 scoped_ptr<IndexedDBConnection> connection_;
33 private:
34 bool expect_connection_;
36 DISALLOW_COPY_AND_ASSIGN(MockIndexedDBCallbacks);
39 } // namespace content
41 #endif // CONTENT_BROWSER_INDEXED_DB_MOCK_INDEXED_DB_CALLBACKS_H_