Chromium Code Reviews| OLD | NEW | 
|---|---|
| 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_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ | 5 #ifndef CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ | 
| 6 #define CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ | 6 #define CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ | 
| 7 | 7 | 
| 8 #include <memory> | 8 #include <memory> | 
| 9 | 9 | 
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" | 
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 205 | 205 | 
| 206 void set_open_about_blank_on_browser_launch(bool value) { | 206 void set_open_about_blank_on_browser_launch(bool value) { | 
| 207 open_about_blank_on_browser_launch_ = value; | 207 open_about_blank_on_browser_launch_ = value; | 
| 208 } | 208 } | 
| 209 | 209 | 
| 210 // This must be called before RunTestOnMainThreadLoop() to have any effect. | 210 // This must be called before RunTestOnMainThreadLoop() to have any effect. | 
| 211 void set_multi_desktop_test(bool multi_desktop_test) { | 211 void set_multi_desktop_test(bool multi_desktop_test) { | 
| 212 multi_desktop_test_ = multi_desktop_test; | 212 multi_desktop_test_ = multi_desktop_test; | 
| 213 } | 213 } | 
| 214 | 214 | 
| 215 void enable_component_update() { enable_component_update_ = true; } | |
| 216 | |
| 215 // Runs accessibility checks and sets |error_message| if it fails. | 217 // Runs accessibility checks and sets |error_message| if it fails. | 
| 216 bool RunAccessibilityChecks(std::string* error_message); | 218 bool RunAccessibilityChecks(std::string* error_message); | 
| 217 | 219 | 
| 218 private: | 220 private: | 
| 219 // Creates a user data directory for the test if one is needed. Returns true | 221 // Creates a user data directory for the test if one is needed. Returns true | 
| 220 // if successful. | 222 // if successful. | 
| 221 virtual bool CreateUserDataDirectory() WARN_UNUSED_RESULT; | 223 virtual bool CreateUserDataDirectory() WARN_UNUSED_RESULT; | 
| 222 | 224 | 
| 223 // Quits all open browsers and waits until there are no more browsers. | 225 // Quits all open browsers and waits until there are no more browsers. | 
| 224 void QuitBrowsers(); | 226 void QuitBrowsers(); | 
| 225 | 227 | 
| 226 // Prepare command line that will be used to launch the child browser process | 228 // Prepare command line that will be used to launch the child browser process | 
| 227 // with an in-process test. | 229 // with an in-process test. | 
| 228 void PrepareTestCommandLine(base::CommandLine* command_line); | 230 void PrepareTestCommandLine(base::CommandLine* command_line); | 
| 
 
Paweł Hajdan Jr.
2016/05/24 20:45:40
How about we make this method virtual and override
 
xhwang
2016/05/24 21:16:30
Thanks for the comment. Let me give it a try.
 
xhwang
2016/05/25 06:42:38
Done.
 
 | |
| 229 | 231 | 
| 230 // Browser created from CreateBrowser. | 232 // Browser created from CreateBrowser. | 
| 231 Browser* browser_; | 233 Browser* browser_; | 
| 232 | 234 | 
| 233 // Temporary user data directory. Used only when a user data directory is not | 235 // Temporary user data directory. Used only when a user data directory is not | 
| 234 // specified in the command line. | 236 // specified in the command line. | 
| 235 base::ScopedTempDir temp_user_data_dir_; | 237 base::ScopedTempDir temp_user_data_dir_; | 
| 236 | 238 | 
| 237 // True if we should exit the tests after the last browser instance closes. | 239 // True if we should exit the tests after the last browser instance closes. | 
| 238 bool exit_when_last_browser_closes_; | 240 bool exit_when_last_browser_closes_; | 
| 239 | 241 | 
| 240 // True if the about:blank tab should be opened when the browser is launched. | 242 // True if the about:blank tab should be opened when the browser is launched. | 
| 241 bool open_about_blank_on_browser_launch_; | 243 bool open_about_blank_on_browser_launch_; | 
| 242 | 244 | 
| 243 // True if this is a multi-desktop test (in which case this browser test will | 245 // True if this is a multi-desktop test (in which case this browser test will | 
| 244 // not ensure that Browsers are only created on the tested desktop). | 246 // not ensure that Browsers are only created on the tested desktop). | 
| 245 bool multi_desktop_test_; | 247 bool multi_desktop_test_; | 
| 246 | 248 | 
| 247 // True if the accessibility test should run for a particular test case. | 249 // True if the accessibility test should run for a particular test case. | 
| 248 // This is reset for every test case. | 250 // This is reset for every test case. | 
| 249 bool run_accessibility_checks_for_test_case_; | 251 bool run_accessibility_checks_for_test_case_; | 
| 250 | 252 | 
| 253 bool enable_component_update_; | |
| 254 | |
| 251 #if defined(OS_MACOSX) | 255 #if defined(OS_MACOSX) | 
| 252 base::mac::ScopedNSAutoreleasePool* autorelease_pool_; | 256 base::mac::ScopedNSAutoreleasePool* autorelease_pool_; | 
| 253 std::unique_ptr<ScopedBundleSwizzlerMac> bundle_swizzler_; | 257 std::unique_ptr<ScopedBundleSwizzlerMac> bundle_swizzler_; | 
| 254 #endif // OS_MACOSX | 258 #endif // OS_MACOSX | 
| 255 | 259 | 
| 256 #if defined(OS_WIN) | 260 #if defined(OS_WIN) | 
| 257 std::unique_ptr<base::win::ScopedCOMInitializer> com_initializer_; | 261 std::unique_ptr<base::win::ScopedCOMInitializer> com_initializer_; | 
| 258 #endif | 262 #endif | 
| 259 }; | 263 }; | 
| 260 | 264 | 
| 261 #endif // CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ | 265 #endif // CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ | 
| OLD | NEW |