Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: chrome/browser/extensions/extension_settings_storage_unittest.h

Issue 7189029: Implement an initial extension settings API. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Change to RefCountedThreadSafe Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
31 virtual void SetUp() OVERRIDE;
32 virtual void TearDown() OVERRIDE;
33
34 protected:
35 ExtensionSettingsStorage* storage_;
36
37 std::string key1_;
38 std::string key2_;
39 std::string key3_;
40 scoped_ptr<Value> val1_;
41 scoped_ptr<Value> val2_;
42 scoped_ptr<Value> val3_;
43 scoped_ptr<ListValue> emptyList_;
44 scoped_ptr<ListValue> list1_;
45 scoped_ptr<ListValue> list2_;
46 scoped_ptr<ListValue> list12_;
47 scoped_ptr<ListValue> list13_;
48 scoped_ptr<ListValue> list123_;
49 scoped_ptr<DictionaryValue> emptyDict_;
50 scoped_ptr<DictionaryValue> dict1_;
51 scoped_ptr<DictionaryValue> dict12_;
52 scoped_ptr<DictionaryValue> dict123_;
53
54 private:
55 void SetStorage(ExtensionSettingsStorage* storage);
56
57 scoped_refptr<ExtensionSettings> settings_;
58 MessageLoopForUI* ui_message_loop_;
59 BrowserThread* ui_thread_;
60 BrowserThread* file_thread_;
61 };
62
63 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SETTINGS_STORAGE_UNITTEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698