Commit 8fa10fd9 authored by sreejakshetty@chromium.org's avatar sreejakshetty@chromium.org Committed by Commit Bot

[content] Make NavigateToURLFromRenderer work for same-document navigations

Currently, renderer-initiated same-document navigation using
NavigateToURLFromRenderer results in runloop timeout as
TestFrameNavigationObserver::DidStartNavigation is excluded for
SameDocumentNavigations.

This CL proposes a fix to this scenario.

Bug: 1065868
Change-Id: I9d2e7c619f3fce756d3b3f6d2196aa86820208d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2127028
Commit-Queue: Sreeja Kamishetty <sreejakshetty@chromium.org>
Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#757017}
parent 6c45b9b3
......@@ -3860,8 +3860,7 @@ IN_PROC_BROWSER_TEST_F(BackForwardCacheBrowserTest, MetricsNotRecorded) {
EXPECT_TRUE(WaitForLoadStop(shell()->web_contents()));
// 3) Navigate to B#2 (same document navigation).
EXPECT_TRUE(ExecJs(shell(), JsReplace("location = $1", url_b2.spec())));
EXPECT_TRUE(WaitForLoadStop(shell()->web_contents()));
EXPECT_TRUE(NavigateToURLFromRenderer(shell(), url_b2));
// 4) Go back to B.
web_contents()->GetController().GoBack();
......
......@@ -54,8 +54,7 @@ void TestFrameNavigationObserver::WaitForCommit() {
void TestFrameNavigationObserver::DidStartNavigation(
NavigationHandle* navigation_handle) {
last_navigation_succeeded_ = false;
if (!navigation_handle->IsSameDocument() &&
navigation_handle->GetFrameTreeNodeId() == frame_tree_node_id_) {
if (navigation_handle->GetFrameTreeNodeId() == frame_tree_node_id_) {
navigation_started_ = true;
has_committed_ = false;
}
......
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