| 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/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/stack_trace.h" | 10 #include "base/debug/stack_trace.h" |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 const std::string& app_name, | 267 const std::string& app_name, |
| 268 Profile* profile) { | 268 Profile* profile) { |
| 269 Browser* browser = Browser::CreateWithParams( | 269 Browser* browser = Browser::CreateWithParams( |
| 270 Browser::CreateParams::CreateForApp( | 270 Browser::CreateParams::CreateForApp( |
| 271 Browser::TYPE_POPUP, app_name, gfx::Rect(), profile)); | 271 Browser::TYPE_POPUP, app_name, gfx::Rect(), profile)); |
| 272 AddBlankTabAndShow(browser); | 272 AddBlankTabAndShow(browser); |
| 273 return browser; | 273 return browser; |
| 274 } | 274 } |
| 275 | 275 |
| 276 void InProcessBrowserTest::AddBlankTabAndShow(Browser* browser) { | 276 void InProcessBrowserTest::AddBlankTabAndShow(Browser* browser) { |
| 277 ui_test_utils::WindowedNotificationObserver observer( | 277 content::WindowedNotificationObserver observer( |
| 278 content::NOTIFICATION_LOAD_STOP, | 278 content::NOTIFICATION_LOAD_STOP, |
| 279 content::NotificationService::AllSources()); | 279 content::NotificationService::AllSources()); |
| 280 chrome::AddSelectedTabWithURL(browser, GURL(chrome::kAboutBlankURL), | 280 chrome::AddSelectedTabWithURL(browser, GURL(chrome::kAboutBlankURL), |
| 281 content::PAGE_TRANSITION_START_PAGE); | 281 content::PAGE_TRANSITION_START_PAGE); |
| 282 observer.Wait(); | 282 observer.Wait(); |
| 283 | 283 |
| 284 browser->window()->Show(); | 284 browser->window()->Show(); |
| 285 } | 285 } |
| 286 | 286 |
| 287 #if !defined(OS_MACOSX) | 287 #if !defined(OS_MACOSX) |
| 288 CommandLine InProcessBrowserTest::GetCommandLineForRelaunch() { | 288 CommandLine InProcessBrowserTest::GetCommandLineForRelaunch() { |
| 289 CommandLine new_command_line(CommandLine::ForCurrentProcess()->GetProgram()); | 289 CommandLine new_command_line(CommandLine::ForCurrentProcess()->GetProgram()); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 // On the Mac, this eventually reaches | 395 // On the Mac, this eventually reaches |
| 396 // -[BrowserWindowController windowWillClose:], which will post a deferred | 396 // -[BrowserWindowController windowWillClose:], which will post a deferred |
| 397 // -autorelease on itself to ultimately destroy the Browser object. The line | 397 // -autorelease on itself to ultimately destroy the Browser object. The line |
| 398 // below is necessary to pump these pending messages to ensure all Browsers | 398 // below is necessary to pump these pending messages to ensure all Browsers |
| 399 // get deleted. | 399 // get deleted. |
| 400 ui_test_utils::RunAllPendingInMessageLoop(); | 400 ui_test_utils::RunAllPendingInMessageLoop(); |
| 401 delete autorelease_pool_; | 401 delete autorelease_pool_; |
| 402 autorelease_pool_ = NULL; | 402 autorelease_pool_ = NULL; |
| 403 #endif | 403 #endif |
| 404 } | 404 } |
| OLD | NEW |