From d40b47010ab680dd4a1a1071dbad5e2c5efaf481 Mon Sep 17 00:00:00 2001 From: lfg Date: Tue, 10 Feb 2015 16:59:35 -0800 Subject: Listen to LOAD_STOP notification instead of NAV_ENTRY_COMMITED when navigating iframes in browser tests. BUG=436250 Review URL: https://codereview.chromium.org/876183003 Cr-Commit-Position: refs/heads/master@{#315695} --- content/public/test/browser_test_utils.cc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc index 5de8137..173b7cb 100644 --- a/content/public/test/browser_test_utils.cc +++ b/content/public/test/browser_test_utils.cc @@ -262,18 +262,13 @@ scoped_ptr CrossSiteRedirectResponseHandler( bool NavigateIframeToURL(WebContents* web_contents, std::string iframe_id, const GURL& url) { - // TODO(creis): This should wait for LOAD_STOP, but cross-site subframe - // navigations generate extra DidStartLoading and DidStopLoading messages. - // Until we replace swappedout:// with frame proxies, we need to listen for - // something else. For now, we trigger NEW_SUBFRAME navigations and listen - // for commit. See https://crbug.com/436250. std::string script = base::StringPrintf( "setTimeout(\"" "var iframes = document.getElementById('%s');iframes.src='%s';" "\",0)", iframe_id.c_str(), url.spec().c_str()); WindowedNotificationObserver load_observer( - NOTIFICATION_NAV_ENTRY_COMMITTED, + NOTIFICATION_LOAD_STOP, Source(&web_contents->GetController())); bool result = ExecuteScript(web_contents, script); load_observer.Wait(); -- cgit v1.1