Chromium Code Reviews| 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..0f1702b9a9a795d9e017af1cfacec3d94be38fc6 100644 |
| --- a/content/test/test_render_frame_host.cc |
| +++ b/content/test/test_render_frame_host.cc |
| @@ -316,6 +316,28 @@ 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. |
| + // TODO(nasko): If/when NAVIGATION_TYPE_SAME_PAGE is removed from the |
| + // codebase, ensure this code is updated to account for it. |
|
Charlie Reis
2016/08/08 22:06:15
I don't think we actually need the TODO, since Bli
nasko
2016/08/08 22:39:47
Acknowledged.
|
| + 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. |