OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_INDEXED_DB_MOCK_BROWSERTEST_INDEXED_DB_CLASS_FACTORY_H_ | 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_ | 6 #define CONTENT_BROWSER_INDEXED_DB_MOCK_BROWSERTEST_INDEXED_DB_CLASS_FACTORY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "content/browser/indexed_db/indexed_db_class_factory.h" | 10 #include "content/browser/indexed_db/indexed_db_class_factory.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 enum FailMethod { | 23 enum FailMethod { |
24 FAIL_METHOD_NOTHING, | 24 FAIL_METHOD_NOTHING, |
25 FAIL_METHOD_COMMIT, | 25 FAIL_METHOD_COMMIT, |
26 FAIL_METHOD_GET, | 26 FAIL_METHOD_GET, |
27 FAIL_METHOD_SEEK, | 27 FAIL_METHOD_SEEK, |
28 }; | 28 }; |
29 | 29 |
30 class MockBrowserTestIndexedDBClassFactory : public IndexedDBClassFactory { | 30 class MockBrowserTestIndexedDBClassFactory : public IndexedDBClassFactory { |
31 public: | 31 public: |
32 MockBrowserTestIndexedDBClassFactory(); | 32 MockBrowserTestIndexedDBClassFactory(); |
33 virtual ~MockBrowserTestIndexedDBClassFactory(); | 33 ~MockBrowserTestIndexedDBClassFactory() override; |
34 virtual LevelDBTransaction* CreateLevelDBTransaction( | 34 LevelDBTransaction* CreateLevelDBTransaction(LevelDBDatabase* db) override; |
35 LevelDBDatabase* db) override; | 35 LevelDBIteratorImpl* CreateIteratorImpl( |
36 virtual LevelDBIteratorImpl* CreateIteratorImpl( | |
37 scoped_ptr<leveldb::Iterator> iterator) override; | 36 scoped_ptr<leveldb::Iterator> iterator) override; |
38 | 37 |
39 void FailOperation(FailClass failure_class, | 38 void FailOperation(FailClass failure_class, |
40 FailMethod failure_method, | 39 FailMethod failure_method, |
41 int fail_on_instance_num, | 40 int fail_on_instance_num, |
42 int fail_on_call_num); | 41 int fail_on_call_num); |
43 void Reset(); | 42 void Reset(); |
44 | 43 |
45 private: | 44 private: |
46 FailClass failure_class_; | 45 FailClass failure_class_; |
47 FailMethod failure_method_; | 46 FailMethod failure_method_; |
48 std::map<FailClass, int> instance_count_; | 47 std::map<FailClass, int> instance_count_; |
49 std::map<FailClass, int> fail_on_instance_num_; | 48 std::map<FailClass, int> fail_on_instance_num_; |
50 std::map<FailClass, int> fail_on_call_num_; | 49 std::map<FailClass, int> fail_on_call_num_; |
51 bool only_trace_calls_; | 50 bool only_trace_calls_; |
52 }; | 51 }; |
53 | 52 |
54 } // namespace content | 53 } // namespace content |
55 | 54 |
56 #endif // CONTENT_BROWSER_INDEXED_DB_MOCK_BROWSERTEST_INDEXED_DB_CLASS_FACTORY_
H_ | 55 #endif // CONTENT_BROWSER_INDEXED_DB_MOCK_BROWSERTEST_INDEXED_DB_CLASS_FACTORY_
H_ |
OLD | NEW |