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

Unified Diff: chrome/test/ui_test_utils.cc

Issue 6730016: Fix flakiness and enable RenderViewHostManagerTest on Linux/Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix additional flakiness. Created 9 years, 9 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
Index: chrome/test/ui_test_utils.cc
diff --git a/chrome/test/ui_test_utils.cc b/chrome/test/ui_test_utils.cc
index cdd7d0a363e2f95f0d7d9fe10662bc964cea42aa..0de28ed2e15be1e024bc286ccc59bf87f72f972e 100644
--- a/chrome/test/ui_test_utils.cc
+++ b/chrome/test/ui_test_utils.cc
@@ -444,10 +444,14 @@ void WaitForBrowserActionUpdated(ExtensionAction* browser_action) {
Source<ExtensionAction>(browser_action));
}
-void WaitForLoadStop(NavigationController* controller) {
+void WaitForLoadStop(TabContents* tab) {
+ // In many cases, the load may have finished before we get here. Only wait if
+ // the tab still has a pending navigation.
+ if (!tab->is_loading() && !tab->render_manager()->pending_render_view_host())
+ return;
TestNotificationObserver observer;
RegisterAndWait(&observer, NotificationType::LOAD_STOP,
- Source<NavigationController>(controller));
+ Source<NavigationController>(&tab->controller()));
}
Browser* WaitForNewBrowser() {

Powered by Google App Engine
This is Rietveld 408576698