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

Add new test that fails with RenderDocument for subframes.

Navigating a subframe to the same address should not cause a history
entry to be created.

Change-Id: I5ee1bdc8e28c80b402db788fae686058c33810f7
Bug: 1068965
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2147490
Commit-Queue: Fergal Daly <fergal@chromium.org>
Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#759528}
parent 55e65579
......@@ -126,6 +126,10 @@ class NavigationControllerBrowserTest : public ContentBrowserTest {
"internals.runtimeFlags.fractionalScrollOffsetsEnabled";
return EvalJs(shell(), script).ExtractBool();
}
WebContentsImpl* contents() const {
return static_cast<WebContentsImpl*>(shell()->web_contents());
}
};
// Base class for tests that need to supply modifications to EmbeddedTestServer
......@@ -10565,4 +10569,31 @@ IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
}
}
// Navigating a subframe to the same URL should not generate a history entry.
IN_PROC_BROWSER_TEST_F(NavigationControllerBrowserTest,
NoHistoryOnNavigationToSameUrl) {
{
GURL frame_url = embedded_test_server()->GetURL(
"a.com", "/cross_site_iframe_factory.html?a(a)");
ASSERT_TRUE(NavigateToURL(shell(), frame_url));
FrameTreeNode* child = contents()->GetFrameTree()->root()->child_at(0);
GURL child_url = child->current_url();
int entry_count = contents()->GetController().GetEntryCount();
ASSERT_TRUE(NavigateFrameToURL(child, child_url));
EXPECT_EQ(entry_count, contents()->GetController().GetEntryCount());
}
{
GURL frame_url = embedded_test_server()->GetURL(
"a.com", "/cross_site_iframe_factory.html?a(b)");
ASSERT_TRUE(NavigateToURL(shell(), frame_url));
FrameTreeNode* child = contents()->GetFrameTree()->root()->child_at(0);
GURL child_url = child->current_url();
int entry_count = contents()->GetController().GetEntryCount();
ASSERT_TRUE(NavigateFrameToURL(child, child_url));
EXPECT_EQ(entry_count, contents()->GetController().GetEntryCount());
}
}
} // namespace content
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