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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 | 232 |
233 #if defined(OS_WIN) | 233 #if defined(OS_WIN) |
234 BrowserView::SetShowState(-1); | 234 BrowserView::SetShowState(-1); |
235 #endif | 235 #endif |
236 | 236 |
237 *CommandLine::ForCurrentProcessMutable() = *original_command_line_; | 237 *CommandLine::ForCurrentProcessMutable() = *original_command_line_; |
238 RenderProcessHost::set_run_renderer_in_process(original_single_process_); | 238 RenderProcessHost::set_run_renderer_in_process(original_single_process_); |
239 } | 239 } |
240 | 240 |
241 HTTPTestServer* InProcessBrowserTest::StartHTTPServer() { | 241 HTTPTestServer* InProcessBrowserTest::StartHTTPServer() { |
242 // The HTTPServer must run on the IO thread. | |
243 DCHECK(!http_server_.get()); | 242 DCHECK(!http_server_.get()); |
244 http_server_ = HTTPTestServer::CreateServer( | 243 http_server_ = HTTPTestServer::CreateServer( |
245 L"chrome/test/data", | 244 L"chrome/test/data"); |
246 g_browser_process->io_thread()->message_loop()); | |
247 return http_server_.get(); | 245 return http_server_.get(); |
248 } | 246 } |
249 | 247 |
250 // Creates a browser with a single tab (about:blank), waits for the tab to | 248 // Creates a browser with a single tab (about:blank), waits for the tab to |
251 // finish loading and shows the browser. | 249 // finish loading and shows the browser. |
252 Browser* InProcessBrowserTest::CreateBrowser(Profile* profile) { | 250 Browser* InProcessBrowserTest::CreateBrowser(Profile* profile) { |
253 Browser* browser = Browser::Create(profile); | 251 Browser* browser = Browser::Create(profile); |
254 | 252 |
255 browser->AddTabWithURL(GURL(chrome::kAboutBlankURL), GURL(), | 253 browser->AddTabWithURL(GURL(chrome::kAboutBlankURL), GURL(), |
256 PageTransition::START_PAGE, -1, | 254 PageTransition::START_PAGE, -1, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 | 337 |
340 GTEST_NONFATAL_FAILURE_(error_message.c_str()); | 338 GTEST_NONFATAL_FAILURE_(error_message.c_str()); |
341 | 339 |
342 MessageLoopForUI::current()->Quit(); | 340 MessageLoopForUI::current()->Quit(); |
343 } | 341 } |
344 | 342 |
345 void InProcessBrowserTest::SetInitialTimeoutInMS(int timeout_value) { | 343 void InProcessBrowserTest::SetInitialTimeoutInMS(int timeout_value) { |
346 DCHECK_GT(timeout_value, 0); | 344 DCHECK_GT(timeout_value, 0); |
347 initial_timeout_ = timeout_value; | 345 initial_timeout_ = timeout_value; |
348 } | 346 } |
OLD | NEW |