Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: Source/web/tests/PinchViewportTest.cpp

Issue 308183002: Made root translation layer the root when using pinch virtual viewport. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed unit test Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698