| 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/frame/FrameHost.h" | 9 #include "core/frame/FrameHost.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 FrameTestHelpers::loadHistoryItem(webViewImpl()->mainFrame(), item, WebHisto
ryDifferentDocumentLoad, WebURLRequest::UseProtocolCachePolicy); | 711 FrameTestHelpers::loadHistoryItem(webViewImpl()->mainFrame(), item, WebHisto
ryDifferentDocumentLoad, WebURLRequest::UseProtocolCachePolicy); |
| 712 | 712 |
| 713 PinchViewport& pinchViewport = frame()->page()->frameHost().pinchViewport(); | 713 PinchViewport& pinchViewport = frame()->page()->frameHost().pinchViewport(); |
| 714 EXPECT_EQ(2, pinchViewport.scale()); | 714 EXPECT_EQ(2, pinchViewport.scale()); |
| 715 EXPECT_POINT_EQ(IntPoint(100, 150), frame()->view()->scrollPosition()); | 715 EXPECT_POINT_EQ(IntPoint(100, 150), frame()->view()->scrollPosition()); |
| 716 EXPECT_FLOAT_POINT_EQ(FloatPoint(20, 30), pinchViewport.visibleRect().locati
on()); | 716 EXPECT_FLOAT_POINT_EQ(FloatPoint(20, 30), pinchViewport.visibleRect().locati
on()); |
| 717 } | 717 } |
| 718 | 718 |
| 719 // Test that the coordinates sent into moveRangeSelection are offset by the | 719 // Test that the coordinates sent into moveRangeSelection are offset by the |
| 720 // pinch viewport's location. | 720 // pinch viewport's location. |
| 721 TEST_F(PinchViewportTest, TestWebFrameRangeAccountsForPinchViewportScroll) | 721 TEST_F(PinchViewportTest, DISABLED_TestWebFrameRangeAccountsForPinchViewportScro
ll) |
| 722 { | 722 { |
| 723 initializeWithDesktopSettings(); | 723 initializeWithDesktopSettings(); |
| 724 webViewImpl()->settings()->setDefaultFontSize(12); | 724 webViewImpl()->settings()->setDefaultFontSize(12); |
| 725 webViewImpl()->resize(WebSize(640, 480)); | 725 webViewImpl()->resize(WebSize(640, 480)); |
| 726 registerMockedHttpURLLoad("move_range.html"); | 726 registerMockedHttpURLLoad("move_range.html"); |
| 727 navigateTo(m_baseURL + "move_range.html"); | 727 navigateTo(m_baseURL + "move_range.html"); |
| 728 | 728 |
| 729 WebRect baseRect; | 729 WebRect baseRect; |
| 730 WebRect extentRect; | 730 WebRect extentRect; |
| 731 | 731 |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 913 pinchViewport.scrollIntoView(FloatRect(50, 75, 50, 75)); | 913 pinchViewport.scrollIntoView(FloatRect(50, 75, 50, 75)); |
| 914 EXPECT_POINT_EQ(IntPoint(50, 75), frame()->view()->scrollPosition()); | 914 EXPECT_POINT_EQ(IntPoint(50, 75), frame()->view()->scrollPosition()); |
| 915 EXPECT_FLOAT_POINT_EQ(FloatPoint(), pinchViewport.visibleRect().location()); | 915 EXPECT_FLOAT_POINT_EQ(FloatPoint(), pinchViewport.visibleRect().location()); |
| 916 | 916 |
| 917 pinchViewport.scrollIntoView(FloatRect(190, 290, 10, 10)); | 917 pinchViewport.scrollIntoView(FloatRect(190, 290, 10, 10)); |
| 918 EXPECT_POINT_EQ(IntPoint(100, 150), frame()->view()->scrollPosition()); | 918 EXPECT_POINT_EQ(IntPoint(100, 150), frame()->view()->scrollPosition()); |
| 919 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 75), pinchViewport.visibleRect().locati
on()); | 919 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 75), pinchViewport.visibleRect().locati
on()); |
| 920 } | 920 } |
| 921 | 921 |
| 922 } // namespace | 922 } // namespace |
| OLD | NEW |