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 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 FrameTestHelpers::loadHistoryItem(webViewImpl()->mainFrame(), item, WebHisto
ryDifferentDocumentLoad, WebURLRequest::UseProtocolCachePolicy); | 723 FrameTestHelpers::loadHistoryItem(webViewImpl()->mainFrame(), item, WebHisto
ryDifferentDocumentLoad, WebURLRequest::UseProtocolCachePolicy); |
724 | 724 |
725 PinchViewport& pinchViewport = frame()->page()->frameHost().pinchViewport(); | 725 PinchViewport& pinchViewport = frame()->page()->frameHost().pinchViewport(); |
726 EXPECT_EQ(2, pinchViewport.scale()); | 726 EXPECT_EQ(2, pinchViewport.scale()); |
727 EXPECT_POINT_EQ(IntPoint(100, 150), frame()->view()->scrollPosition()); | 727 EXPECT_POINT_EQ(IntPoint(100, 150), frame()->view()->scrollPosition()); |
728 EXPECT_FLOAT_POINT_EQ(FloatPoint(20, 30), pinchViewport.visibleRect().locati
on()); | 728 EXPECT_FLOAT_POINT_EQ(FloatPoint(20, 30), pinchViewport.visibleRect().locati
on()); |
729 } | 729 } |
730 | 730 |
731 // Test that the coordinates sent into moveRangeSelection are offset by the | 731 // Test that the coordinates sent into moveRangeSelection are offset by the |
732 // pinch viewport's location. | 732 // pinch viewport's location. |
733 TEST_F(PinchViewportTest, TestWebFrameRangeAccountsForPinchViewportScroll) | 733 TEST_F(PinchViewportTest, DISABLED_TestWebFrameRangeAccountsForPinchViewportScro
ll) |
734 { | 734 { |
735 initializeWithDesktopSettings(); | 735 initializeWithDesktopSettings(); |
736 webViewImpl()->settings()->setDefaultFontSize(12); | 736 webViewImpl()->settings()->setDefaultFontSize(12); |
737 webViewImpl()->resize(WebSize(640, 480)); | 737 webViewImpl()->resize(WebSize(640, 480)); |
738 registerMockedHttpURLLoad("move_range.html"); | 738 registerMockedHttpURLLoad("move_range.html"); |
739 navigateTo(m_baseURL + "move_range.html"); | 739 navigateTo(m_baseURL + "move_range.html"); |
740 | 740 |
741 WebRect baseRect; | 741 WebRect baseRect; |
742 WebRect extentRect; | 742 WebRect extentRect; |
743 | 743 |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
925 pinchViewport.scrollIntoView(FloatRect(50, 75, 50, 75)); | 925 pinchViewport.scrollIntoView(FloatRect(50, 75, 50, 75)); |
926 EXPECT_POINT_EQ(IntPoint(50, 75), frame()->view()->scrollPosition()); | 926 EXPECT_POINT_EQ(IntPoint(50, 75), frame()->view()->scrollPosition()); |
927 EXPECT_FLOAT_POINT_EQ(FloatPoint(), pinchViewport.visibleRect().location()); | 927 EXPECT_FLOAT_POINT_EQ(FloatPoint(), pinchViewport.visibleRect().location()); |
928 | 928 |
929 pinchViewport.scrollIntoView(FloatRect(190, 290, 10, 10)); | 929 pinchViewport.scrollIntoView(FloatRect(190, 290, 10, 10)); |
930 EXPECT_POINT_EQ(IntPoint(100, 150), frame()->view()->scrollPosition()); | 930 EXPECT_POINT_EQ(IntPoint(100, 150), frame()->view()->scrollPosition()); |
931 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 75), pinchViewport.visibleRect().locati
on()); | 931 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 75), pinchViewport.visibleRect().locati
on()); |
932 } | 932 } |
933 | 933 |
934 } // namespace | 934 } // namespace |
OLD | NEW |