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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/stack_trace.h" | 9 #include "base/debug/stack_trace.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // be run instead of a renderer). | 65 // be run instead of a renderer). |
66 FilePath chrome_path; | 66 FilePath chrome_path; |
67 CHECK(PathService::Get(base::FILE_EXE, &chrome_path)); | 67 CHECK(PathService::Get(base::FILE_EXE, &chrome_path)); |
68 chrome_path = chrome_path.DirName(); | 68 chrome_path = chrome_path.DirName(); |
69 chrome_path = chrome_path.Append(chrome::kBrowserProcessExecutablePath); | 69 chrome_path = chrome_path.Append(chrome::kBrowserProcessExecutablePath); |
70 CHECK(PathService::Override(base::FILE_EXE, chrome_path)); | 70 CHECK(PathService::Override(base::FILE_EXE, chrome_path)); |
71 #endif // defined(OS_MACOSX) | 71 #endif // defined(OS_MACOSX) |
72 | 72 |
73 test_server_.reset(new net::TestServer( | 73 test_server_.reset(new net::TestServer( |
74 net::TestServer::TYPE_HTTP, | 74 net::TestServer::TYPE_HTTP, |
| 75 net::TestServer::kLocalhost, |
75 FilePath(FILE_PATH_LITERAL("chrome/test/data")))); | 76 FilePath(FILE_PATH_LITERAL("chrome/test/data")))); |
76 } | 77 } |
77 | 78 |
78 InProcessBrowserTest::~InProcessBrowserTest() { | 79 InProcessBrowserTest::~InProcessBrowserTest() { |
79 } | 80 } |
80 | 81 |
81 void InProcessBrowserTest::SetUp() { | 82 void InProcessBrowserTest::SetUp() { |
82 // Create a temporary user data directory if required. | 83 // Create a temporary user data directory if required. |
83 ASSERT_TRUE(CreateUserDataDirectory()) | 84 ASSERT_TRUE(CreateUserDataDirectory()) |
84 << "Could not create user data directory."; | 85 << "Could not create user data directory."; |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 if (BrowserList::size() == 0) | 326 if (BrowserList::size() == 0) |
326 return; | 327 return; |
327 | 328 |
328 // Invoke CloseAllBrowsersAndMayExit on a running message loop. | 329 // Invoke CloseAllBrowsersAndMayExit on a running message loop. |
329 // CloseAllBrowsersAndMayExit exits the message loop after everything has been | 330 // CloseAllBrowsersAndMayExit exits the message loop after everything has been |
330 // shut down properly. | 331 // shut down properly. |
331 MessageLoopForUI::current()->PostTask(FROM_HERE, | 332 MessageLoopForUI::current()->PostTask(FROM_HERE, |
332 base::Bind(&BrowserList::AttemptExit)); | 333 base::Bind(&BrowserList::AttemptExit)); |
333 ui_test_utils::RunMessageLoop(); | 334 ui_test_utils::RunMessageLoop(); |
334 } | 335 } |
OLD | NEW |