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_database_callbacks.h"
6 
7 #include "content/browser/indexed_db/indexed_db_context_impl.h"
8 #include "mojo/public/cpp/bindings/associated_remote.h"
9 #include "testing/gtest/include/gtest/gtest.h"
10 
11 namespace content {
12 
MockIndexedDBDatabaseCallbacks()13 MockIndexedDBDatabaseCallbacks::MockIndexedDBDatabaseCallbacks()
14     : IndexedDBDatabaseCallbacks(scoped_refptr<IndexedDBContextImpl>(nullptr),
15                                  mojo::NullAssociatedRemote(),
16                                  base::SequencedTaskRunnerHandle::Get().get()),
17       abort_called_(false),
18       forced_close_called_(false) {}
19 
OnVersionChange(int64_t old_version,int64_t new_version)20 void MockIndexedDBDatabaseCallbacks::OnVersionChange(int64_t old_version,
21                                                      int64_t new_version) {}
22 
OnForcedClose()23 void MockIndexedDBDatabaseCallbacks::OnForcedClose() {
24   forced_close_called_ = true;
25 }
26 
OnAbort(const IndexedDBTransaction & transaction,const IndexedDBDatabaseError & error)27 void MockIndexedDBDatabaseCallbacks::OnAbort(
28     const IndexedDBTransaction& transaction,
29     const IndexedDBDatabaseError& error) {
30   abort_called_ = true;
31 }
OnComplete(const IndexedDBTransaction & transaction)32 void MockIndexedDBDatabaseCallbacks::OnComplete(
33     const IndexedDBTransaction& transaction) {}
34 
35 }  // namespace content
36