| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 return incognito; | 235 return incognito; |
| 236 } | 236 } |
| 237 | 237 |
| 238 Browser* InProcessBrowserTest::CreateBrowserForPopup(Profile* profile) { | 238 Browser* InProcessBrowserTest::CreateBrowserForPopup(Profile* profile) { |
| 239 Browser* browser = Browser::CreateForType(Browser::TYPE_POPUP, profile); | 239 Browser* browser = Browser::CreateForType(Browser::TYPE_POPUP, profile); |
| 240 AddBlankTabAndShow(browser); | 240 AddBlankTabAndShow(browser); |
| 241 return browser; | 241 return browser; |
| 242 } | 242 } |
| 243 | 243 |
| 244 void InProcessBrowserTest::AddBlankTabAndShow(Browser* browser) { | 244 void InProcessBrowserTest::AddBlankTabAndShow(Browser* browser) { |
| 245 OnBeforeShowBrowser(browser); |
| 245 ui_test_utils::WindowedNotificationObserver observer( | 246 ui_test_utils::WindowedNotificationObserver observer( |
| 246 content::NOTIFICATION_LOAD_STOP, | 247 content::NOTIFICATION_LOAD_STOP, |
| 247 content::NotificationService::AllSources()); | 248 content::NotificationService::AllSources()); |
| 248 browser->AddSelectedTabWithURL( | 249 browser->AddSelectedTabWithURL( |
| 249 GURL(chrome::kAboutBlankURL), content::PAGE_TRANSITION_START_PAGE); | 250 GURL(chrome::kAboutBlankURL), content::PAGE_TRANSITION_START_PAGE); |
| 250 observer.Wait(); | 251 observer.Wait(); |
| 251 | 252 |
| 252 browser->window()->Show(); | 253 browser->window()->Show(); |
| 253 } | 254 } |
| 254 | 255 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 if (BrowserList::size() == 0) | 323 if (BrowserList::size() == 0) |
| 323 return; | 324 return; |
| 324 | 325 |
| 325 // Invoke CloseAllBrowsersAndMayExit on a running message loop. | 326 // Invoke CloseAllBrowsersAndMayExit on a running message loop. |
| 326 // CloseAllBrowsersAndMayExit exits the message loop after everything has been | 327 // CloseAllBrowsersAndMayExit exits the message loop after everything has been |
| 327 // shut down properly. | 328 // shut down properly. |
| 328 MessageLoopForUI::current()->PostTask(FROM_HERE, | 329 MessageLoopForUI::current()->PostTask(FROM_HERE, |
| 329 base::Bind(&BrowserList::AttemptExit)); | 330 base::Bind(&BrowserList::AttemptExit)); |
| 330 ui_test_utils::RunMessageLoop(); | 331 ui_test_utils::RunMessageLoop(); |
| 331 } | 332 } |
| OLD | NEW |