OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/test/test_render_frame_host.h" | 5 #include "content/test/test_render_frame_host.h" |
6 | 6 |
7 #include "base/guid.h" | 7 #include "base/guid.h" |
8 #include "content/browser/frame_host/frame_tree.h" | 8 #include "content/browser/frame_host/frame_tree.h" |
9 #include "content/browser/frame_host/navigation_handle_impl.h" | 9 #include "content/browser/frame_host/navigation_handle_impl.h" |
10 #include "content/browser/frame_host/navigation_request.h" | 10 #include "content/browser/frame_host/navigation_request.h" |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 params.original_request_url = url_copy; | 329 params.original_request_url = url_copy; |
330 | 330 |
331 // Simulate Blink assigning an item and document sequence number to the | 331 // Simulate Blink assigning an item and document sequence number to the |
332 // navigation. | 332 // navigation. |
333 params.item_sequence_number = base::Time::Now().ToDoubleT() * 1000000; | 333 params.item_sequence_number = base::Time::Now().ToDoubleT() * 1000000; |
334 params.document_sequence_number = params.item_sequence_number + 1; | 334 params.document_sequence_number = params.item_sequence_number + 1; |
335 | 335 |
336 // When the user hits enter in the Omnibox without changing the URL, Blink | 336 // When the user hits enter in the Omnibox without changing the URL, Blink |
337 // behaves similarly to a reload and does not change the item and document | 337 // behaves similarly to a reload and does not change the item and document |
338 // sequence numbers. Simulate this behavior here too. | 338 // sequence numbers. Simulate this behavior here too. |
339 if (transition == ui::PAGE_TRANSITION_TYPED) { | 339 if (PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_TYPED)) { |
340 const NavigationEntryImpl* entry = | 340 const NavigationEntryImpl* entry = |
341 static_cast<NavigationEntryImpl*>(frame_tree_node() | 341 static_cast<NavigationEntryImpl*>(frame_tree_node() |
342 ->navigator() | 342 ->navigator() |
343 ->GetController() | 343 ->GetController() |
344 ->GetLastCommittedEntry()); | 344 ->GetLastCommittedEntry()); |
345 if (entry && entry->GetURL() == url) { | 345 if (entry && entry->GetURL() == url) { |
346 FrameNavigationEntry* frame_entry = | 346 FrameNavigationEntry* frame_entry = |
347 entry->GetFrameEntry(frame_tree_node()); | 347 entry->GetFrameEntry(frame_tree_node()); |
348 if (frame_entry) { | 348 if (frame_entry) { |
349 params.item_sequence_number = frame_entry->item_sequence_number(); | 349 params.item_sequence_number = frame_entry->item_sequence_number(); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 // PlzNavigate: NavigationHandle::WillStartRequest has already been called at | 485 // PlzNavigate: NavigationHandle::WillStartRequest has already been called at |
486 // this point. | 486 // this point. |
487 if (!navigation_handle() || IsBrowserSideNavigationEnabled()) | 487 if (!navigation_handle() || IsBrowserSideNavigationEnabled()) |
488 return; | 488 return; |
489 navigation_handle()->CallWillStartRequestForTesting( | 489 navigation_handle()->CallWillStartRequestForTesting( |
490 false /* is_post */, Referrer(GURL(), blink::WebReferrerPolicyDefault), | 490 false /* is_post */, Referrer(GURL(), blink::WebReferrerPolicyDefault), |
491 transition, false /* is_external_protocol */); | 491 transition, false /* is_external_protocol */); |
492 } | 492 } |
493 | 493 |
494 } // namespace content | 494 } // namespace content |
OLD | NEW |