| 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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 return incognito; | 240 return incognito; |
| 241 } | 241 } |
| 242 | 242 |
| 243 Browser* InProcessBrowserTest::CreateBrowserForPopup(Profile* profile) { | 243 Browser* InProcessBrowserTest::CreateBrowserForPopup(Profile* profile) { |
| 244 Browser* browser = Browser::CreateForType(Browser::TYPE_POPUP, profile); | 244 Browser* browser = Browser::CreateForType(Browser::TYPE_POPUP, profile); |
| 245 AddBlankTabAndShow(browser); | 245 AddBlankTabAndShow(browser); |
| 246 return browser; | 246 return browser; |
| 247 } | 247 } |
| 248 | 248 |
| 249 void InProcessBrowserTest::AddBlankTabAndShow(Browser* browser) { | 249 void InProcessBrowserTest::AddBlankTabAndShow(Browser* browser) { |
| 250 OnBeforeShowBrowser(browser); |
| 250 ui_test_utils::WindowedNotificationObserver observer( | 251 ui_test_utils::WindowedNotificationObserver observer( |
| 251 content::NOTIFICATION_LOAD_STOP, | 252 content::NOTIFICATION_LOAD_STOP, |
| 252 content::NotificationService::AllSources()); | 253 content::NotificationService::AllSources()); |
| 253 browser->AddSelectedTabWithURL( | 254 browser->AddSelectedTabWithURL( |
| 254 GURL(chrome::kAboutBlankURL), content::PAGE_TRANSITION_START_PAGE); | 255 GURL(chrome::kAboutBlankURL), content::PAGE_TRANSITION_START_PAGE); |
| 255 observer.Wait(); | 256 observer.Wait(); |
| 256 | 257 |
| 257 #if defined(USE_AURA) | 258 #if defined(USE_AURA) |
| 258 // Disable animations on aura, otherwise any code that gets the bounds may get | 259 // Disable animations on aura, otherwise any code that gets the bounds may get |
| 259 // the wrong thing. | 260 // the wrong thing. |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 if (BrowserList::size() == 0) | 336 if (BrowserList::size() == 0) |
| 336 return; | 337 return; |
| 337 | 338 |
| 338 // Invoke CloseAllBrowsersAndMayExit on a running message loop. | 339 // Invoke CloseAllBrowsersAndMayExit on a running message loop. |
| 339 // CloseAllBrowsersAndMayExit exits the message loop after everything has been | 340 // CloseAllBrowsersAndMayExit exits the message loop after everything has been |
| 340 // shut down properly. | 341 // shut down properly. |
| 341 MessageLoopForUI::current()->PostTask(FROM_HERE, | 342 MessageLoopForUI::current()->PostTask(FROM_HERE, |
| 342 base::Bind(&BrowserList::AttemptExit)); | 343 base::Bind(&BrowserList::AttemptExit)); |
| 343 ui_test_utils::RunMessageLoop(); | 344 ui_test_utils::RunMessageLoop(); |
| 344 } | 345 } |
| OLD | NEW |