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

Unified Diff: content/test/browser_test_utils.cc

Issue 10823029: Move WaitForLoadStop from ui_test_utils to browser_test_utils so that it can be reused in content_b… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 | « content/public/test/browser_test_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/browser_test_utils.cc
===================================================================
--- content/test/browser_test_utils.cc (revision 148448)
+++ content/test/browser_test_utils.cc (working copy)
@@ -159,6 +159,18 @@
return url;
}
+void WaitForLoadStop(WebContents* web_contents) {
+ WindowedNotificationObserver load_stop_observer(
+ NOTIFICATION_LOAD_STOP,
+ Source<NavigationController>(&web_contents->GetController()));
+ // In many cases, the load may have finished before we get here. Only wait if
+ // the tab still has a pending navigation.
+ if (!web_contents->IsLoading())
+ return;
+ load_stop_observer.Wait();
+}
+
+
void SimulateMouseClick(WebContents* web_contents) {
int x = web_contents->GetView()->GetContainerSize().width() / 2;
int y = web_contents->GetView()->GetContainerSize().height() / 2;
« no previous file with comments | « content/public/test/browser_test_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698