OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 10 matching lines...) Expand all Loading... |
21 #include "chrome/browser/tab_contents/tab_contents.h" | 21 #include "chrome/browser/tab_contents/tab_contents.h" |
22 #if defined(OS_WIN) | 22 #if defined(OS_WIN) |
23 #include "chrome/browser/views/frame/browser_view.h" | 23 #include "chrome/browser/views/frame/browser_view.h" |
24 #endif | 24 #endif |
25 #include "chrome/common/chrome_constants.h" | 25 #include "chrome/common/chrome_constants.h" |
26 #include "chrome/common/chrome_paths.h" | 26 #include "chrome/common/chrome_paths.h" |
27 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
28 #include "chrome/common/main_function_params.h" | 28 #include "chrome/common/main_function_params.h" |
29 #include "chrome/common/notification_registrar.h" | 29 #include "chrome/common/notification_registrar.h" |
30 #include "chrome/common/notification_type.h" | 30 #include "chrome/common/notification_type.h" |
| 31 #include "chrome/common/url_constants.h" |
31 #include "chrome/test/testing_browser_process.h" | 32 #include "chrome/test/testing_browser_process.h" |
32 #include "chrome/test/ui_test_utils.h" | 33 #include "chrome/test/ui_test_utils.h" |
33 #include "sandbox/src/dep.h" | 34 #include "sandbox/src/dep.h" |
34 | 35 |
35 extern int BrowserMain(const MainFunctionParams&); | 36 extern int BrowserMain(const MainFunctionParams&); |
36 | 37 |
37 const wchar_t kUnitTestShowWindows[] = L"show-windows"; | 38 const wchar_t kUnitTestShowWindows[] = L"show-windows"; |
38 | 39 |
39 // Default delay for the time-out at which we stop the | 40 // Default delay for the time-out at which we stop the |
40 // inner-message loop the first time. | 41 // inner-message loop the first time. |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 L"chrome/test/data", | 166 L"chrome/test/data", |
166 g_browser_process->io_thread()->message_loop()); | 167 g_browser_process->io_thread()->message_loop()); |
167 return http_server_.get(); | 168 return http_server_.get(); |
168 } | 169 } |
169 | 170 |
170 // Creates a browser with a single tab (about:blank), waits for the tab to | 171 // Creates a browser with a single tab (about:blank), waits for the tab to |
171 // finish loading and shows the browser. | 172 // finish loading and shows the browser. |
172 Browser* InProcessBrowserTest::CreateBrowser(Profile* profile) { | 173 Browser* InProcessBrowserTest::CreateBrowser(Profile* profile) { |
173 Browser* browser = Browser::Create(profile); | 174 Browser* browser = Browser::Create(profile); |
174 | 175 |
175 browser->AddTabWithURL( | 176 browser->AddTabWithURL(GURL(chrome::kAboutBlankURL), GURL(), |
176 GURL("about:blank"), GURL(), PageTransition::START_PAGE, true, -1, false, | 177 PageTransition::START_PAGE, true, -1, false, NULL); |
177 NULL); | |
178 | 178 |
179 // Wait for the page to finish loading. | 179 // Wait for the page to finish loading. |
180 ui_test_utils::WaitForNavigation( | 180 ui_test_utils::WaitForNavigation( |
181 &browser->GetSelectedTabContents()->controller()); | 181 &browser->GetSelectedTabContents()->controller()); |
182 | 182 |
183 browser->window()->Show(); | 183 browser->window()->Show(); |
184 | 184 |
185 return browser; | 185 return browser; |
186 } | 186 } |
187 | 187 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 NewRunnableMethod(this, &InProcessBrowserTest::TimedOut), | 251 NewRunnableMethod(this, &InProcessBrowserTest::TimedOut), |
252 kSubsequentTimeoutInMS); | 252 kSubsequentTimeoutInMS); |
253 | 253 |
254 MessageLoopForUI::current()->Quit(); | 254 MessageLoopForUI::current()->Quit(); |
255 } | 255 } |
256 | 256 |
257 void InProcessBrowserTest::SetInitialTimeoutInMS(int timeout_value) { | 257 void InProcessBrowserTest::SetInitialTimeoutInMS(int timeout_value) { |
258 DCHECK_GT(timeout_value, 0); | 258 DCHECK_GT(timeout_value, 0); |
259 initial_timeout_ = timeout_value; | 259 initial_timeout_ = timeout_value; |
260 } | 260 } |
OLD | NEW |