Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / content / browser / indexed_db / mock_browsertest_indexed_db_class_factory.h
blob6e6f6ae0cef74b333ce5302178883b4202781248
1 // Copyright 2014 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_BROWSERTEST_INDEXED_DB_CLASS_FACTORY_H_
6 #define CONTENT_BROWSER_INDEXED_DB_MOCK_BROWSERTEST_INDEXED_DB_CLASS_FACTORY_H_
8 #include <map>
10 #include "content/browser/indexed_db/indexed_db_class_factory.h"
12 namespace content {
14 class LevelDBTransaction;
15 class LevelDBDatabase;
17 enum FailClass {
18 FAIL_CLASS_NOTHING,
19 FAIL_CLASS_LEVELDB_ITERATOR,
20 FAIL_CLASS_LEVELDB_TRANSACTION,
23 enum FailMethod {
24 FAIL_METHOD_NOTHING,
25 FAIL_METHOD_COMMIT,
26 FAIL_METHOD_COMMIT_DISK_FULL,
27 FAIL_METHOD_GET,
28 FAIL_METHOD_SEEK,
31 class MockBrowserTestIndexedDBClassFactory : public IndexedDBClassFactory {
32 public:
33 MockBrowserTestIndexedDBClassFactory();
34 ~MockBrowserTestIndexedDBClassFactory() override;
35 LevelDBTransaction* CreateLevelDBTransaction(LevelDBDatabase* db) override;
36 LevelDBIteratorImpl* CreateIteratorImpl(
37 scoped_ptr<leveldb::Iterator> iterator) override;
39 void FailOperation(FailClass failure_class,
40 FailMethod failure_method,
41 int fail_on_instance_num,
42 int fail_on_call_num);
43 void Reset();
45 private:
46 FailClass failure_class_;
47 FailMethod failure_method_;
48 std::map<FailClass, int> instance_count_;
49 std::map<FailClass, int> fail_on_instance_num_;
50 std::map<FailClass, int> fail_on_call_num_;
51 bool only_trace_calls_;
54 } // namespace content
56 #endif // CONTENT_BROWSER_INDEXED_DB_MOCK_BROWSERTEST_INDEXED_DB_CLASS_FACTORY_H_