OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_UNITTEST_H_ | |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_UNITTEST_H_ | |
7 #pragma once | |
8 | |
9 #include "testing/gtest/include/gtest/gtest.h" | |
10 | |
11 #include "base/memory/ref_counted.h" | |
12 #include "base/message_loop.h" | |
13 #include "base/task.h" | |
14 #include "chrome/browser/extensions/extension_settings.h" | |
15 #include "content/browser/browser_thread.h" | |
16 | |
17 // Parameter type for the value-parameterized tests. | |
18 typedef void (*ExtensionSettingsStorageTestParam)( | |
19 ExtensionSettings* settings, | |
20 const std::string& extension_id, | |
21 const ExtensionSettings::Callback& callback); | |
22 | |
23 // Test fixture for ExtensionSettingsStorage tests. Tests are defined in | |
24 // extension_settings_storage_unittest.cc with configurations for both cached | |
25 // and non-cached leveldb storage, and cached no-op storage. | |
26 class ExtensionSettingsStorageTest | |
27 : public testing::TestWithParam<ExtensionSettingsStorageTestParam> { | |
28 public: | |
29 ExtensionSettingsStorageTest(); | |
30 ~ExtensionSettingsStorageTest(); | |
31 | |
32 virtual void SetUp() OVERRIDE; | |
33 virtual void TearDown() OVERRIDE; | |
34 | |
35 protected: | |
36 ExtensionSettingsStorage* storage_; | |
37 | |
38 std::string key1_; | |
39 std::string key2_; | |
40 std::string key3_; | |
41 Value* val1_; | |
Matt Perry
2011/06/29 18:08:11
use scoped_ptr so you don't have to manually delet
not at google - send to devlin
2011/08/03 06:36:51
Done.
| |
42 Value* val2_; | |
43 Value* val3_; | |
44 ListValue* emptyList_; | |
45 ListValue* list1_; | |
46 ListValue* list2_; | |
47 ListValue* list12_; | |
48 ListValue* list13_; | |
49 ListValue* list123_; | |
50 DictionaryValue* emptyDict_; | |
51 DictionaryValue* dict1_; | |
52 DictionaryValue* dict12_; | |
53 DictionaryValue* dict123_; | |
54 | |
55 private: | |
56 void SetStorage(ExtensionSettingsStorage* storage); | |
57 | |
58 scoped_refptr<ExtensionSettings> settings_; | |
59 MessageLoopForUI* ui_message_loop_; | |
60 BrowserThread* ui_thread_; | |
61 BrowserThread* file_thread_; | |
62 }; | |
63 | |
64 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_UNITTEST_H_ | |
OLD | NEW |