Revert 268405 "Make sure that ScratchBuffer::Allocate() always r..."
[chromium-blink-merge.git] / content / browser / indexed_db / mock_indexed_db_callbacks.h
blob495f9f4e4cf79528626febee9871f0950ac7c34e
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 "content/browser/indexed_db/indexed_db_callbacks.h"
9 #include "content/browser/indexed_db/indexed_db_connection.h"
11 namespace content {
13 class MockIndexedDBCallbacks : public IndexedDBCallbacks {
14 public:
15 MockIndexedDBCallbacks();
16 MockIndexedDBCallbacks(bool expect_connection);
18 virtual void OnSuccess() OVERRIDE;
19 virtual void OnSuccess(int64) OVERRIDE;
20 virtual void OnSuccess(const std::vector<base::string16>&) OVERRIDE;
21 virtual void OnSuccess(scoped_ptr<IndexedDBConnection> connection,
22 const IndexedDBDatabaseMetadata& metadata) OVERRIDE;
23 IndexedDBConnection* connection() { return connection_.get(); }
25 protected:
26 virtual ~MockIndexedDBCallbacks();
28 scoped_ptr<IndexedDBConnection> connection_;
30 private:
31 bool expect_connection_;
33 DISALLOW_COPY_AND_ASSIGN(MockIndexedDBCallbacks);
36 } // namespace content
38 #endif // CONTENT_BROWSER_INDEXED_DB_MOCK_INDEXED_DB_CALLBACKS_H_