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_VALUE_STORE_UNITTEST_H_ | 5 #ifndef EXTENSIONS_BROWSER_VALUE_STORE_VALUE_STORE_UNITTEST_H_ |
6 #define EXTENSIONS_BROWSER_VALUE_STORE_VALUE_STORE_UNITTEST_H_ | 6 #define EXTENSIONS_BROWSER_VALUE_STORE_VALUE_STORE_UNITTEST_H_ |
7 | 7 |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "content/public/test/test_browser_thread.h" | 12 #include "content/public/test/test_browser_thread.h" |
13 #include "extensions/browser/value_store/value_store.h" | 13 #include "extensions/browser/value_store/value_store.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 // Parameter type for the value-parameterized tests. | 16 // Parameter type for the value-parameterized tests. |
17 typedef ValueStore* (*ValueStoreTestParam)(const base::FilePath& file_path); | 17 typedef ValueStore* (*ValueStoreTestParam)(const base::FilePath& file_path); |
18 | 18 |
19 // Test fixture for ValueStore tests. Tests are defined in | 19 // Test fixture for ValueStore tests. Tests are defined in |
20 // settings_storage_unittest.cc with configurations for both cached | 20 // settings_storage_unittest.cc with configurations for both cached |
21 // and non-cached leveldb storage, and cached no-op storage. | 21 // and non-cached leveldb storage, and cached no-op storage. |
22 class ValueStoreTest : public testing::TestWithParam<ValueStoreTestParam> { | 22 class ValueStoreTest : public testing::TestWithParam<ValueStoreTestParam> { |
23 public: | 23 public: |
24 ValueStoreTest(); | 24 ValueStoreTest(); |
25 virtual ~ValueStoreTest(); | 25 virtual ~ValueStoreTest(); |
26 | 26 |
27 virtual void SetUp() OVERRIDE; | 27 virtual void SetUp() override; |
28 virtual void TearDown() OVERRIDE; | 28 virtual void TearDown() override; |
29 | 29 |
30 protected: | 30 protected: |
31 scoped_ptr<ValueStore> storage_; | 31 scoped_ptr<ValueStore> storage_; |
32 | 32 |
33 std::string key1_; | 33 std::string key1_; |
34 std::string key2_; | 34 std::string key2_; |
35 std::string key3_; | 35 std::string key3_; |
36 | 36 |
37 scoped_ptr<base::Value> val1_; | 37 scoped_ptr<base::Value> val1_; |
38 scoped_ptr<base::Value> val2_; | 38 scoped_ptr<base::Value> val2_; |
(...skipping 24 matching lines...) Expand all Loading... |
63 private: | 63 private: |
64 base::ScopedTempDir temp_dir_; | 64 base::ScopedTempDir temp_dir_; |
65 | 65 |
66 // Need these so that the DCHECKs for running on FILE or UI threads pass. | 66 // Need these so that the DCHECKs for running on FILE or UI threads pass. |
67 base::MessageLoop message_loop_; | 67 base::MessageLoop message_loop_; |
68 content::TestBrowserThread ui_thread_; | 68 content::TestBrowserThread ui_thread_; |
69 content::TestBrowserThread file_thread_; | 69 content::TestBrowserThread file_thread_; |
70 }; | 70 }; |
71 | 71 |
72 #endif // EXTENSIONS_BROWSER_VALUE_STORE_VALUE_STORE_UNITTEST_H_ | 72 #endif // EXTENSIONS_BROWSER_VALUE_STORE_VALUE_STORE_UNITTEST_H_ |
OLD | NEW |