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

Side by Side Diff: Source/web/tests/PinchViewportTest.cpp

Issue 1173053003: Remove ScrollableArea::notifyScrollPositionChanged and cleanup scroll animators. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase + remove updateScrollbars from FrameView::setScrollPosition Created 5 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 unified diff | Download patch
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | Source/web/tests/ScrollAnimatorNoneTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 6
7 #include "core/frame/PinchViewport.h" 7 #include "core/frame/PinchViewport.h"
8 8
9 #include "core/dom/Document.h" 9 #include "core/dom/Document.h"
10 #include "core/frame/FrameHost.h" 10 #include "core/frame/FrameHost.h"
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 webViewImpl()->resizePinchViewport(IntSize(200, 100)); 913 webViewImpl()->resizePinchViewport(IntSize(200, 100));
914 webViewImpl()->setInitialFocus(false); 914 webViewImpl()->setInitialFocus(false);
915 pinchViewport.setLocation(FloatPoint()); 915 pinchViewport.setLocation(FloatPoint());
916 webViewImpl()->scrollFocusedNodeIntoRect(IntRect(0, 0, 500, 200)); 916 webViewImpl()->scrollFocusedNodeIntoRect(IntRect(0, 0, 500, 200));
917 917
918 EXPECT_POINT_EQ(IntPoint(0, frame()->view()->maximumScrollPosition().y()), 918 EXPECT_POINT_EQ(IntPoint(0, frame()->view()->maximumScrollPosition().y()),
919 frame()->view()->scrollPosition()); 919 frame()->view()->scrollPosition());
920 EXPECT_FLOAT_POINT_EQ(FloatPoint(150, 200), pinchViewport.visibleRect().loca tion()); 920 EXPECT_FLOAT_POINT_EQ(FloatPoint(150, 200), pinchViewport.visibleRect().loca tion());
921 921
922 // Try it again but with the page zoomed in 922 // Try it again but with the page zoomed in
923 frame()->view()->notifyScrollPositionChanged(IntPoint(0, 0)); 923 frame()->view()->setScrollPosition(IntPoint(0, 0), ProgrammaticScroll);
924 webViewImpl()->resizePinchViewport(IntSize(500, 300)); 924 webViewImpl()->resizePinchViewport(IntSize(500, 300));
925 pinchViewport.setLocation(FloatPoint(0, 0)); 925 pinchViewport.setLocation(FloatPoint(0, 0));
926 926
927 webViewImpl()->setPageScaleFactor(2); 927 webViewImpl()->setPageScaleFactor(2);
928 webViewImpl()->scrollFocusedNodeIntoRect(IntRect(0, 0, 500, 200)); 928 webViewImpl()->scrollFocusedNodeIntoRect(IntRect(0, 0, 500, 200));
929 EXPECT_POINT_EQ(IntPoint(0, frame()->view()->maximumScrollPosition().y()), 929 EXPECT_POINT_EQ(IntPoint(0, frame()->view()->maximumScrollPosition().y()),
930 frame()->view()->scrollPosition()); 930 frame()->view()->scrollPosition());
931 EXPECT_FLOAT_POINT_EQ(FloatPoint(125, 150), pinchViewport.visibleRect().loca tion()); 931 EXPECT_FLOAT_POINT_EQ(FloatPoint(125, 150), pinchViewport.visibleRect().loca tion());
932 932
933 // Once more but make sure that we don't move the pinch viewport unless nece ssary. 933 // Once more but make sure that we don't move the pinch viewport unless nece ssary.
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
1658 registerMockedHttpURLLoad("window_dimensions_wide_div.html"); 1658 registerMockedHttpURLLoad("window_dimensions_wide_div.html");
1659 webViewImpl()->resize(IntSize(800, 600)); 1659 webViewImpl()->resize(IntSize(800, 600));
1660 navigateTo(m_baseURL + "window_dimensions_wide_div.html"); 1660 navigateTo(m_baseURL + "window_dimensions_wide_div.html");
1661 1661
1662 Element* output = frame()->document()->getElementById("output"); 1662 Element* output = frame()->document()->getElementById("output");
1663 ASSERT(output); 1663 ASSERT(output);
1664 EXPECT_EQ(std::string("2000x1500"), std::string(output->innerHTML().ascii(). data())); 1664 EXPECT_EQ(std::string("2000x1500"), std::string(output->innerHTML().ascii(). data()));
1665 } 1665 }
1666 1666
1667 } // namespace 1667 } // namespace
OLDNEW
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | Source/web/tests/ScrollAnimatorNoneTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698