| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |