| 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/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 Browser::TYPE_POPUP, app_name, gfx::Rect(), profile)); | 270 Browser::TYPE_POPUP, app_name, gfx::Rect(), profile)); |
| 271 AddBlankTabAndShow(browser); | 271 AddBlankTabAndShow(browser); |
| 272 return browser; | 272 return browser; |
| 273 } | 273 } |
| 274 | 274 |
| 275 void InProcessBrowserTest::AddBlankTabAndShow(Browser* browser) { | 275 void InProcessBrowserTest::AddBlankTabAndShow(Browser* browser) { |
| 276 content::WindowedNotificationObserver observer( | 276 content::WindowedNotificationObserver observer( |
| 277 content::NOTIFICATION_LOAD_STOP, | 277 content::NOTIFICATION_LOAD_STOP, |
| 278 content::NotificationService::AllSources()); | 278 content::NotificationService::AllSources()); |
| 279 chrome::AddSelectedTabWithURL(browser, GURL(chrome::kAboutBlankURL), | 279 chrome::AddSelectedTabWithURL(browser, GURL(chrome::kAboutBlankURL), |
| 280 content::PAGE_TRANSITION_START_PAGE); | 280 content::PAGE_TRANSITION_AUTO_TOPLEVEL); |
| 281 observer.Wait(); | 281 observer.Wait(); |
| 282 | 282 |
| 283 browser->window()->Show(); | 283 browser->window()->Show(); |
| 284 } | 284 } |
| 285 | 285 |
| 286 #if !defined(OS_MACOSX) | 286 #if !defined(OS_MACOSX) |
| 287 CommandLine InProcessBrowserTest::GetCommandLineForRelaunch() { | 287 CommandLine InProcessBrowserTest::GetCommandLineForRelaunch() { |
| 288 CommandLine new_command_line(CommandLine::ForCurrentProcess()->GetProgram()); | 288 CommandLine new_command_line(CommandLine::ForCurrentProcess()->GetProgram()); |
| 289 CommandLine::SwitchMap switches = | 289 CommandLine::SwitchMap switches = |
| 290 CommandLine::ForCurrentProcess()->GetSwitches(); | 290 CommandLine::ForCurrentProcess()->GetSwitches(); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 // On the Mac, this eventually reaches | 379 // On the Mac, this eventually reaches |
| 380 // -[BrowserWindowController windowWillClose:], which will post a deferred | 380 // -[BrowserWindowController windowWillClose:], which will post a deferred |
| 381 // -autorelease on itself to ultimately destroy the Browser object. The line | 381 // -autorelease on itself to ultimately destroy the Browser object. The line |
| 382 // below is necessary to pump these pending messages to ensure all Browsers | 382 // below is necessary to pump these pending messages to ensure all Browsers |
| 383 // get deleted. | 383 // get deleted. |
| 384 content::RunAllPendingInMessageLoop(); | 384 content::RunAllPendingInMessageLoop(); |
| 385 delete autorelease_pool_; | 385 delete autorelease_pool_; |
| 386 autorelease_pool_ = NULL; | 386 autorelease_pool_ = NULL; |
| 387 #endif | 387 #endif |
| 388 } | 388 } |
| OLD | NEW |