OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "chrome/common/chrome_constants.h" | 29 #include "chrome/common/chrome_constants.h" |
30 #include "chrome/common/chrome_paths.h" | 30 #include "chrome/common/chrome_paths.h" |
31 #include "chrome/common/chrome_switches.h" | 31 #include "chrome/common/chrome_switches.h" |
32 #include "chrome/common/main_function_params.h" | 32 #include "chrome/common/main_function_params.h" |
33 #include "chrome/common/notification_registrar.h" | 33 #include "chrome/common/notification_registrar.h" |
34 #include "chrome/common/notification_type.h" | 34 #include "chrome/common/notification_type.h" |
35 #include "chrome/common/url_constants.h" | 35 #include "chrome/common/url_constants.h" |
36 #include "chrome/test/testing_browser_process.h" | 36 #include "chrome/test/testing_browser_process.h" |
37 #include "chrome/test/ui_test_utils.h" | 37 #include "chrome/test/ui_test_utils.h" |
38 #include "net/base/mock_host_resolver.h" | 38 #include "net/base/mock_host_resolver.h" |
| 39 #include "net/test/test_server.h" |
39 #include "sandbox/src/dep.h" | 40 #include "sandbox/src/dep.h" |
40 | 41 |
41 #if defined(OS_LINUX) | 42 #if defined(OS_LINUX) |
42 #include "base/singleton.h" | 43 #include "base/singleton.h" |
43 #include "chrome/browser/renderer_host/render_sandbox_host_linux.h" | 44 #include "chrome/browser/renderer_host/render_sandbox_host_linux.h" |
44 #include "chrome/browser/zygote_host_linux.h" | 45 #include "chrome/browser/zygote_host_linux.h" |
45 | 46 |
46 namespace { | 47 namespace { |
47 | 48 |
48 // A helper class to do Linux-only initialization only once per process. | 49 // A helper class to do Linux-only initialization only once per process. |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 browser_shutdown::delete_resources_on_shutdown = true; | 232 browser_shutdown::delete_resources_on_shutdown = true; |
232 | 233 |
233 #if defined(OS_WIN) | 234 #if defined(OS_WIN) |
234 BrowserView::SetShowState(-1); | 235 BrowserView::SetShowState(-1); |
235 #endif | 236 #endif |
236 | 237 |
237 *CommandLine::ForCurrentProcessMutable() = *original_command_line_; | 238 *CommandLine::ForCurrentProcessMutable() = *original_command_line_; |
238 RenderProcessHost::set_run_renderer_in_process(original_single_process_); | 239 RenderProcessHost::set_run_renderer_in_process(original_single_process_); |
239 } | 240 } |
240 | 241 |
241 HTTPTestServer* InProcessBrowserTest::StartHTTPServer() { | 242 net::HTTPTestServer* InProcessBrowserTest::StartHTTPServer() { |
242 DCHECK(!http_server_.get()); | 243 DCHECK(!http_server_.get()); |
243 http_server_ = HTTPTestServer::CreateServer( | 244 http_server_ = net::HTTPTestServer::CreateServer( |
244 L"chrome/test/data"); | 245 L"chrome/test/data"); |
245 return http_server_.get(); | 246 return http_server_.get(); |
246 } | 247 } |
247 | 248 |
248 // Creates a browser with a single tab (about:blank), waits for the tab to | 249 // Creates a browser with a single tab (about:blank), waits for the tab to |
249 // finish loading and shows the browser. | 250 // finish loading and shows the browser. |
250 Browser* InProcessBrowserTest::CreateBrowser(Profile* profile) { | 251 Browser* InProcessBrowserTest::CreateBrowser(Profile* profile) { |
251 Browser* browser = Browser::Create(profile); | 252 Browser* browser = Browser::Create(profile); |
252 | 253 |
253 browser->AddTabWithURL(GURL(chrome::kAboutBlankURL), GURL(), | 254 browser->AddTabWithURL(GURL(chrome::kAboutBlankURL), GURL(), |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 | 338 |
338 GTEST_NONFATAL_FAILURE_(error_message.c_str()); | 339 GTEST_NONFATAL_FAILURE_(error_message.c_str()); |
339 | 340 |
340 MessageLoopForUI::current()->Quit(); | 341 MessageLoopForUI::current()->Quit(); |
341 } | 342 } |
342 | 343 |
343 void InProcessBrowserTest::SetInitialTimeoutInMS(int timeout_value) { | 344 void InProcessBrowserTest::SetInitialTimeoutInMS(int timeout_value) { |
344 DCHECK_GT(timeout_value, 0); | 345 DCHECK_GT(timeout_value, 0); |
345 initial_timeout_ = timeout_value; | 346 initial_timeout_ = timeout_value; |
346 } | 347 } |
OLD | NEW |