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