| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/in_process_browser_test.h" | 5 #include "chrome/test/in_process_browser_test.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/mac/scoped_nsautorelease_pool.h" | 10 #include "base/mac/scoped_nsautorelease_pool.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "content/browser/tab_contents/tab_contents.h" | 36 #include "content/browser/tab_contents/tab_contents.h" |
| 37 #include "content/common/main_function_params.h" | 37 #include "content/common/main_function_params.h" |
| 38 #include "content/common/notification_type.h" | 38 #include "content/common/notification_type.h" |
| 39 #include "content/renderer/mock_content_renderer_client.h" | 39 #include "content/renderer/mock_content_renderer_client.h" |
| 40 #include "net/base/mock_host_resolver.h" | 40 #include "net/base/mock_host_resolver.h" |
| 41 #include "net/test/test_server.h" | 41 #include "net/test/test_server.h" |
| 42 #include "sandbox/src/dep.h" | 42 #include "sandbox/src/dep.h" |
| 43 | 43 |
| 44 #if defined(OS_MACOSX) | 44 #if defined(OS_MACOSX) |
| 45 #include "base/mac/mac_util.h" | 45 #include "base/mac/mac_util.h" |
| 46 #include "base/system_monitor/system_monitor.h" |
| 46 #endif | 47 #endif |
| 47 | 48 |
| 48 #if defined(OS_WIN) | 49 #if defined(OS_WIN) |
| 49 #include "chrome/browser/ui/views/frame/browser_frame_win.h" | 50 #include "chrome/browser/ui/views/frame/browser_frame_win.h" |
| 50 #endif | 51 #endif |
| 51 | 52 |
| 52 #if defined(OS_CHROMEOS) | 53 #if defined(OS_CHROMEOS) |
| 53 #include "chrome/browser/chromeos/audio_handler.h" | 54 #include "chrome/browser/chromeos/audio_handler.h" |
| 54 #endif | 55 #endif |
| 55 | 56 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 75 // Passed as value of kTestType. | 76 // Passed as value of kTestType. |
| 76 static const char kBrowserTestType[] = "browser"; | 77 static const char kBrowserTestType[] = "browser"; |
| 77 | 78 |
| 78 InProcessBrowserTest::InProcessBrowserTest() | 79 InProcessBrowserTest::InProcessBrowserTest() |
| 79 : browser_(NULL), | 80 : browser_(NULL), |
| 80 show_window_(false), | 81 show_window_(false), |
| 81 dom_automation_enabled_(false), | 82 dom_automation_enabled_(false), |
| 82 tab_closeable_state_watcher_enabled_(false) { | 83 tab_closeable_state_watcher_enabled_(false) { |
| 83 #if defined(OS_MACOSX) | 84 #if defined(OS_MACOSX) |
| 84 base::mac::SetOverrideAmIBundled(true); | 85 base::mac::SetOverrideAmIBundled(true); |
| 86 base::SystemMonitor::AllocateSystemIOPorts(); |
| 85 #endif | 87 #endif |
| 86 | 88 |
| 87 // Before we run the browser, we have to hack the path to the exe to match | 89 // Before we run the browser, we have to hack the path to the exe to match |
| 88 // what it would be if Chrome was running, because it is used to fork renderer | 90 // what it would be if Chrome was running, because it is used to fork renderer |
| 89 // processes, on Linux at least (failure to do so will cause a browser_test to | 91 // processes, on Linux at least (failure to do so will cause a browser_test to |
| 90 // be run instead of a renderer). | 92 // be run instead of a renderer). |
| 91 FilePath chrome_path; | 93 FilePath chrome_path; |
| 92 CHECK(PathService::Get(base::FILE_EXE, &chrome_path)); | 94 CHECK(PathService::Get(base::FILE_EXE, &chrome_path)); |
| 93 chrome_path = chrome_path.DirName(); | 95 chrome_path = chrome_path.DirName(); |
| 94 chrome_path = chrome_path.Append(chrome::kBrowserProcessExecutablePath); | 96 chrome_path = chrome_path.Append(chrome::kBrowserProcessExecutablePath); |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 return; | 353 return; |
| 352 | 354 |
| 353 // Invoke CloseAllBrowsersAndMayExit on a running message loop. | 355 // Invoke CloseAllBrowsersAndMayExit on a running message loop. |
| 354 // CloseAllBrowsersAndMayExit exits the message loop after everything has been | 356 // CloseAllBrowsersAndMayExit exits the message loop after everything has been |
| 355 // shut down properly. | 357 // shut down properly. |
| 356 MessageLoopForUI::current()->PostTask( | 358 MessageLoopForUI::current()->PostTask( |
| 357 FROM_HERE, | 359 FROM_HERE, |
| 358 NewRunnableFunction(&BrowserList::AttemptExit)); | 360 NewRunnableFunction(&BrowserList::AttemptExit)); |
| 359 ui_test_utils::RunMessageLoop(); | 361 ui_test_utils::RunMessageLoop(); |
| 360 } | 362 } |
| OLD | NEW |