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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc

Issue 829263004: Add WaitForInterstitialReady to browser_test_utils. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 5 years, 11 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/browser/safe_browsing/safe_browsing_blocking_page_test.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc
index 9bb0809b1846bca0d71f530b39683d29cc3964b3..bd22f4b5a682c77a79bba079832adc5460c3d825 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc
@@ -512,20 +512,11 @@ class SafeBrowsingBlockingPageBrowserTest
}
bool WaitForReady() {
- content::RenderViewHost* rvh = GetRenderViewHost();
- if (!rvh)
+ InterstitialPage* interstitial = InterstitialPage::GetInterstitialPage(
+ browser()->tab_strip_model()->GetActiveWebContents());
+ if (!interstitial)
return false;
- // Wait until all <script> tags have executed, including jstemplate.
- // TODO(joaodasilva): it would be nice to avoid the busy loop, though in
- // practice it spins at most once or twice.
- std::string ready_state;
- do {
- scoped_ptr<base::Value> value = content::ExecuteScriptAndGetValue(
- rvh->GetMainFrame(), "document.readyState");
- if (!value.get() || !value->GetAsString(&ready_state))
- return false;
- } while (ready_state != "complete");
- return true;
+ return content::WaitForRenderFrameReady(interstitial->GetMainFrame());
}
Visibility GetVisibility(const std::string& node_id) {
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_blocking_page.cc ('k') | content/public/test/browser_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698