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" |
11 #include "base/scoped_nsautorelease_pool.h" | 11 #include "base/scoped_nsautorelease_pool.h" |
| 12 #include "base/string_number_conversions.h" |
12 #include "base/test/test_file_util.h" | 13 #include "base/test/test_file_util.h" |
13 #include "chrome/browser/browser.h" | 14 #include "chrome/browser/browser.h" |
14 #include "chrome/browser/browser_list.h" | 15 #include "chrome/browser/browser_list.h" |
15 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
16 #include "chrome/browser/browser_shutdown.h" | 17 #include "chrome/browser/browser_shutdown.h" |
17 #include "chrome/browser/browser_window.h" | 18 #include "chrome/browser/browser_window.h" |
18 #include "chrome/browser/chrome_thread.h" | 19 #include "chrome/browser/chrome_thread.h" |
19 #include "chrome/browser/intranet_redirect_detector.h" | 20 #include "chrome/browser/intranet_redirect_detector.h" |
20 #include "chrome/browser/io_thread.h" | 21 #include "chrome/browser/io_thread.h" |
21 #include "chrome/browser/net/url_request_mock_util.h" | 22 #include "chrome/browser/net/url_request_mock_util.h" |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 // CloseAllBrowsersAndExit exits the message loop after everything has been | 324 // CloseAllBrowsersAndExit exits the message loop after everything has been |
324 // shut down properly. | 325 // shut down properly. |
325 MessageLoopForUI::current()->PostTask( | 326 MessageLoopForUI::current()->PostTask( |
326 FROM_HERE, | 327 FROM_HERE, |
327 NewRunnableFunction(&BrowserList::CloseAllBrowsersAndExit)); | 328 NewRunnableFunction(&BrowserList::CloseAllBrowsersAndExit)); |
328 ui_test_utils::RunMessageLoop(); | 329 ui_test_utils::RunMessageLoop(); |
329 } | 330 } |
330 | 331 |
331 void InProcessBrowserTest::TimedOut() { | 332 void InProcessBrowserTest::TimedOut() { |
332 std::string error_message = "Test timed out. Each test runs for a max of "; | 333 std::string error_message = "Test timed out. Each test runs for a max of "; |
333 error_message += IntToString(kInitialTimeoutInMS); | 334 error_message += base::IntToString(kInitialTimeoutInMS); |
334 error_message += " ms (kInitialTimeoutInMS)."; | 335 error_message += " ms (kInitialTimeoutInMS)."; |
335 | 336 |
336 GTEST_NONFATAL_FAILURE_(error_message.c_str()); | 337 GTEST_NONFATAL_FAILURE_(error_message.c_str()); |
337 | 338 |
338 MessageLoopForUI::current()->Quit(); | 339 MessageLoopForUI::current()->Quit(); |
339 } | 340 } |
340 | 341 |
341 void InProcessBrowserTest::SetInitialTimeoutInMS(int timeout_value) { | 342 void InProcessBrowserTest::SetInitialTimeoutInMS(int timeout_value) { |
342 DCHECK_GT(timeout_value, 0); | 343 DCHECK_GT(timeout_value, 0); |
343 initial_timeout_ = timeout_value; | 344 initial_timeout_ = timeout_value; |
344 } | 345 } |
OLD | NEW |