summaryrefslogtreecommitdiffstats
path: root/content/browser/indexed_db/mock_indexed_db_callbacks.cc
blob: 62afee8d438e87de560598cda9e6a545fd8e9825 (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
// 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.

#include "content/browser/indexed_db/mock_indexed_db_callbacks.h"

#include "testing/gtest/include/gtest/gtest.h"

namespace content {

MockIndexedDBCallbacks::MockIndexedDBCallbacks()
    : IndexedDBCallbacks(NULL, 0, 0), expect_connection_(true) {}
MockIndexedDBCallbacks::MockIndexedDBCallbacks(bool expect_connection)
    : IndexedDBCallbacks(NULL, 0, 0), expect_connection_(expect_connection) {}

MockIndexedDBCallbacks::~MockIndexedDBCallbacks() {
  EXPECT_EQ(expect_connection_, !!connection_);
}

void MockIndexedDBCallbacks::OnSuccess() {}

void MockIndexedDBCallbacks::OnSuccess(int64 result) {
}

void MockIndexedDBCallbacks::OnSuccess(const std::vector<base::string16>&) {}

void MockIndexedDBCallbacks::OnSuccess(const IndexedDBKey& key) {}

void MockIndexedDBCallbacks::OnSuccess(
    scoped_ptr<IndexedDBConnection> connection,
    const IndexedDBDatabaseMetadata& metadata) {
  connection_ = connection.Pass();
}

}  // namespace content