Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_UNITTEST_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_UNITTEST_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_UNITTEST_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_UNITTEST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 // Test fixture for ExtensionSettingsStorage tests. Tests are defined in | 22 // Test fixture for ExtensionSettingsStorage tests. Tests are defined in |
| 23 // extension_settings_storage_unittest.cc with configurations for both cached | 23 // extension_settings_storage_unittest.cc with configurations for both cached |
| 24 // and non-cached leveldb storage, and cached no-op storage. | 24 // and non-cached leveldb storage, and cached no-op storage. |
| 25 class ExtensionSettingsStorageTest | 25 class ExtensionSettingsStorageTest |
| 26 : public testing::TestWithParam<ExtensionSettingsStorageTestParam> { | 26 : public testing::TestWithParam<ExtensionSettingsStorageTestParam> { |
| 27 public: | 27 public: |
| 28 ExtensionSettingsStorageTest(); | 28 ExtensionSettingsStorageTest(); |
| 29 virtual ~ExtensionSettingsStorageTest(); | 29 virtual ~ExtensionSettingsStorageTest(); |
| 30 | 30 |
| 31 virtual void SetUp() OVERRIDE; | 31 virtual void SetUp() OVERRIDE; |
| 32 virtual void TearDown() OVERRIDE; | |
| 32 | 33 |
| 33 protected: | 34 protected: |
| 34 ExtensionSettingsStorage* storage_; | 35 ExtensionSettingsStorage* storage_; |
| 35 | 36 |
| 36 std::string key1_; | 37 std::string key1_; |
| 37 std::string key2_; | 38 std::string key2_; |
| 38 std::string key3_; | 39 std::string key3_; |
| 39 | 40 |
| 40 scoped_ptr<Value> val1_; | 41 scoped_ptr<Value> val1_; |
| 41 scoped_ptr<Value> val2_; | 42 scoped_ptr<Value> val2_; |
| 42 scoped_ptr<Value> val3_; | 43 scoped_ptr<Value> val3_; |
| 43 | 44 |
| 44 std::vector<std::string> empty_list_; | 45 std::vector<std::string> empty_list_; |
| 45 std::vector<std::string> list1_; | 46 std::vector<std::string> list1_; |
| 46 std::vector<std::string> list2_; | 47 std::vector<std::string> list2_; |
| 47 std::vector<std::string> list12_; | 48 std::vector<std::string> list12_; |
| 48 std::vector<std::string> list13_; | 49 std::vector<std::string> list13_; |
| 49 std::vector<std::string> list123_; | 50 std::vector<std::string> list123_; |
| 50 | 51 |
| 51 scoped_ptr<DictionaryValue> empty_dict_; | 52 scoped_ptr<DictionaryValue> empty_dict_; |
| 52 scoped_ptr<DictionaryValue> dict1_; | 53 scoped_ptr<DictionaryValue> dict1_; |
| 53 scoped_ptr<DictionaryValue> dict12_; | 54 scoped_ptr<DictionaryValue> dict12_; |
| 54 scoped_ptr<DictionaryValue> dict123_; | 55 scoped_ptr<DictionaryValue> dict123_; |
| 55 | 56 |
| 56 private: | 57 private: |
| 57 scoped_refptr<ExtensionSettings> settings_; | 58 ExtensionSettings* settings_; |
|
akalin
2011/09/20 14:53:11
No need for this to be a pointer anymore (just hav
not at google - send to devlin
2011/09/21 00:20:14
It's still easier for it to be a pointer, since th
akalin
2011/09/21 02:05:56
Ah, that makes sense. But surely it can be a scop
not at google - send to devlin
2011/09/21 03:55:18
Yeah it can be a scoped ptr. I had it this way bu
| |
| 58 | 59 |
| 59 // Need these so that the DCHECKs for running on FILE or UI threads pass. | 60 // Need these so that the DCHECKs for running on FILE or UI threads pass. |
| 60 scoped_ptr<MessageLoopForUI> ui_message_loop_; | 61 scoped_ptr<MessageLoopForUI> ui_message_loop_; |
| 61 scoped_ptr<BrowserThread> ui_thread_; | 62 scoped_ptr<BrowserThread> ui_thread_; |
| 62 scoped_ptr<BrowserThread> file_thread_; | 63 scoped_ptr<BrowserThread> file_thread_; |
| 63 }; | 64 }; |
| 64 | 65 |
| 65 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_UNITTEST_H_ | 66 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_UNITTEST_H_ |
| OLD | NEW |