Chromium Code Reviews| 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..bc341b37057d5aaf17bfb541c14fccc95b8a23d1 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" |
|
mattm
2015/01/22 04:51:27
no longer needed
meacer
2015/01/22 18:31:37
Done.
|
| #include "content/public/browser/navigation_entry.h" |
| #include "content/public/browser/notification_service.h" |
| #include "content/public/browser/notification_types.h" |
| @@ -723,6 +724,28 @@ void RunTaskAndWaitForInterstitialDetach(content::WebContents* web_contents, |
| loop_runner->Run(); |
| } |
| +bool WaitForRenderFrameReady(RenderFrameHost* rfh) { |
| + if (!rfh) |
| + return false; |
| + std::string result; |
| + EXPECT_TRUE( |
| + content::ExecuteScriptAndExtractString( |
| + rfh, |
| + "(function() {" |
| + " var done = false;" |
| + " function checkState() {" |
| + " if (!done && document.readyState == 'complete') {" |
| + " done = true;" |
| + " window.domAutomationController.send('pageLoadComplete');" |
| + " }" |
| + " }" |
| + " checkState();" |
| + " document.addEventListener('readystatechange', checkState);" |
|
Paweł Hajdan Jr.
2015/01/22 15:43:10
I might be wrong (not a JS/DOM expert), but should
mmenke
2015/01/22 15:53:25
Javascript and the DOM are essentially single-thre
mmenke
2015/01/22 15:55:00
That is, they can't change except as a result of a
|
| + "})();", |
| + &result)); |
| + return result == "pageLoadComplete"; |
| +} |
| + |
| TitleWatcher::TitleWatcher(WebContents* web_contents, |
| const base::string16& expected_title) |
| : WebContentsObserver(web_contents), |