| 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 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 mouseDownEvent.button = WebMouseEvent::ButtonRight; | 759 mouseDownEvent.button = WebMouseEvent::ButtonRight; |
| 760 webViewImpl()->handleInputEvent(mouseDownEvent); | 760 webViewImpl()->handleInputEvent(mouseDownEvent); |
| 761 webViewImpl()->handleInputEvent(mouseUpEvent); | 761 webViewImpl()->handleInputEvent(mouseUpEvent); |
| 762 | 762 |
| 763 // Reset the old client so destruction can occur naturally. | 763 // Reset the old client so destruction can occur naturally. |
| 764 webViewImpl()->mainFrameImpl()->setClient(oldClient); | 764 webViewImpl()->mainFrameImpl()->setClient(oldClient); |
| 765 } | 765 } |
| 766 | 766 |
| 767 // Test that the scrollIntoView correctly scrolls the main frame | 767 // Test that the scrollIntoView correctly scrolls the main frame |
| 768 // and pinch viewports such that the given rect is centered in the viewport. | 768 // and pinch viewports such that the given rect is centered in the viewport. |
| 769 TEST_F(PinchViewportTest, TestScrollingDocumentRegionIntoView) | 769 TEST_F(PinchViewportTest, DISABLED_TestScrollingDocumentRegionIntoView) |
| 770 { | 770 { |
| 771 initializeWithDesktopSettings(); | 771 initializeWithDesktopSettings(); |
| 772 webViewImpl()->resize(IntSize(100, 150)); | 772 webViewImpl()->resize(IntSize(100, 150)); |
| 773 | 773 |
| 774 registerMockedHttpURLLoad("200-by-300-viewport.html"); | 774 registerMockedHttpURLLoad("200-by-300-viewport.html"); |
| 775 navigateTo(m_baseURL + "200-by-300-viewport.html"); | 775 navigateTo(m_baseURL + "200-by-300-viewport.html"); |
| 776 | 776 |
| 777 PinchViewport& pinchViewport = frame()->page()->frameHost().pinchViewport(); | 777 PinchViewport& pinchViewport = frame()->page()->frameHost().pinchViewport(); |
| 778 | 778 |
| 779 // Test that the pinch viewport is scrolled if the viewport has been | 779 // Test that the pinch viewport is scrolled if the viewport has been |
| (...skipping 16 matching lines...) Expand all Loading... |
| 796 pinchViewport.scrollIntoView(FloatRect(50, 75, 50, 75)); | 796 pinchViewport.scrollIntoView(FloatRect(50, 75, 50, 75)); |
| 797 EXPECT_POINT_EQ(IntPoint(50, 75), frame()->view()->scrollPosition()); | 797 EXPECT_POINT_EQ(IntPoint(50, 75), frame()->view()->scrollPosition()); |
| 798 EXPECT_FLOAT_POINT_EQ(FloatPoint(), pinchViewport.visibleRect().location()); | 798 EXPECT_FLOAT_POINT_EQ(FloatPoint(), pinchViewport.visibleRect().location()); |
| 799 | 799 |
| 800 pinchViewport.scrollIntoView(FloatRect(190, 290, 10, 10)); | 800 pinchViewport.scrollIntoView(FloatRect(190, 290, 10, 10)); |
| 801 EXPECT_POINT_EQ(IntPoint(100, 150), frame()->view()->scrollPosition()); | 801 EXPECT_POINT_EQ(IntPoint(100, 150), frame()->view()->scrollPosition()); |
| 802 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 75), pinchViewport.visibleRect().locati
on()); | 802 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 75), pinchViewport.visibleRect().locati
on()); |
| 803 } | 803 } |
| 804 | 804 |
| 805 } // namespace | 805 } // namespace |
| OLD | NEW |