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

Unified Diff: third_party/WebKit/Source/web/tests/WebViewTest.cpp

Issue 2949073002: Changing scroll and view state in onpopstate shouldn't overwrite back/forward state restore (Closed)
Patch Set: +test Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/tests/WebViewTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebViewTest.cpp b/third_party/WebKit/Source/web/tests/WebViewTest.cpp
index 4a8579c92a797a07f88f28d5c871bafa8de7c607..8ef3ce1ac380a3a270340cc02bc0a2c6af9b2270 100644
--- a/third_party/WebKit/Source/web/tests/WebViewTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebViewTest.cpp
@@ -1677,37 +1677,28 @@ TEST_P(WebViewTest, HistoryResetScrollAndScaleState) {
EXPECT_EQ(2.0f, main_frame_local->Loader()
.GetDocumentLoader()
->GetHistoryItem()
- ->PageScaleFactor());
+ ->GetScrollAndViewState()
+ ->page_scale_factor_);
EXPECT_EQ(94, main_frame_local->Loader()
.GetDocumentLoader()
->GetHistoryItem()
- ->GetScrollOffset()
- .Width());
+ ->GetScrollAndViewState()
+ ->scroll_offset_.Width());
EXPECT_EQ(111, main_frame_local->Loader()
.GetDocumentLoader()
->GetHistoryItem()
- ->GetScrollOffset()
- .Height());
+ ->GetScrollAndViewState()
+ ->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()
+ ->GetScrollAndViewState());
}
TEST_P(WebViewTest, BackForwardRestoreScroll) {

Powered by Google App Engine
This is Rietveld 408576698