Chromium Code Reviews| Index: chrome/browser/ui/fullscreen_controller_test.cc |
| diff --git a/chrome/browser/ui/fullscreen_controller_test.cc b/chrome/browser/ui/fullscreen_controller_test.cc |
| index 990d4151db662a3788d2cde83e7976b7b0825f54..bf0ad5b1a74c29ad2457a8956b24bf437f76ee96 100644 |
| --- a/chrome/browser/ui/fullscreen_controller_test.cc |
| +++ b/chrome/browser/ui/fullscreen_controller_test.cc |
| @@ -10,6 +10,7 @@ |
| #include "chrome/browser/ui/fullscreen_controller.h" |
| #include "chrome/common/chrome_switches.h" |
| #include "content/public/browser/web_contents.h" |
| +#include "content/public/test/test_navigation_observer.h" |
| using content::WebContents; |
| @@ -114,3 +115,40 @@ void FullscreenControllerTest::DenyCurrentFullscreenOrMouseLockRequest() { |
| browser()->fullscreen_controller_->GetFullscreenExitBubbleType(); |
| browser()->OnDenyFullscreenPermission(type); |
| } |
| + |
| +void FullscreenControllerTest::AddTabAtIndexAndWait(int index, const GURL& url, |
| + content::PageTransition transition) { |
| + content::TestNavigationObserver observer( |
| + content::NotificationService::AllSources(), NULL, 1); |
| + |
| + AddTabAtIndex(index, url, transition); |
| + |
| + observer.WaitForObservation( |
|
scheib
2012/06/18 23:08:07
Why not just observer.Wait()?
koz (OOO until 15th September)
2012/06/19 00:45:56
Ah, that's much nicer! The dangers of cargo cultin
|
| + base::Bind(&ui_test_utils::RunMessageLoop), |
| + base::Bind(&MessageLoop::Quit, |
| + base::Unretained(MessageLoopForUI::current()))); |
| +} |
| + |
| +void FullscreenControllerTest::GoBack() { |
| + content::TestNavigationObserver observer( |
| + content::NotificationService::AllSources(), NULL, 1); |
| + |
| + browser()->GoBack(CURRENT_TAB); |
| + |
| + observer.WaitForObservation( |
| + base::Bind(&ui_test_utils::RunMessageLoop), |
| + base::Bind(&MessageLoop::Quit, |
| + base::Unretained(MessageLoopForUI::current()))); |
| +} |
| + |
| +void FullscreenControllerTest::Reload() { |
| + content::TestNavigationObserver observer( |
| + content::NotificationService::AllSources(), NULL, 1); |
| + |
| + browser()->Reload(CURRENT_TAB); |
| + |
| + observer.WaitForObservation( |
| + base::Bind(&ui_test_utils::RunMessageLoop), |
| + base::Bind(&MessageLoop::Quit, |
| + base::Unretained(MessageLoopForUI::current()))); |
| +} |