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 #include "chrome/test/base/in_process_browser_test.h" | 5 #include "chrome/test/base/in_process_browser_test.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/stack_trace.h" | 10 #include "base/debug/stack_trace.h" |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
14 #include "base/string_number_conversions.h" | 14 #include "base/string_number_conversions.h" |
15 #include "base/test/test_file_util.h" | 15 #include "base/test/test_file_util.h" |
16 #include "base/test/test_switches.h" | |
17 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
18 #include "chrome/browser/io_thread.h" | 17 #include "chrome/browser/io_thread.h" |
19 #include "chrome/browser/lifetime/application_lifetime.h" | 18 #include "chrome/browser/lifetime/application_lifetime.h" |
20 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
21 #include "chrome/browser/profiles/profile_manager.h" | 20 #include "chrome/browser/profiles/profile_manager.h" |
22 #include "chrome/browser/ui/browser.h" | 21 #include "chrome/browser/ui/browser.h" |
23 #include "chrome/browser/ui/browser_list.h" | 22 #include "chrome/browser/ui/browser_list.h" |
24 #include "chrome/browser/ui/browser_navigator.h" | 23 #include "chrome/browser/ui/browser_navigator.h" |
25 #include "chrome/browser/ui/browser_tabstrip.h" | 24 #include "chrome/browser/ui/browser_tabstrip.h" |
26 #include "chrome/browser/ui/browser_window.h" | 25 #include "chrome/browser/ui/browser_window.h" |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 | 276 |
278 browser->window()->Show(); | 277 browser->window()->Show(); |
279 } | 278 } |
280 | 279 |
281 #if !defined(OS_MACOSX) | 280 #if !defined(OS_MACOSX) |
282 CommandLine InProcessBrowserTest::GetCommandLineForRelaunch() { | 281 CommandLine InProcessBrowserTest::GetCommandLineForRelaunch() { |
283 CommandLine new_command_line(CommandLine::ForCurrentProcess()->GetProgram()); | 282 CommandLine new_command_line(CommandLine::ForCurrentProcess()->GetProgram()); |
284 CommandLine::SwitchMap switches = | 283 CommandLine::SwitchMap switches = |
285 CommandLine::ForCurrentProcess()->GetSwitches(); | 284 CommandLine::ForCurrentProcess()->GetSwitches(); |
286 switches.erase(switches::kUserDataDir); | 285 switches.erase(switches::kUserDataDir); |
287 switches.erase(switches::kSingleProcessTestsFlag); | 286 switches.erase(test_launcher::kSingleProcessTestsFlag); |
288 switches.erase(switches::kSingleProcessChromeFlag); | 287 switches.erase(test_launcher::kSingleProcessTestsAndChromeFlag); |
289 new_command_line.AppendSwitch(ChromeTestSuite::kLaunchAsBrowser); | 288 new_command_line.AppendSwitch(ChromeTestSuite::kLaunchAsBrowser); |
290 | 289 |
291 #if defined(USE_AURA) | 290 #if defined(USE_AURA) |
292 // Copy what UITestBase::SetLaunchSwitches() does, and also what | 291 // Copy what UITestBase::SetLaunchSwitches() does, and also what |
293 // ChromeTestSuite does if the process had went into the test path. Otherwise | 292 // ChromeTestSuite does if the process had went into the test path. Otherwise |
294 // tests will fail on bots. | 293 // tests will fail on bots. |
295 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 294 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
296 switches::kDisableTestCompositor)) { | 295 switches::kDisableTestCompositor)) { |
297 new_command_line.AppendSwitch(switches::kTestCompositor); | 296 new_command_line.AppendSwitch(switches::kTestCompositor); |
298 } | 297 } |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 // On the Mac, this eventually reaches | 388 // On the Mac, this eventually reaches |
390 // -[BrowserWindowController windowWillClose:], which will post a deferred | 389 // -[BrowserWindowController windowWillClose:], which will post a deferred |
391 // -autorelease on itself to ultimately destroy the Browser object. The line | 390 // -autorelease on itself to ultimately destroy the Browser object. The line |
392 // below is necessary to pump these pending messages to ensure all Browsers | 391 // below is necessary to pump these pending messages to ensure all Browsers |
393 // get deleted. | 392 // get deleted. |
394 ui_test_utils::RunAllPendingInMessageLoop(); | 393 ui_test_utils::RunAllPendingInMessageLoop(); |
395 delete autorelease_pool_; | 394 delete autorelease_pool_; |
396 autorelease_pool_ = NULL; | 395 autorelease_pool_ = NULL; |
397 #endif | 396 #endif |
398 } | 397 } |
OLD | NEW |