Chromium Code Reviews| Index: chrome/browser/extensions/extension_settings_storage_unittest.h |
| diff --git a/chrome/browser/extensions/extension_settings_storage_unittest.h b/chrome/browser/extensions/extension_settings_storage_unittest.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..167c87555ba7c4b73698339ff6ac7324326eb8e3 |
| --- /dev/null |
| +++ b/chrome/browser/extensions/extension_settings_storage_unittest.h |
| @@ -0,0 +1,64 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_UNITTEST_H_ |
| +#define CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_UNITTEST_H_ |
| +#pragma once |
| + |
| +#include "testing/gtest/include/gtest/gtest.h" |
| + |
| +#include "base/memory/ref_counted.h" |
| +#include "base/message_loop.h" |
| +#include "base/task.h" |
| +#include "chrome/browser/extensions/extension_settings.h" |
| +#include "content/browser/browser_thread.h" |
| + |
| +// Parameter type for the value-parameterized tests. |
| +typedef void (*ExtensionSettingsStorageTestParam)( |
| + ExtensionSettings* settings, |
| + const std::string& extension_id, |
| + const ExtensionSettings::Callback& callback); |
| + |
| +// Test fixture for ExtensionSettingsStorage tests. Tests are defined in |
| +// extension_settings_storage_unittest.cc with configurations for both cached |
| +// and non-cached leveldb storage, and cached no-op storage. |
| +class ExtensionSettingsStorageTest |
| + : public testing::TestWithParam<ExtensionSettingsStorageTestParam> { |
| + public: |
| + ExtensionSettingsStorageTest(); |
| + ~ExtensionSettingsStorageTest(); |
| + |
| + virtual void SetUp() OVERRIDE; |
| + virtual void TearDown() OVERRIDE; |
| + |
| + protected: |
| + ExtensionSettingsStorage* storage_; |
| + |
| + std::string key1_; |
| + std::string key2_; |
| + std::string key3_; |
| + 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.
|
| + Value* val2_; |
| + Value* val3_; |
| + ListValue* emptyList_; |
| + ListValue* list1_; |
| + ListValue* list2_; |
| + ListValue* list12_; |
| + ListValue* list13_; |
| + ListValue* list123_; |
| + DictionaryValue* emptyDict_; |
| + DictionaryValue* dict1_; |
| + DictionaryValue* dict12_; |
| + DictionaryValue* dict123_; |
| + |
| + private: |
| + void SetStorage(ExtensionSettingsStorage* storage); |
| + |
| + scoped_refptr<ExtensionSettings> settings_; |
| + MessageLoopForUI* ui_message_loop_; |
| + BrowserThread* ui_thread_; |
| + BrowserThread* file_thread_; |
| +}; |
| + |
| +#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_UNITTEST_H_ |