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/memory/scoped_ptr.h" |
| 13 #include "base/message_loop.h" |
| 14 #include "base/task.h" |
| 15 #include "chrome/browser/extensions/extension_settings.h" |
| 16 #include "content/browser/browser_thread.h" |
| 17 |
| 18 // Parameter type for the value-parameterized tests. |
| 19 typedef void (*ExtensionSettingsStorageTestParam)( |
| 20 ExtensionSettings* settings, |
| 21 const std::string& extension_id, |
| 22 const ExtensionSettings::Callback& callback); |
| 23 |
| 24 // Test fixture for ExtensionSettingsStorage tests. Tests are defined in |
| 25 // extension_settings_storage_unittest.cc with configurations for both cached |
| 26 // and non-cached leveldb storage, and cached no-op storage. |
| 27 class ExtensionSettingsStorageTest |
| 28 : public testing::TestWithParam<ExtensionSettingsStorageTestParam> { |
| 29 public: |
| 30 ExtensionSettingsStorageTest(); |
| 31 virtual ~ExtensionSettingsStorageTest(); |
| 32 |
| 33 virtual void SetUp() OVERRIDE; |
| 34 virtual void TearDown() OVERRIDE; |
| 35 |
| 36 protected: |
| 37 ExtensionSettingsStorage* storage_; |
| 38 |
| 39 std::string key1_; |
| 40 std::string key2_; |
| 41 std::string key3_; |
| 42 scoped_ptr<Value> val1_; |
| 43 scoped_ptr<Value> val2_; |
| 44 scoped_ptr<Value> val3_; |
| 45 scoped_ptr<ListValue> emptyList_; |
| 46 scoped_ptr<ListValue> list1_; |
| 47 scoped_ptr<ListValue> list2_; |
| 48 scoped_ptr<ListValue> list12_; |
| 49 scoped_ptr<ListValue> list13_; |
| 50 scoped_ptr<ListValue> list123_; |
| 51 scoped_ptr<DictionaryValue> emptyDict_; |
| 52 scoped_ptr<DictionaryValue> dict1_; |
| 53 scoped_ptr<DictionaryValue> dict12_; |
| 54 scoped_ptr<DictionaryValue> dict123_; |
| 55 |
| 56 private: |
| 57 void SetStorage(ExtensionSettingsStorage* storage); |
| 58 |
| 59 scoped_refptr<ExtensionSettings> settings_; |
| 60 MessageLoopForUI* ui_message_loop_; |
| 61 BrowserThread* ui_thread_; |
| 62 BrowserThread* file_thread_; |
| 63 }; |
| 64 |
| 65 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_UNITTEST_H_ |
OLD | NEW |