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

Unified Diff: content/common/page_state_serialization_unittest.cc

Issue 959783003: Add scroll restoration type to page state (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use enum for scroll restoration type Created 5 years, 7 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 | « content/common/page_state_serialization.cc ('k') | content/renderer/history_serialization.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/page_state_serialization_unittest.cc
diff --git a/content/common/page_state_serialization_unittest.cc b/content/common/page_state_serialization_unittest.cc
index 38f04f82ae616d00bfe35783f5f5e6a5258464a6..f860b215747ababa11d03784da9273ea838cb52d 100644
--- a/content/common/page_state_serialization_unittest.cc
+++ b/content/common/page_state_serialization_unittest.cc
@@ -70,6 +70,7 @@ void ExpectEquality(const ExplodedFrameState& a, const ExplodedFrameState& b) {
EXPECT_EQ(a.target, b.target);
EXPECT_EQ(a.state_object, b.state_object);
ExpectEquality(a.document_state, b.document_state);
+ EXPECT_EQ(a.scroll_restoration_type, b.scroll_restoration_type);
EXPECT_EQ(a.pinch_viewport_scroll_offset, b.pinch_viewport_scroll_offset);
EXPECT_EQ(a.scroll_offset, b.scroll_offset);
EXPECT_EQ(a.item_sequence_number, b.item_sequence_number);
@@ -99,6 +100,8 @@ class PageStateSerializationTest : public testing::Test {
frame_state->document_state.push_back(NS16("q"));
frame_state->document_state.push_back(NS16("text"));
frame_state->document_state.push_back(NS16("dev.chromium.org"));
+ frame_state->scroll_restoration_type =
+ blink::WebHistoryScrollRestorationManual;
frame_state->pinch_viewport_scroll_offset = gfx::PointF(10, 15);
frame_state->scroll_offset = gfx::Point(0, 100);
frame_state->item_sequence_number = 1;
@@ -138,6 +141,8 @@ class PageStateSerializationTest : public testing::Test {
frame_state->referrer_policy = blink::WebReferrerPolicyDefault;
if (!is_child)
frame_state->target = NS16("target");
+ frame_state->scroll_restoration_type =
+ blink::WebHistoryScrollRestorationAuto;
frame_state->pinch_viewport_scroll_offset = gfx::PointF(-1, -1);
frame_state->scroll_offset = gfx::Point(42, -42);
frame_state->item_sequence_number = 123;
@@ -428,5 +433,9 @@ TEST_F(PageStateSerializationTest, BackwardsCompat_v20) {
TestBackwardsCompat(20);
}
+TEST_F(PageStateSerializationTest, BackwardsCompat_v21) {
+ TestBackwardsCompat(21);
+}
+
} // namespace
} // namespace content
« no previous file with comments | « content/common/page_state_serialization.cc ('k') | content/renderer/history_serialization.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698