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

Side by Side Diff: content/common/page_state_serialization_unittest.cc

Issue 1138543002: Better remove HistoryNodes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove frame sequence numbers from serialization Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « content/common/page_state_serialization.cc ('k') | content/renderer/history_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <cmath> 5 #include <cmath>
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/pickle.h" 10 #include "base/pickle.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 frame_state->document_state.push_back(NS16("1")); 99 frame_state->document_state.push_back(NS16("1"));
100 frame_state->document_state.push_back(NS16("q")); 100 frame_state->document_state.push_back(NS16("q"));
101 frame_state->document_state.push_back(NS16("text")); 101 frame_state->document_state.push_back(NS16("text"));
102 frame_state->document_state.push_back(NS16("dev.chromium.org")); 102 frame_state->document_state.push_back(NS16("dev.chromium.org"));
103 frame_state->scroll_restoration_type = 103 frame_state->scroll_restoration_type =
104 blink::WebHistoryScrollRestorationManual; 104 blink::WebHistoryScrollRestorationManual;
105 frame_state->pinch_viewport_scroll_offset = gfx::PointF(10, 15); 105 frame_state->pinch_viewport_scroll_offset = gfx::PointF(10, 15);
106 frame_state->scroll_offset = gfx::Point(0, 100); 106 frame_state->scroll_offset = gfx::Point(0, 100);
107 frame_state->item_sequence_number = 1; 107 frame_state->item_sequence_number = 1;
108 frame_state->document_sequence_number = 2; 108 frame_state->document_sequence_number = 2;
109 frame_state->frame_sequence_number = 3;
110 frame_state->page_scale_factor = 2.0; 109 frame_state->page_scale_factor = 2.0;
111 } 110 }
112 111
113 void PopulateHttpBody(ExplodedHttpBody* http_body, 112 void PopulateHttpBody(ExplodedHttpBody* http_body,
114 std::vector<base::NullableString16>* referenced_files) { 113 std::vector<base::NullableString16>* referenced_files) {
115 http_body->is_null = false; 114 http_body->is_null = false;
116 http_body->identifier = 12345; 115 http_body->identifier = 12345;
117 http_body->contains_passwords = false; 116 http_body->contains_passwords = false;
118 http_body->http_content_type = NS16("text/foo"); 117 http_body->http_content_type = NS16("text/foo");
119 118
(...skipping 20 matching lines...) Expand all
140 frame_state->referrer = NS16("http://google.com/"); 139 frame_state->referrer = NS16("http://google.com/");
141 frame_state->referrer_policy = blink::WebReferrerPolicyDefault; 140 frame_state->referrer_policy = blink::WebReferrerPolicyDefault;
142 if (!is_child) 141 if (!is_child)
143 frame_state->target = NS16("target"); 142 frame_state->target = NS16("target");
144 frame_state->scroll_restoration_type = 143 frame_state->scroll_restoration_type =
145 blink::WebHistoryScrollRestorationAuto; 144 blink::WebHistoryScrollRestorationAuto;
146 frame_state->pinch_viewport_scroll_offset = gfx::PointF(-1, -1); 145 frame_state->pinch_viewport_scroll_offset = gfx::PointF(-1, -1);
147 frame_state->scroll_offset = gfx::Point(42, -42); 146 frame_state->scroll_offset = gfx::Point(42, -42);
148 frame_state->item_sequence_number = 123; 147 frame_state->item_sequence_number = 123;
149 frame_state->document_sequence_number = 456; 148 frame_state->document_sequence_number = 456;
150 frame_state->frame_sequence_number = 789;
151 frame_state->page_scale_factor = 2.0f; 149 frame_state->page_scale_factor = 2.0f;
152 150
153 frame_state->document_state.push_back( 151 frame_state->document_state.push_back(
154 NS16("\n\r?% WebKit serialized form state version 8 \n\r=&")); 152 NS16("\n\r?% WebKit serialized form state version 8 \n\r=&"));
155 frame_state->document_state.push_back(NS16("form key")); 153 frame_state->document_state.push_back(NS16("form key"));
156 frame_state->document_state.push_back(NS16("1")); 154 frame_state->document_state.push_back(NS16("1"));
157 frame_state->document_state.push_back(NS16("foo")); 155 frame_state->document_state.push_back(NS16("foo"));
158 frame_state->document_state.push_back(NS16("file")); 156 frame_state->document_state.push_back(NS16("file"));
159 frame_state->document_state.push_back(NS16("2")); 157 frame_state->document_state.push_back(NS16("2"));
160 frame_state->document_state.push_back(NS16("file.txt")); 158 frame_state->document_state.push_back(NS16("file.txt"));
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 } 428 }
431 429
432 TEST_F(PageStateSerializationTest, BackwardsCompat_v20) { 430 TEST_F(PageStateSerializationTest, BackwardsCompat_v20) {
433 TestBackwardsCompat(20); 431 TestBackwardsCompat(20);
434 } 432 }
435 433
436 TEST_F(PageStateSerializationTest, BackwardsCompat_v21) { 434 TEST_F(PageStateSerializationTest, BackwardsCompat_v21) {
437 TestBackwardsCompat(21); 435 TestBackwardsCompat(21);
438 } 436 }
439 437
438 TEST_F(PageStateSerializationTest, BackwardsCompat_v22) {
439 TestBackwardsCompat(22);
440 }
441
440 } // namespace 442 } // namespace
441 } // namespace content 443 } // namespace content
OLDNEW
« no previous file with comments | « content/common/page_state_serialization.cc ('k') | content/renderer/history_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698