Commit b06113af authored by Fergal Daly's avatar Fergal Daly Committed by Commit Bot

Fix tests broken by RenderDocument for subframes.

This is a bunch of tests that are broken by the fact that the RFH
changes after navigation.

Change-Id: I10578a56bbb382dd1e41a57f645e75d5ff51a3ba
Bug: 1064944
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2245166Reviewed-by: default avatarNicolás Peña Moreno <npm@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarArthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Commit-Queue: Fergal Daly <fergal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#779353}
parent 7838d652
...@@ -524,6 +524,8 @@ IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, Subframe) { ...@@ -524,6 +524,8 @@ IN_PROC_BROWSER_TEST_F(HistoryBrowserTest, Subframe) {
NavigateFrameToURL(frame, manual_subframe); NavigateFrameToURL(frame, manual_subframe);
ASSERT_TRUE(HistoryContainsURL(manual_subframe)); ASSERT_TRUE(HistoryContainsURL(manual_subframe));
// After navigation, the current RenderFrameHost may change.
frame = rfh_grabber.render_frame_host();
// Page-initiated location.replace subframe navigations should not show up in // Page-initiated location.replace subframe navigations should not show up in
// history. // history.
std::string script = "location.replace('form.html')"; std::string script = "location.replace('form.html')";
......
...@@ -1825,6 +1825,8 @@ IN_PROC_BROWSER_TEST_F( ...@@ -1825,6 +1825,8 @@ IN_PROC_BROWSER_TEST_F(
web_contents(), "iframe1", web_contents(), "iframe1",
embedded_test_server()->GetURL( embedded_test_server()->GetURL(
"a.com", "/ads_observer/expensive_animation_frame.html?delay=0")); "a.com", "/ads_observer/expensive_animation_frame.html?delay=0"));
// After navigation, the RenderFrameHost may change.
frame1 = content::FrameMatchingPredicate(web_contents(), frame1_pred);
WaitForRAF(&message_queue1); WaitForRAF(&message_queue1);
EXPECT_EQ(frame1->GetProcess(), EXPECT_EQ(frame1->GetProcess(),
content::FrameMatchingPredicate(web_contents(), frame1_pred) content::FrameMatchingPredicate(web_contents(), frame1_pred)
......
...@@ -3527,6 +3527,8 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest, ...@@ -3527,6 +3527,8 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest,
// Fill in the password and submit the form. This shouldn't bring up a save // Fill in the password and submit the form. This shouldn't bring up a save
// password prompt and shouldn't result in a renderer kill. // password prompt and shouldn't result in a renderer kill.
SubmitInjectedPasswordForm(WebContents(), frame, submit_url); SubmitInjectedPasswordForm(WebContents(), frame, submit_url);
// After navigation, the RenderFrameHost may change.
frame = ChildFrameAt(WebContents()->GetMainFrame(), 0);
EXPECT_TRUE(frame->IsRenderFrameLive()); EXPECT_TRUE(frame->IsRenderFrameLive());
EXPECT_EQ(submit_url, frame->GetLastCommittedURL()); EXPECT_EQ(submit_url, frame->GetLastCommittedURL());
EXPECT_FALSE(prompt_observer->IsSavePromptAvailable()); EXPECT_FALSE(prompt_observer->IsSavePromptAvailable());
......
...@@ -2035,6 +2035,9 @@ TEST_F(WebContentsImplTestWithSiteIsolation, StartStopEventsBalance) { ...@@ -2035,6 +2035,9 @@ TEST_F(WebContentsImplTestWithSiteIsolation, StartStopEventsBalance) {
EXPECT_TRUE(observer.is_loading()); EXPECT_TRUE(observer.is_loading());
EXPECT_TRUE(observer.did_receive_response()); EXPECT_TRUE(observer.did_receive_response());
// After navigation, the RenderFrameHost may change.
subframe = static_cast<TestRenderFrameHost*>(
contents()->GetFrameTree()->root()->child_at(0)->current_frame_host());
// Navigate the frame again, this time using LoadURLWithParams. This causes // Navigate the frame again, this time using LoadURLWithParams. This causes
// RenderFrameHost to call into WebContents::DidStartLoading, which starts // RenderFrameHost to call into WebContents::DidStartLoading, which starts
// the spinner. // the spinner.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment