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

Unified Diff: content/test/test_render_frame_host.cc

Issue 2225053002: Fix tests to behave properly with ISNs/DSNs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months 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
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 11d09572648cccdc5d74e9e3c7aaa6f98e50ec64..f78cde14b7ae83a222827b29aebdf6444e1d1b3f 100644
--- a/content/test/test_render_frame_host.cc
+++ b/content/test/test_render_frame_host.cc
@@ -316,6 +316,26 @@ void TestRenderFrameHost::SendNavigateWithParameters(
// Simulate Blink assigning an item sequence number to the navigation.
params.item_sequence_number = base::Time::Now().ToDoubleT() * 1000000;
+ // 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
+ // sequence numbers. Simulate this behavior here too.
Charlie Reis 2016/08/08 21:27:11 Hmm. This won't be stale when we remove NAVIGATIO
nasko 2016/08/08 21:57:08 This is more or less relying on Blink keeping its
+ if (transition == ui::PAGE_TRANSITION_TYPED) {
+ const NavigationEntryImpl* entry =
+ static_cast<NavigationEntryImpl*>(frame_tree_node()
+ ->navigator()
+ ->GetController()
+ ->GetLastCommittedEntry());
+ if (entry && entry->GetURL() == url) {
+ FrameNavigationEntry* frame_entry =
+ entry->GetFrameEntry(frame_tree_node());
+ if (frame_entry) {
+ params.item_sequence_number = frame_entry->item_sequence_number();
+ params.document_sequence_number =
+ frame_entry->document_sequence_number();
+ }
+ }
+ }
+
// In most cases, the origin will match the URL's origin. Tests that need to
// check corner cases (like about:blank) should specify the origin param
// manually.

Powered by Google App Engine
This is Rietveld 408576698