Commit 831e416c authored by ckitagawa's avatar ckitagawa Committed by Commit Bot

[Navigation] Fix same document propagation bug in NavigationSimulator

This bug is due to not passing |same_document_| correctly to
BuildDidCommitProvisionalLoadParams(). This causes some same-document
navigations to behave as though they are cross-document in unit tests.

This also fixes any unit tests that depended on this behavior to pass.

Bug: 1049575
Change-Id: I81d08bee9c922c8070ab1d9d7a870141ff88c38e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2041797Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Calder Kitagawa <ckitagawa@chromium.org>
Cr-Commit-Position: refs/heads/master@{#739062}
parent 9c1e666c
...@@ -211,9 +211,10 @@ TEST_F(PrintPreviewDialogControllerUnitTest, ClearInitiatorDetails) { ...@@ -211,9 +211,10 @@ TEST_F(PrintPreviewDialogControllerUnitTest, ClearInitiatorDetails) {
// (typed + address bar) to an existing page as occurs in gmail does not cause // (typed + address bar) to an existing page as occurs in gmail does not cause
// the dialogs to close. // the dialogs to close.
TEST_F(PrintPreviewDialogControllerUnitTest, CloseDialogOnNavigation) { TEST_F(PrintPreviewDialogControllerUnitTest, CloseDialogOnNavigation) {
// Two similar URLs (same webpage, different URL fragments) // Two similar URLs (same webpage, different URL fragment/query)
GURL tiger_barb("https://www.google.com/#q=tiger+barb"); // Gmail navigates from fragment to query when opening an email to print.
GURL tiger("https://www.google.com/#q=tiger"); GURL tiger("https://www.google.com/#q=tiger");
GURL tiger_barb("https://www.google.com/?q=tiger+barb");
// Set up by opening a new tab and getting web contents // Set up by opening a new tab and getting web contents
EXPECT_EQ(1u, chrome::GetTotalBrowserCount()); EXPECT_EQ(1u, chrome::GetTotalBrowserCount());
......
...@@ -604,7 +604,7 @@ void NavigationSimulatorImpl::Commit() { ...@@ -604,7 +604,7 @@ void NavigationSimulatorImpl::Commit() {
} }
auto params = BuildDidCommitProvisionalLoadParams( auto params = BuildDidCommitProvisionalLoadParams(
false /* same_document */, false /* failed_navigation */); same_document_ /* same_document */, false /* failed_navigation */);
render_frame_host_->SimulateCommitProcessed( render_frame_host_->SimulateCommitProcessed(
request_, std::move(params), std::move(interface_provider_receiver_), request_, std::move(params), std::move(interface_provider_receiver_),
std::move(browser_interface_broker_receiver_), same_document_); std::move(browser_interface_broker_receiver_), same_document_);
......
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