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

Unified Diff: Source/web/tests/ProgrammaticScrollTest.cpp

Issue 28983004: Split the frame tree logic out of HistoryItem (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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 | « Source/web/WebViewImpl.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/ProgrammaticScrollTest.cpp
diff --git a/Source/web/tests/ProgrammaticScrollTest.cpp b/Source/web/tests/ProgrammaticScrollTest.cpp
index 80e4b530fa5c2c34c79429c8f4f07334dd583488..bc90305b37f17ea16fa2012b11caf8b7c2fec4c3 100644
--- a/Source/web/tests/ProgrammaticScrollTest.cpp
+++ b/Source/web/tests/ProgrammaticScrollTest.cpp
@@ -58,22 +58,22 @@ TEST_F(ProgrammaticScrollTest, RestoreScrollPositionAndViewStateWithScale)
webView->layout();
WebViewImpl* webViewImpl = toWebViewImpl(webView);
- FrameView* frameView = webViewImpl->mainFrameImpl()->frameView();
- HistoryController* history = webViewImpl->page()->mainFrame()->loader().history();
+ Frame* frame = webViewImpl->mainFrameImpl()->frame();
+ HistoryController* history = webViewImpl->page()->history();
// Scale and scroll the page and save that state. Then scale and scroll again and restore.
webViewImpl->setPageScaleFactor(2.0f, WebPoint(0, 200));
- history->saveDocumentAndScrollState();
+ history->saveDocumentAndScrollState(frame);
webViewImpl->setPageScaleFactor(3.0f, WebPoint(0, 300));
// Flip back the wasScrolledByUser flag which was set to true by setPageScaleFactor
// because otherwise HistoryController::restoreScrollPositionAndViewState does nothing.
- frameView->setWasScrolledByUser(false);
- history->restoreScrollPositionAndViewState();
+ frame->view()->setWasScrolledByUser(false);
+ history->restoreScrollPositionAndViewState(frame);
// Expect that both scroll and scale were restored, and that it was not a programmatic scroll.
EXPECT_EQ(2.0f, webViewImpl->pageScaleFactor());
EXPECT_EQ(200, webViewImpl->mainFrameImpl()->scrollOffset().height);
- EXPECT_TRUE(frameView->wasScrolledByUser());
+ EXPECT_TRUE(frame->view()->wasScrolledByUser());
}
TEST_F(ProgrammaticScrollTest, RestoreScrollPositionAndViewStateWithoutScale)
@@ -86,25 +86,25 @@ TEST_F(ProgrammaticScrollTest, RestoreScrollPositionAndViewStateWithoutScale)
webView->layout();
WebViewImpl* webViewImpl = toWebViewImpl(webView);
- FrameView* frameView = webViewImpl->mainFrameImpl()->frameView();
- HistoryController* history = webViewImpl->page()->mainFrame()->loader().history();
+ Frame* frame = webViewImpl->mainFrameImpl()->frame();
+ HistoryController* history = webViewImpl->page()->history();
// Scale and scroll the page and save that state, but then set scale to zero. Then scale and
// scroll again and restore.
webViewImpl->setPageScaleFactor(2.0f, WebPoint(0, 400));
- history->saveDocumentAndScrollState();
+ history->saveDocumentAndScrollState(frame);
webViewImpl->setPageScaleFactor(3.0f, WebPoint(0, 500));
// Flip back the wasScrolledByUser flag which was set to true by setPageScaleFactor
// because otherwise HistoryController::restoreScrollPositionAndViewState does nothing.
- frameView->setWasScrolledByUser(false);
+ frame->view()->setWasScrolledByUser(false);
// HistoryController::restoreScrollPositionAndViewState flows differently if scale is zero.
- history->currentItem()->setPageScaleFactor(0.0f);
- history->restoreScrollPositionAndViewState();
+ history->currentItem(frame)->setPageScaleFactor(0.0f);
+ history->restoreScrollPositionAndViewState(frame);
// Expect that only the scroll position was restored, and that it was not a programmatic scroll.
EXPECT_EQ(3.0f, webViewImpl->pageScaleFactor());
EXPECT_EQ(400, webViewImpl->mainFrameImpl()->scrollOffset().height);
- EXPECT_TRUE(frameView->wasScrolledByUser());
+ EXPECT_TRUE(frame->view()->wasScrolledByUser());
}
}
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698