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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 { | 209 { |
210 initializeWithDesktopSettings(turnOffForceCompositingMode); | 210 initializeWithDesktopSettings(turnOffForceCompositingMode); |
211 webViewImpl()->resize(IntSize(320, 240)); | 211 webViewImpl()->resize(IntSize(320, 240)); |
212 | 212 |
213 navigateTo("about:blank"); | 213 navigateTo("about:blank"); |
214 forceFullCompositingUpdate(); | 214 forceFullCompositingUpdate(); |
215 webViewImpl()->settings()->setAcceleratedCompositingEnabled(true); | 215 webViewImpl()->settings()->setAcceleratedCompositingEnabled(true); |
216 webViewImpl()->layout(); | 216 webViewImpl()->layout(); |
217 | 217 |
218 PinchViewport& pinchViewport = frame()->page()->frameHost().pinchViewport(); | 218 PinchViewport& pinchViewport = frame()->page()->frameHost().pinchViewport(); |
219 EXPECT_FLOAT_SIZE_EQ(FloatSize(320, 240), pinchViewport.rootGraphicsLayer()-
>size()); | 219 EXPECT_FLOAT_SIZE_EQ(FloatSize(320, 240), pinchViewport.containerLayer()->si
ze()); |
220 } | 220 } |
221 // Make sure that the visibleRect method acurately reflects the scale and scroll
location | 221 // Make sure that the visibleRect method acurately reflects the scale and scroll
location |
222 // of the viewport. | 222 // of the viewport. |
223 TEST_F(PinchViewportTest, TestVisibleRect) | 223 TEST_F(PinchViewportTest, TestVisibleRect) |
224 { | 224 { |
225 initializeWithDesktopSettings(); | 225 initializeWithDesktopSettings(); |
226 webViewImpl()->resize(IntSize(320, 240)); | 226 webViewImpl()->resize(IntSize(320, 240)); |
227 | 227 |
228 navigateTo("about:blank"); | 228 navigateTo("about:blank"); |
229 forceFullCompositingUpdate(); | 229 forceFullCompositingUpdate(); |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 pinchViewport.scrollIntoView(FloatRect(50, 75, 50, 75)); | 760 pinchViewport.scrollIntoView(FloatRect(50, 75, 50, 75)); |
761 EXPECT_POINT_EQ(IntPoint(50, 75), frame()->view()->scrollPosition()); | 761 EXPECT_POINT_EQ(IntPoint(50, 75), frame()->view()->scrollPosition()); |
762 EXPECT_FLOAT_POINT_EQ(FloatPoint(), pinchViewport.visibleRect().location()); | 762 EXPECT_FLOAT_POINT_EQ(FloatPoint(), pinchViewport.visibleRect().location()); |
763 | 763 |
764 pinchViewport.scrollIntoView(FloatRect(190, 290, 10, 10)); | 764 pinchViewport.scrollIntoView(FloatRect(190, 290, 10, 10)); |
765 EXPECT_POINT_EQ(IntPoint(100, 150), frame()->view()->scrollPosition()); | 765 EXPECT_POINT_EQ(IntPoint(100, 150), frame()->view()->scrollPosition()); |
766 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 75), pinchViewport.visibleRect().locati
on()); | 766 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 75), pinchViewport.visibleRect().locati
on()); |
767 } | 767 } |
768 | 768 |
769 } // namespace | 769 } // namespace |
OLD | NEW |