Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1204)

Unified Diff: content/test/test_render_frame_host.cc

Issue 2477623002: Don't fire onbeforeunload for same document history navigations with PlzNavigate. (Closed)
Patch Set: Fix unit test harness to set document_sequence_number Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/frame_host/navigator_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/test_render_frame_host.cc
diff --git a/content/test/test_render_frame_host.cc b/content/test/test_render_frame_host.cc
index c7d0d6f4bca4d3bf1935e3a48be416d0fa7b2a34..00fd5f6e684b05181a15498d6730bbc188ee1540 100644
--- a/content/test/test_render_frame_host.cc
+++ b/content/test/test_render_frame_host.cc
@@ -325,8 +325,11 @@ void TestRenderFrameHost::SendNavigateWithParameters(
params.history_list_was_cleared = simulate_history_list_was_cleared_;
params.original_request_url = url_copy;
- // Simulate Blink assigning an item sequence number to the navigation.
+ // Simulate Blink assigning an item and document sequence number to the
+ // navigation.
params.item_sequence_number = base::Time::Now().ToDoubleT() * 1000000;
+ static int s_document_sequence_number = 0;
+ params.document_sequence_number = ++s_document_sequence_number;
Charlie Reis 2016/11/03 21:05:47 This is probably ok, but you could set it to the i
jam 2016/11/03 21:12:20 Thanks, sure.
// When the user hits enter in the Omnibox without changing the URL, Blink
// behaves similarly to a reload and does not change the item and document
@@ -368,7 +371,9 @@ void TestRenderFrameHost::SendNavigateWithParameters(
GetLastCommittedURL().ReplaceComponents(replacements));
params.page_state =
- PageState::CreateForTesting(url_copy, false, nullptr, nullptr);
+ PageState::CreateForTestingWithSequenceNumbers(
+ url_copy, params.item_sequence_number,
+ params.document_sequence_number);
if (!callback.is_null())
callback.Run(&params);
« no previous file with comments | « content/browser/frame_host/navigator_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698