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

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

Issue 1947683005: Add test renderer host support to ExtensionServiceTestBase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests that end up creating two RenderViewHostFactories. Created 4 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_TEST_BASE_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_TEST_BASE_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_TEST_BASE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_TEST_BASE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <string> 11 #include <string>
12 12
13 #include "base/at_exit.h" 13 #include "base/at_exit.h"
14 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
15 #include "base/files/scoped_temp_dir.h" 15 #include "base/files/scoped_temp_dir.h"
16 #include "base/macros.h" 16 #include "base/macros.h"
17 #include "build/build_config.h" 17 #include "build/build_config.h"
18 #include "chrome/test/base/scoped_testing_local_state.h" 18 #include "chrome/test/base/scoped_testing_local_state.h"
19 #include "content/public/test/test_browser_thread_bundle.h" 19 #include "content/public/test/test_browser_thread_bundle.h"
20 #include "content/public/test/test_renderer_host.h"
20 #include "content/public/test/test_utils.h" 21 #include "content/public/test/test_utils.h"
21 #include "testing/gtest/include/gtest/gtest.h" 22 #include "testing/gtest/include/gtest/gtest.h"
22 23
23 #if defined(OS_CHROMEOS) 24 #if defined(OS_CHROMEOS)
24 #include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h" 25 #include "chrome/browser/chromeos/login/users/scoped_test_user_manager.h"
25 #include "chrome/browser/chromeos/settings/cros_settings.h" 26 #include "chrome/browser/chromeos/settings/cros_settings.h"
26 #include "chrome/browser/chromeos/settings/device_settings_service.h" 27 #include "chrome/browser/chromeos/settings/device_settings_service.h"
27 #endif 28 #endif
28 29
29 class ExtensionService; 30 class ExtensionService;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 128
128 private: 129 private:
129 // Must be declared before anything that may make use of the 130 // Must be declared before anything that may make use of the
130 // directory so as to ensure files are closed before cleanup. 131 // directory so as to ensure files are closed before cleanup.
131 base::ScopedTempDir temp_dir_; 132 base::ScopedTempDir temp_dir_;
132 133
133 // Destroying at_exit_manager_ will delete all LazyInstances, so it must come 134 // Destroying at_exit_manager_ will delete all LazyInstances, so it must come
134 // after thread_bundle_ in the destruction order. 135 // after thread_bundle_ in the destruction order.
135 base::ShadowingAtExitManager at_exit_manager_; 136 base::ShadowingAtExitManager at_exit_manager_;
136 137
138 // Enable creation of WebContents without initializing a renderer.
139 content::RenderViewHostTestEnabler rvh_test_enabler_;
140
137 std::unique_ptr<content::TestBrowserThreadBundle> thread_bundle_; 141 std::unique_ptr<content::TestBrowserThreadBundle> thread_bundle_;
138 142
139 protected: 143 protected:
140 // It's unfortunate that these are exposed to subclasses (rather than used 144 // It's unfortunate that these are exposed to subclasses (rather than used
141 // through the accessor methods above), but too many tests already use them 145 // through the accessor methods above), but too many tests already use them
142 // directly. 146 // directly.
143 147
144 // The associated testing profile. 148 // The associated testing profile.
145 std::unique_ptr<TestingProfile> profile_; 149 std::unique_ptr<TestingProfile> profile_;
146 150
(...skipping 24 matching lines...) Expand all
171 chromeos::ScopedTestCrosSettings test_cros_settings_; 175 chromeos::ScopedTestCrosSettings test_cros_settings_;
172 chromeos::ScopedTestUserManager test_user_manager_; 176 chromeos::ScopedTestUserManager test_user_manager_;
173 #endif 177 #endif
174 178
175 DISALLOW_COPY_AND_ASSIGN(ExtensionServiceTestBase); 179 DISALLOW_COPY_AND_ASSIGN(ExtensionServiceTestBase);
176 }; 180 };
177 181
178 } // namespace extensions 182 } // namespace extensions
179 183
180 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_TEST_BASE_H_ 184 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_TEST_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698