Index: content/public/test/browser_test_utils.cc |
diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc |
index 89dd3430e96dbca0330338b1fc035951d215e908..52f5fd72a62f96608beef9fe63b6c6e4d7c66a95 100644 |
--- a/content/public/test/browser_test_utils.cc |
+++ b/content/public/test/browser_test_utils.cc |
@@ -21,6 +21,7 @@ |
#include "content/public/browser/browser_context.h" |
#include "content/public/browser/dom_operation_notification_details.h" |
#include "content/public/browser/histogram_fetcher.h" |
+#include "content/public/browser/interstitial_page.h" |
#include "content/public/browser/navigation_entry.h" |
#include "content/public/browser/notification_service.h" |
#include "content/public/browser/notification_types.h" |
@@ -723,6 +724,29 @@ void RunTaskAndWaitForInterstitialDetach(content::WebContents* web_contents, |
loop_runner->Run(); |
} |
+bool WaitForInterstitialReady(content::InterstitialPage* interstitial) { |
+ content::RenderFrameHost* rfh = interstitial->GetMainFrame(); |
mattm
2015/01/22 02:28:32
Since the rest of this function isn't interstitial
meacer
2015/01/22 03:18:07
Done.
|
+ if (!rfh) |
+ return false; |
+ bool load_complete = false; |
+ EXPECT_TRUE( |
+ content::ExecuteScriptAndExtractBool( |
+ rfh, |
+ "(function() {" |
+ " var done = false;" |
+ " function checkState() {" |
+ " if (!done && document.readyState == 'complete') {" |
+ " done = true;" |
+ " window.domAutomationController.send(true);" |
+ " }" |
+ " }" |
+ " checkState();" |
+ " document.addEventListener('readystatechange', checkState);" |
+ "})();", |
+ &load_complete)); |
+ return load_complete; |
+} |
+ |
TitleWatcher::TitleWatcher(WebContents* web_contents, |
const base::string16& expected_title) |
: WebContentsObserver(web_contents), |