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/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "chrome/common/chrome_switches.h" | 30 #include "chrome/common/chrome_switches.h" |
31 #include "chrome/common/logging_chrome.h" | 31 #include "chrome/common/logging_chrome.h" |
32 #include "chrome/common/url_constants.h" | 32 #include "chrome/common/url_constants.h" |
33 #include "chrome/renderer/chrome_content_renderer_client.h" | 33 #include "chrome/renderer/chrome_content_renderer_client.h" |
34 #include "chrome/test/base/chrome_test_suite.h" | 34 #include "chrome/test/base/chrome_test_suite.h" |
35 #include "chrome/test/base/test_launcher_utils.h" | 35 #include "chrome/test/base/test_launcher_utils.h" |
36 #include "chrome/test/base/testing_browser_process.h" | 36 #include "chrome/test/base/testing_browser_process.h" |
37 #include "chrome/test/base/ui_test_utils.h" | 37 #include "chrome/test/base/ui_test_utils.h" |
38 #include "content/public/browser/notification_service.h" | 38 #include "content/public/browser/notification_service.h" |
39 #include "content/public/browser/notification_types.h" | 39 #include "content/public/browser/notification_types.h" |
| 40 #include "content/public/common/content_switches.h" |
40 #include "content/public/test/browser_test_utils.h" | 41 #include "content/public/test/browser_test_utils.h" |
41 #include "content/public/test/test_browser_thread.h" | 42 #include "content/public/test/test_browser_thread.h" |
42 #include "content/public/test/test_launcher.h" | 43 #include "content/public/test/test_launcher.h" |
43 #include "content/public/test/test_navigation_observer.h" | 44 #include "content/public/test/test_navigation_observer.h" |
44 #include "net/base/mock_host_resolver.h" | 45 #include "net/base/mock_host_resolver.h" |
45 #include "net/test/test_server.h" | 46 #include "net/test/test_server.h" |
46 #include "ui/compositor/compositor_switches.h" | 47 #include "ui/compositor/compositor_switches.h" |
47 | 48 |
48 #if defined(OS_CHROMEOS) | 49 #if defined(OS_CHROMEOS) |
49 #include "chrome/browser/chromeos/audio/audio_handler.h" | 50 #include "chrome/browser/chromeos/audio/audio_handler.h" |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 } | 284 } |
284 | 285 |
285 #if !defined(OS_MACOSX) | 286 #if !defined(OS_MACOSX) |
286 CommandLine InProcessBrowserTest::GetCommandLineForRelaunch() { | 287 CommandLine InProcessBrowserTest::GetCommandLineForRelaunch() { |
287 CommandLine new_command_line(CommandLine::ForCurrentProcess()->GetProgram()); | 288 CommandLine new_command_line(CommandLine::ForCurrentProcess()->GetProgram()); |
288 CommandLine::SwitchMap switches = | 289 CommandLine::SwitchMap switches = |
289 CommandLine::ForCurrentProcess()->GetSwitches(); | 290 CommandLine::ForCurrentProcess()->GetSwitches(); |
290 switches.erase(switches::kUserDataDir); | 291 switches.erase(switches::kUserDataDir); |
291 switches.erase(content::kSingleProcessTestsFlag); | 292 switches.erase(content::kSingleProcessTestsFlag); |
292 switches.erase(switches::kSingleProcess); | 293 switches.erase(switches::kSingleProcess); |
293 new_command_line.AppendSwitch(content::kLaunchAsBrowser); | 294 new_command_line.AppendSwitch(switches::kLaunchAsBrowser); |
294 | 295 |
295 #if defined(USE_AURA) | 296 #if defined(USE_AURA) |
296 // Copy what UITestBase::SetLaunchSwitches() does, and also what | 297 // Copy what UITestBase::SetLaunchSwitches() does, and also what |
297 // ChromeTestSuite does if the process had went into the test path. Otherwise | 298 // ChromeTestSuite does if the process had went into the test path. Otherwise |
298 // tests will fail on bots. | 299 // tests will fail on bots. |
299 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 300 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
300 switches::kDisableTestCompositor)) { | 301 switches::kDisableTestCompositor)) { |
301 new_command_line.AppendSwitch(switches::kTestCompositor); | 302 new_command_line.AppendSwitch(switches::kTestCompositor); |
302 } | 303 } |
303 #endif | 304 #endif |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 // On the Mac, this eventually reaches | 379 // On the Mac, this eventually reaches |
379 // -[BrowserWindowController windowWillClose:], which will post a deferred | 380 // -[BrowserWindowController windowWillClose:], which will post a deferred |
380 // -autorelease on itself to ultimately destroy the Browser object. The line | 381 // -autorelease on itself to ultimately destroy the Browser object. The line |
381 // below is necessary to pump these pending messages to ensure all Browsers | 382 // below is necessary to pump these pending messages to ensure all Browsers |
382 // get deleted. | 383 // get deleted. |
383 content::RunAllPendingInMessageLoop(); | 384 content::RunAllPendingInMessageLoop(); |
384 delete autorelease_pool_; | 385 delete autorelease_pool_; |
385 autorelease_pool_ = NULL; | 386 autorelease_pool_ = NULL; |
386 #endif | 387 #endif |
387 } | 388 } |
OLD | NEW |