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

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

Issue 1254363004: Move ownership of AppSorting from ExtensionPrefs to ExtensionSystem (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add missing include Created 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_PREFS_UNITTEST_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_UNITTEST_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_UNITTEST_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_UNITTEST_H_
7 7
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "chrome/browser/extensions/test_extension_prefs.h" 9 #include "chrome/browser/extensions/test_extension_prefs.h"
10 #include "content/public/test/test_browser_thread.h" 10 #include "content/public/test/test_browser_thread.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace base { 13 namespace base {
14 class Value; 14 class Value;
15 } 15 }
16 16
17 namespace user_prefs { 17 namespace user_prefs {
18 class PrefRegistrySyncable; 18 class PrefRegistrySyncable;
19 } 19 }
20 20
21 namespace extensions { 21 namespace extensions {
22 class ChromeAppSorting;
22 class Extension; 23 class Extension;
23 24
24 // Base class for extension preference-related unit tests. 25 // Base class for extension preference-related unit tests.
25 class ExtensionPrefsTest : public testing::Test { 26 class ExtensionPrefsTest : public testing::Test {
26 public: 27 public:
27 ExtensionPrefsTest(); 28 ExtensionPrefsTest();
28 ~ExtensionPrefsTest() override; 29 ~ExtensionPrefsTest() override;
29 30
30 // This function will get called once, and is the right place to do operations 31 // This function will get called once, and is the right place to do operations
31 // on ExtensionPrefs that write data. 32 // on ExtensionPrefs that write data.
32 virtual void Initialize() = 0; 33 virtual void Initialize() = 0;
33 34
34 // This function will be called twice - once while the original ExtensionPrefs 35 // This function will be called twice - once while the original ExtensionPrefs
35 // object is still alive, and once after recreation. Thus, it tests that 36 // object is still alive, and once after recreation. Thus, it tests that
36 // things don't break after any ExtensionPrefs startup work. 37 // things don't break after any ExtensionPrefs startup work.
37 virtual void Verify() = 0; 38 virtual void Verify() = 0;
38 39
39 // This function is called to Register preference default values. 40 // This function is called to Register preference default values.
40 virtual void RegisterPreferences(user_prefs::PrefRegistrySyncable* registry); 41 virtual void RegisterPreferences(user_prefs::PrefRegistrySyncable* registry);
41 42
42 void SetUp() override; 43 void SetUp() override;
43 44
44 void TearDown() override; 45 void TearDown() override;
45 46
46 protected: 47 protected:
47 ExtensionPrefs* prefs() { return prefs_.prefs(); } 48 ExtensionPrefs* prefs() { return prefs_.prefs(); }
49 ChromeAppSorting* app_sorting() { return prefs_.app_sorting(); }
48 50
49 base::MessageLoop message_loop_; 51 base::MessageLoop message_loop_;
50 content::TestBrowserThread ui_thread_; 52 content::TestBrowserThread ui_thread_;
51 53
52 TestExtensionPrefs prefs_; 54 TestExtensionPrefs prefs_;
53 55
54 private: 56 private:
55 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefsTest); 57 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefsTest);
56 }; 58 };
57 59
(...skipping 18 matching lines...) Expand all
76 scoped_refptr<Extension> extension3_; 78 scoped_refptr<Extension> extension3_;
77 scoped_refptr<Extension> extension4_; 79 scoped_refptr<Extension> extension4_;
78 80
79 private: 81 private:
80 DISALLOW_COPY_AND_ASSIGN(PrefsPrepopulatedTestBase); 82 DISALLOW_COPY_AND_ASSIGN(PrefsPrepopulatedTestBase);
81 }; 83 };
82 84
83 } // namespace extensions 85 } // namespace extensions
84 86
85 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_UNITTEST_H_ 87 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREFS_UNITTEST_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/chrome_extensions_browser_client.cc ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698