diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-09 19:48:55 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-09 19:48:55 +0000 |
commit | 120f05fa80e35a372331dfe901e65c74383d3d30 (patch) | |
tree | 6db2020ab2f6f41805524b3aa693d04c146f4057 /chrome/test/ui_test_utils.cc | |
parent | 45904e20797f8cd28a776ed0e40ba94dc4eef97e (diff) | |
download | chromium_src-120f05fa80e35a372331dfe901e65c74383d3d30.zip chromium_src-120f05fa80e35a372331dfe901e65c74383d3d30.tar.gz chromium_src-120f05fa80e35a372331dfe901e65c74383d3d30.tar.bz2 |
revert until I can figure out why the tests are hanging
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13448 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/ui_test_utils.cc')
-rw-r--r-- | chrome/test/ui_test_utils.cc | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/chrome/test/ui_test_utils.cc b/chrome/test/ui_test_utils.cc index 6af1091..47e3ef2 100644 --- a/chrome/test/ui_test_utils.cc +++ b/chrome/test/ui_test_utils.cc @@ -20,11 +20,8 @@ namespace { // Used to block until a navigation completes. class NavigationNotificationObserver : public NotificationObserver { public: - NavigationNotificationObserver(NavigationController* controller, - int number_of_navigations) - : navigation_started_(false), - navigations_completed_(0), - number_of_navigations_(number_of_navigations) { + explicit NavigationNotificationObserver(NavigationController* controller) + : navigation_started_(false) { registrar_.Add(this, NotificationType::NAV_ENTRY_COMMITTED, Source<NavigationController>(controller)); registrar_.Add(this, NotificationType::LOAD_START, @@ -41,8 +38,7 @@ class NavigationNotificationObserver : public NotificationObserver { type == NotificationType::LOAD_START) { navigation_started_ = true; } else if (type == NotificationType::LOAD_STOP) { - if (navigation_started_ && - ++navigations_completed_ == number_of_navigations_) { + if (navigation_started_) { navigation_started_ = false; MessageLoopForUI::current()->Quit(); } @@ -55,12 +51,6 @@ class NavigationNotificationObserver : public NotificationObserver { // If true the navigation has started. bool navigation_started_; - // The number of navigations that have been completed. - int navigations_completed_; - - // The number of navigations to wait for. - int number_of_navigations_; - DISALLOW_COPY_AND_ASSIGN(NavigationNotificationObserver); }; @@ -76,26 +66,15 @@ void RunMessageLoop() { } void WaitForNavigation(NavigationController* controller) { - WaitForNavigations(controller, 1); -} - -void WaitForNavigations(NavigationController* controller, - int number_of_navigations) { - NavigationNotificationObserver observer(controller, number_of_navigations); + NavigationNotificationObserver observer(controller); } void NavigateToURL(Browser* browser, const GURL& url) { - NavigateToURLBlockUntilNavigationsComplete(browser, url, 1); -} - -void NavigateToURLBlockUntilNavigationsComplete(Browser* browser, - const GURL& url, - int number_of_navigations) { NavigationController* controller = browser->GetSelectedTabContents()->controller(); browser->OpenURLFromTab(browser->GetSelectedTabContents(), url, GURL(), CURRENT_TAB, PageTransition::TYPED); - WaitForNavigations(controller, number_of_navigations); + WaitForNavigation(controller); } } // namespace ui_test_utils |