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 EXTENSIONS_BROWSER_VALUE_STORE_TESTING_VALUE_STORE_H_ | 5 #ifndef EXTENSIONS_BROWSER_VALUE_STORE_TESTING_VALUE_STORE_H_ |
6 #define EXTENSIONS_BROWSER_VALUE_STORE_TESTING_VALUE_STORE_H_ | 6 #define EXTENSIONS_BROWSER_VALUE_STORE_TESTING_VALUE_STORE_H_ |
7 | 7 |
| 8 #include <stddef.h> |
| 9 |
8 #include <string> | 10 #include <string> |
9 #include <vector> | 11 #include <vector> |
10 | 12 |
11 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/macros.h" |
12 #include "extensions/browser/value_store/value_store.h" | 15 #include "extensions/browser/value_store/value_store.h" |
13 | 16 |
14 // ValueStore for testing, with an in-memory storage but the ability to | 17 // ValueStore for testing, with an in-memory storage but the ability to |
15 // optionally fail all operations. | 18 // optionally fail all operations. |
16 class TestingValueStore : public ValueStore { | 19 class TestingValueStore : public ValueStore { |
17 public: | 20 public: |
18 TestingValueStore(); | 21 TestingValueStore(); |
19 ~TestingValueStore() override; | 22 ~TestingValueStore() override; |
20 | 23 |
21 // Sets the error code for requests. If OK, errors won't be thrown. | 24 // Sets the error code for requests. If OK, errors won't be thrown. |
(...skipping 27 matching lines...) Expand all Loading... |
49 private: | 52 private: |
50 base::DictionaryValue storage_; | 53 base::DictionaryValue storage_; |
51 int read_count_; | 54 int read_count_; |
52 int write_count_; | 55 int write_count_; |
53 ValueStore::Status status_; | 56 ValueStore::Status status_; |
54 | 57 |
55 DISALLOW_COPY_AND_ASSIGN(TestingValueStore); | 58 DISALLOW_COPY_AND_ASSIGN(TestingValueStore); |
56 }; | 59 }; |
57 | 60 |
58 #endif // EXTENSIONS_BROWSER_VALUE_STORE_TESTING_VALUE_STORE_H_ | 61 #endif // EXTENSIONS_BROWSER_VALUE_STORE_TESTING_VALUE_STORE_H_ |
OLD | NEW |