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

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

Issue 13533007: Test extension reloading behavior. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Define a local_state (PrefService) so tests don't crash when it's null Created 7 years, 8 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
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_SERVICE_UNITTEST_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_UNITTEST_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_UNITTEST_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_UNITTEST_H_
7 7
8 #include "base/at_exit.h" 8 #include "base/at_exit.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/message_loop.h" 13 #include "base/message_loop.h"
14 #include "chrome/browser/extensions/extension_service.h" 14 #include "chrome/browser/extensions/extension_service.h"
15 #include "chrome/common/extensions/extension_unittest.h" 15 #include "chrome/common/extensions/extension_unittest.h"
16 #include "chrome/common/extensions/feature_switch.h" 16 #include "chrome/common/extensions/feature_switch.h"
17 #include "chrome/test/base/scoped_testing_local_state.h"
18 #include "content/public/test/mock_render_process_host.h"
17 #include "content/public/test/test_browser_thread.h" 19 #include "content/public/test/test_browser_thread.h"
18 #include "testing/gtest/include/gtest/gtest.h" 20 #include "testing/gtest/include/gtest/gtest.h"
19 21
20 class TestingProfile; 22 class TestingProfile;
21 23
22 namespace extensions { 24 namespace extensions {
23 class ManagementPolicy; 25 class ManagementPolicy;
24 } 26 }
25 27
26 class ExtensionServiceTestBase : public extensions::ExtensionTest { 28 class ExtensionServiceTestBase : public extensions::ExtensionTest {
(...skipping 25 matching lines...) Expand all
52 void set_extensions_enabled(bool enabled) { 54 void set_extensions_enabled(bool enabled) {
53 service_->set_extensions_enabled(enabled); 55 service_->set_extensions_enabled(enabled);
54 } 56 }
55 57
56 protected: 58 protected:
57 void InitializeExtensionServiceHelper(bool autoupdate_enabled); 59 void InitializeExtensionServiceHelper(bool autoupdate_enabled);
58 60
59 MessageLoop loop_; 61 MessageLoop loop_;
60 base::ShadowingAtExitManager at_exit_manager_; 62 base::ShadowingAtExitManager at_exit_manager_;
61 base::ScopedTempDir temp_dir_; 63 base::ScopedTempDir temp_dir_;
64 content::MockRenderProcessHostFactory rph_factory_;
65 ScopedTestingLocalState local_state_;
62 scoped_ptr<TestingProfile> profile_; 66 scoped_ptr<TestingProfile> profile_;
63 base::FilePath extensions_install_dir_; 67 base::FilePath extensions_install_dir_;
64 base::FilePath data_dir_; 68 base::FilePath data_dir_;
65 // Managed by extensions::ExtensionSystemFactory. 69 // Managed by extensions::ExtensionSystemFactory.
66 ExtensionService* service_; 70 ExtensionService* service_;
67 extensions::ManagementPolicy* management_policy_; 71 extensions::ManagementPolicy* management_policy_;
68 size_t expected_extensions_count_; 72 size_t expected_extensions_count_;
69 content::TestBrowserThread ui_thread_; 73 content::TestBrowserThread ui_thread_;
70 content::TestBrowserThread db_thread_; 74 content::TestBrowserThread db_thread_;
71 content::TestBrowserThread webkit_thread_; 75 content::TestBrowserThread webkit_thread_;
72 content::TestBrowserThread file_thread_; 76 content::TestBrowserThread file_thread_;
73 content::TestBrowserThread file_user_blocking_thread_; 77 content::TestBrowserThread file_user_blocking_thread_;
74 content::TestBrowserThread io_thread_; 78 content::TestBrowserThread io_thread_;
75 extensions::FeatureSwitch::ScopedOverride override_sideload_wipeout_; 79 extensions::FeatureSwitch::ScopedOverride override_sideload_wipeout_;
76 }; 80 };
77 81
78 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_UNITTEST_H_ 82 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_UNITTEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698