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. 4 5#include "content/browser/indexed_db/mock_indexed_db_callbacks.h" 6 7#include "testing/gtest/include/gtest/gtest.h" 8 9namespace content { 10 11MockIndexedDBCallbacks::MockIndexedDBCallbacks() 12 : IndexedDBCallbacks(NULL, 0, 0), expect_connection_(true) {} 13MockIndexedDBCallbacks::MockIndexedDBCallbacks(bool expect_connection) 14 : IndexedDBCallbacks(NULL, 0, 0), expect_connection_(expect_connection) {} 15 16MockIndexedDBCallbacks::~MockIndexedDBCallbacks() { 17 EXPECT_EQ(expect_connection_, !!connection_); 18} 19 20void MockIndexedDBCallbacks::OnSuccess() {} 21 22void MockIndexedDBCallbacks::OnSuccess(int64 result) { 23} 24 25void MockIndexedDBCallbacks::OnSuccess(const std::vector<base::string16>&) {} 26 27void MockIndexedDBCallbacks::OnSuccess(const IndexedDBKey& key) {} 28 29void MockIndexedDBCallbacks::OnSuccess( 30 scoped_ptr<IndexedDBConnection> connection, 31 const IndexedDBDatabaseMetadata& metadata) { 32 connection_ = connection.Pass(); 33} 34 35} // namespace content 36