summaryrefslogtreecommitdiffstats
path: root/content/browser/indexed_db/mock_indexed_db_database_callbacks.h
blob: 31a29645a25c33d1cbfdf5846fc4fb4c4656133a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_BROWSER_INDEXED_DB_MOCK_INDEXED_DB_DATABASE_CALLBACKS_H_
#define CONTENT_BROWSER_INDEXED_DB_MOCK_INDEXED_DB_DATABASE_CALLBACKS_H_

#include "content/browser/indexed_db/indexed_db_callbacks.h"
#include "content/browser/indexed_db/indexed_db_connection.h"

namespace content {

class MockIndexedDBDatabaseCallbacks : public IndexedDBDatabaseCallbacks {
 public:
  MockIndexedDBDatabaseCallbacks();

  void OnVersionChange(int64 old_version, int64 new_version) override {}
  void OnForcedClose() override;
  void OnAbort(int64 transaction_id,
               const IndexedDBDatabaseError& error) override;
  void OnComplete(int64 transaction_id) override {}

  bool abort_called() const { return abort_called_; }
  bool forced_close_called() const { return forced_close_called_; }

 private:
  ~MockIndexedDBDatabaseCallbacks() override {}

  bool abort_called_;
  bool forced_close_called_;

  DISALLOW_COPY_AND_ASSIGN(MockIndexedDBDatabaseCallbacks);
};

}  // namespace content

#endif  // CONTENT_BROWSER_INDEXED_DB_MOCK_INDEXED_DB_DATABASE_CALLBACKS_H_