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

Unified Diff: content/browser/frame_host/frame_navigation_entry.cc

Issue 2309583002: Fix for the NavigationControllerTest.BackSubframe test failures with PlzNavigate (Closed)
Patch Set: Fix code Created 4 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/frame_navigation_entry.cc
diff --git a/content/browser/frame_host/frame_navigation_entry.cc b/content/browser/frame_host/frame_navigation_entry.cc
index bf78bef31f702fbaab573adefe8f1bf4ea08f3ec..71974aab665ed67e22eb596aa6449c1d54d8f312 100644
--- a/content/browser/frame_host/frame_navigation_entry.cc
+++ b/content/browser/frame_host/frame_navigation_entry.cc
@@ -90,8 +90,18 @@ void FrameNavigationEntry::SetPageState(const PageState& page_state) {
if (!DecodePageState(page_state_.ToEncodedData(), &exploded_state))
return;
- item_sequence_number_ = exploded_state.top.item_sequence_number;
- document_sequence_number_ = exploded_state.top.document_sequence_number;
+ // If the item_sequence_number_ field is already populated, then set it only
+ // if the item sequence number decoded from the page state is valid. This
+ // typically happens in tests.
+ if (exploded_state.top.item_sequence_number > 0 ||
nasko 2016/09/07 20:56:02 I don't think this is the correct approach. The wh
ananta 2016/09/07 22:50:06 Added the functionality to the test code. PTAL
+ item_sequence_number_ < 0) {
+ item_sequence_number_ = exploded_state.top.item_sequence_number;
+ }
+ // Please refer to the comment above for explanation.
+ if (exploded_state.top.document_sequence_number > 0 ||
+ document_sequence_number_ < 0) {
+ document_sequence_number_ = exploded_state.top.document_sequence_number;
+ }
}
scoped_refptr<ResourceRequestBodyImpl> FrameNavigationEntry::GetPostData()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698