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

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

Issue 1163433003: Remove WebViewImpl helper methods for setting scroll offset. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Renamed outerViewport to layoutViewport 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/ProgrammaticScrollTest.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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 #endif 292 #endif
293 293
294 initializeWithAndroidSettings(); 294 initializeWithAndroidSettings();
295 295
296 registerMockedHttpURLLoad("200-by-800-viewport.html"); 296 registerMockedHttpURLLoad("200-by-800-viewport.html");
297 navigateTo(m_baseURL + "200-by-800-viewport.html"); 297 navigateTo(m_baseURL + "200-by-800-viewport.html");
298 298
299 webViewImpl()->resize(IntSize(100, 200)); 299 webViewImpl()->resize(IntSize(100, 200));
300 300
301 // Scroll main frame to the bottom of the document 301 // Scroll main frame to the bottom of the document
302 webViewImpl()->setMainFrameScrollOffset(WebPoint(0, 400)); 302 webViewImpl()->mainFrame()->setScrollOffset(WebSize(0, 400));
303 EXPECT_POINT_EQ(IntPoint(0, 400), frame()->view()->scrollPosition()); 303 EXPECT_POINT_EQ(IntPoint(0, 400), frame()->view()->scrollPosition());
304 304
305 webViewImpl()->setPageScaleFactor(2.0); 305 webViewImpl()->setPageScaleFactor(2.0);
306 306
307 // Scroll pinch viewport to the bottom of the main frame 307 // Scroll pinch viewport to the bottom of the main frame
308 PinchViewport& pinchViewport = frame()->page()->frameHost().pinchViewport(); 308 PinchViewport& pinchViewport = frame()->page()->frameHost().pinchViewport();
309 pinchViewport.setLocation(FloatPoint(0, 300)); 309 pinchViewport.setLocation(FloatPoint(0, 300));
310 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 300), pinchViewport.location()); 310 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 300), pinchViewport.location());
311 311
312 // Verify the initial size of the pinch viewport in the CSS pixels 312 // Verify the initial size of the pinch viewport in the CSS pixels
(...skipping 1345 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/ProgrammaticScrollTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698