| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 } | 122 } |
| 123 | 123 |
| 124 void initializeWithAndroidSettings(void (*overrideSettingsFunc)(WebSettings*
) = 0) | 124 void initializeWithAndroidSettings(void (*overrideSettingsFunc)(WebSettings*
) = 0) |
| 125 { | 125 { |
| 126 if (!overrideSettingsFunc) | 126 if (!overrideSettingsFunc) |
| 127 overrideSettingsFunc = &configureAndroidSettings; | 127 overrideSettingsFunc = &configureAndroidSettings; |
| 128 m_helper.initialize(true, 0, &m_mockWebViewClient, overrideSettingsFunc)
; | 128 m_helper.initialize(true, 0, &m_mockWebViewClient, overrideSettingsFunc)
; |
| 129 webViewImpl()->setDefaultPageScaleLimits(0.25f, 5); | 129 webViewImpl()->setDefaultPageScaleLimits(0.25f, 5); |
| 130 } | 130 } |
| 131 | 131 |
| 132 virtual ~PinchViewportTest() | 132 ~PinchViewportTest() override |
| 133 { | 133 { |
| 134 Platform::current()->unitTestSupport()->unregisterAllMockedURLs(); | 134 Platform::current()->unitTestSupport()->unregisterAllMockedURLs(); |
| 135 } | 135 } |
| 136 | 136 |
| 137 void navigateTo(const std::string& url) | 137 void navigateTo(const std::string& url) |
| 138 { | 138 { |
| 139 FrameTestHelpers::loadFrame(webViewImpl()->mainFrame(), url); | 139 FrameTestHelpers::loadFrame(webViewImpl()->mainFrame(), url); |
| 140 } | 140 } |
| 141 | 141 |
| 142 void forceFullCompositingUpdate() | 142 void forceFullCompositingUpdate() |
| (...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1746 webViewImpl()->handleInputEvent(pinchUpdate); | 1746 webViewImpl()->handleInputEvent(pinchUpdate); |
| 1747 | 1747 |
| 1748 PinchViewport& pinchViewport = webViewImpl()->page()->frameHost().pinchViewp
ort(); | 1748 PinchViewport& pinchViewport = webViewImpl()->page()->frameHost().pinchViewp
ort(); |
| 1749 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); | 1749 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); |
| 1750 | 1750 |
| 1751 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), pinchViewport.location()); | 1751 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), pinchViewport.location()); |
| 1752 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble()); | 1752 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble()); |
| 1753 } | 1753 } |
| 1754 | 1754 |
| 1755 } // namespace | 1755 } // namespace |
| OLD | NEW |