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

Unified Diff: third_party/WebKit/Source/core/exported/WebViewTest.cpp

Issue 2949073002: Changing scroll and view state in onpopstate shouldn't overwrite back/forward state restore (Closed)
Patch Set: Reset ViewState when trying to copy from a nullptr Created 3 years, 5 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
Index: third_party/WebKit/Source/core/exported/WebViewTest.cpp
diff --git a/third_party/WebKit/Source/core/exported/WebViewTest.cpp b/third_party/WebKit/Source/core/exported/WebViewTest.cpp
index b02e3b21c7f1fb619563d9375b23c01988b52a32..22d157de4b9907f954ac311c394437f3154252e0 100644
--- a/third_party/WebKit/Source/core/exported/WebViewTest.cpp
+++ b/third_party/WebKit/Source/core/exported/WebViewTest.cpp
@@ -1678,37 +1678,28 @@ TEST_P(WebViewTest, HistoryResetScrollAndScaleState) {
EXPECT_EQ(2.0f, main_frame_local->Loader()
.GetDocumentLoader()
->GetHistoryItem()
- ->PageScaleFactor());
+ ->GetViewState()
+ ->page_scale_factor_);
EXPECT_EQ(94, main_frame_local->Loader()
.GetDocumentLoader()
->GetHistoryItem()
- ->GetScrollOffset()
- .Width());
+ ->GetViewState()
+ ->scroll_offset_.Width());
EXPECT_EQ(111, main_frame_local->Loader()
.GetDocumentLoader()
->GetHistoryItem()
- ->GetScrollOffset()
- .Height());
+ ->GetViewState()
+ ->scroll_offset_.Height());
// Confirm that resetting the page state resets the saved scroll position.
web_view_impl->ResetScrollAndScaleState();
EXPECT_EQ(1.0f, web_view_impl->PageScaleFactor());
EXPECT_EQ(0, web_view_impl->MainFrameImpl()->GetScrollOffset().width);
EXPECT_EQ(0, web_view_impl->MainFrameImpl()->GetScrollOffset().height);
- EXPECT_EQ(1.0f, main_frame_local->Loader()
- .GetDocumentLoader()
- ->GetHistoryItem()
- ->PageScaleFactor());
- EXPECT_EQ(0, main_frame_local->Loader()
- .GetDocumentLoader()
- ->GetHistoryItem()
- ->GetScrollOffset()
- .Width());
- EXPECT_EQ(0, main_frame_local->Loader()
- .GetDocumentLoader()
- ->GetHistoryItem()
- ->GetScrollOffset()
- .Height());
+ EXPECT_EQ(nullptr, main_frame_local->Loader()
+ .GetDocumentLoader()
+ ->GetHistoryItem()
+ ->GetViewState());
}
TEST_P(WebViewTest, BackForwardRestoreScroll) {

Powered by Google App Engine
This is Rietveld 408576698