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

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

Issue 2860673002: Change all test cases to use WebViewBase instead of WebViewImpl. (Closed)
Patch Set: Address code review comments. Created 3 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
Index: third_party/WebKit/Source/web/tests/ProgrammaticScrollTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/ProgrammaticScrollTest.cpp b/third_party/WebKit/Source/web/tests/ProgrammaticScrollTest.cpp
index a689a74f53b085617dce1f9d56ba31acf63a121d..cf9535e641c5d2d2e89206d12dd022fcd30cd793 100644
--- a/third_party/WebKit/Source/web/tests/ProgrammaticScrollTest.cpp
+++ b/third_party/WebKit/Source/web/tests/ProgrammaticScrollTest.cpp
@@ -44,17 +44,16 @@ TEST_F(ProgrammaticScrollTest, RestoreScrollPositionAndViewStateWithScale) {
RegisterMockedHttpURLLoad("long_scroll.html");
FrameTestHelpers::WebViewHelper web_view_helper;
- WebView* web_view = web_view_helper.InitializeAndLoad(
+ WebViewBase* web_view = web_view_helper.InitializeAndLoad(
base_url_ + "long_scroll.html", true, 0, 0);
web_view->Resize(WebSize(1000, 1000));
web_view->UpdateAllLifecyclePhases();
- WebViewImpl* web_view_impl = ToWebViewImpl(web_view);
- FrameLoader& loader = web_view_impl->MainFrameImpl()->GetFrame()->Loader();
+ FrameLoader& loader = web_view->MainFrameImpl()->GetFrame()->Loader();
loader.GetDocumentLoader()->SetLoadType(kFrameLoadTypeBackForward);
- web_view_impl->SetPageScaleFactor(3.0f);
- web_view_impl->MainFrame()->SetScrollOffset(WebSize(0, 500));
+ web_view->SetPageScaleFactor(3.0f);
+ web_view->MainFrame()->SetScrollOffset(WebSize(0, 500));
loader.GetDocumentLoader()->GetInitialScrollState().was_scrolled_by_user =
false;
loader.GetDocumentLoader()->GetHistoryItem()->SetPageScaleFactor(2);
@@ -69,25 +68,24 @@ TEST_F(ProgrammaticScrollTest, RestoreScrollPositionAndViewStateWithScale) {
loader.RestoreScrollPositionAndViewState();
// Expect that both scroll and scale were restored.
- EXPECT_EQ(2.0f, web_view_impl->PageScaleFactor());
- EXPECT_EQ(200, web_view_impl->MainFrameImpl()->GetScrollOffset().height);
+ EXPECT_EQ(2.0f, web_view->PageScaleFactor());
+ EXPECT_EQ(200, web_view->MainFrameImpl()->GetScrollOffset().height);
}
TEST_F(ProgrammaticScrollTest, RestoreScrollPositionAndViewStateWithoutScale) {
RegisterMockedHttpURLLoad("long_scroll.html");
FrameTestHelpers::WebViewHelper web_view_helper;
- WebView* web_view = web_view_helper.InitializeAndLoad(
+ WebViewBase* web_view = web_view_helper.InitializeAndLoad(
base_url_ + "long_scroll.html", true, 0, 0);
web_view->Resize(WebSize(1000, 1000));
web_view->UpdateAllLifecyclePhases();
- WebViewImpl* web_view_impl = ToWebViewImpl(web_view);
- FrameLoader& loader = web_view_impl->MainFrameImpl()->GetFrame()->Loader();
+ FrameLoader& loader = web_view->MainFrameImpl()->GetFrame()->Loader();
loader.GetDocumentLoader()->SetLoadType(kFrameLoadTypeBackForward);
- web_view_impl->SetPageScaleFactor(3.0f);
- web_view_impl->MainFrame()->SetScrollOffset(WebSize(0, 500));
+ web_view->SetPageScaleFactor(3.0f);
+ web_view->MainFrame()->SetScrollOffset(WebSize(0, 500));
loader.GetDocumentLoader()->GetInitialScrollState().was_scrolled_by_user =
false;
loader.GetDocumentLoader()->GetHistoryItem()->SetPageScaleFactor(0);
@@ -99,8 +97,8 @@ TEST_F(ProgrammaticScrollTest, RestoreScrollPositionAndViewStateWithoutScale) {
loader.RestoreScrollPositionAndViewState();
// Expect that only the scroll position was restored.
- EXPECT_EQ(3.0f, web_view_impl->PageScaleFactor());
- EXPECT_EQ(400, web_view_impl->MainFrameImpl()->GetScrollOffset().height);
+ EXPECT_EQ(3.0f, web_view->PageScaleFactor());
+ EXPECT_EQ(400, web_view->MainFrameImpl()->GetScrollOffset().height);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698