Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(807)

Unified Diff: chrome/browser/crash_recovery_browsertest.cc

Issue 7633032: Revert 96593 - Fix up various browser tests not to use WaitForNavigation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browser_focus_uitest.cc ('k') | chrome/browser/geolocation/geolocation_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/crash_recovery_browsertest.cc
===================================================================
--- chrome/browser/crash_recovery_browsertest.cc (revision 96616)
+++ chrome/browser/crash_recovery_browsertest.cc (working copy)
@@ -4,7 +4,6 @@
#include "base/file_path.h"
#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
@@ -16,12 +15,12 @@
namespace {
void SimulateRendererCrash(Browser* browser) {
- ui_test_utils::WindowedNotificationObserver observer(
- content::NOTIFICATION_TAB_CONTENTS_DISCONNECTED,
- NotificationService::AllSources());
browser->OpenURL(GURL(chrome::kChromeUICrashURL), GURL(), CURRENT_TAB,
PageTransition::TYPED);
- observer.Wait();
+ LOG(ERROR) << "SimulateRendererCrash, before WaitForNotification";
+ ui_test_utils::WaitForNotification(
+ content::NOTIFICATION_TAB_CONTENTS_DISCONNECTED);
+ LOG(ERROR) << "SimulateRendererCrash, after WaitForNotification";
}
} // namespace
@@ -43,12 +42,10 @@
ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(),
&title_before_crash));
SimulateRendererCrash(browser());
- ui_test_utils::WindowedNotificationObserver observer(
- content::NOTIFICATION_LOAD_STOP,
- Source<NavigationController>(
- &browser()->GetSelectedTabContentsWrapper()->controller()));
browser()->Reload(CURRENT_TAB);
- observer.Wait();
+ LOG(ERROR) << "Before WaitForNavigationInCurrentTab";
+ ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser()));
+ LOG(ERROR) << "After WaitForNavigationInCurrentTab";
ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(),
&title_after_crash));
EXPECT_NE(title_before_crash, title_after_crash);
@@ -72,12 +69,10 @@
ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(),
&title_before_crash));
SimulateRendererCrash(browser());
- ui_test_utils::WindowedNotificationObserver observer(
- content::NOTIFICATION_LOAD_STOP,
- Source<NavigationController>(
- &browser()->GetSelectedTabContentsWrapper()->controller()));
browser()->Reload(CURRENT_TAB);
- observer.Wait();
+ LOG(ERROR) << "Before WaitForNavigationInCurrentTab";
+ ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser()));
+ LOG(ERROR) << "After WaitForNavigationInCurrentTab";
ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(),
&title_after_crash));
EXPECT_EQ(title_before_crash, title_after_crash);
« no previous file with comments | « chrome/browser/browser_focus_uitest.cc ('k') | chrome/browser/geolocation/geolocation_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698