| 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 "core/frame/VisualViewport.h" | 5 #include "core/frame/VisualViewport.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/frame/FrameHost.h" | 8 #include "core/frame/FrameHost.h" |
| 9 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 EXPECT_FLOAT_POINT_EQ(FloatPoint(150, 0), visualViewport.location()); | 414 EXPECT_FLOAT_POINT_EQ(FloatPoint(150, 0), visualViewport.location()); |
| 415 } | 415 } |
| 416 | 416 |
| 417 // Test that the container layer gets sized properly if the WebView is resized | 417 // Test that the container layer gets sized properly if the WebView is resized |
| 418 // prior to the VisualViewport being attached to the layer tree. | 418 // prior to the VisualViewport being attached to the layer tree. |
| 419 TEST_P(ParameterizedVisualViewportTest, TestWebViewResizedBeforeAttachment) | 419 TEST_P(ParameterizedVisualViewportTest, TestWebViewResizedBeforeAttachment) |
| 420 { | 420 { |
| 421 initializeWithDesktopSettings(); | 421 initializeWithDesktopSettings(); |
| 422 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); | 422 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); |
| 423 GraphicsLayer* rootGraphicsLayer = | 423 GraphicsLayer* rootGraphicsLayer = |
| 424 frameView.layoutView()->compositor()->rootGraphicsLayer(); | 424 frameView.layoutViewItem().compositor()->rootGraphicsLayer(); |
| 425 | 425 |
| 426 // Make sure that a resize that comes in while there's no root layer is | 426 // Make sure that a resize that comes in while there's no root layer is |
| 427 // honoured when we attach to the layer tree. | 427 // honoured when we attach to the layer tree. |
| 428 WebFrameWidget* mainFrameWidget = static_cast<WebFrameWidget*>(webViewImpl()
->mainFrame()->toWebLocalFrame()->frameWidget()); | 428 WebFrameWidget* mainFrameWidget = static_cast<WebFrameWidget*>(webViewImpl()
->mainFrame()->toWebLocalFrame()->frameWidget()); |
| 429 mainFrameWidget->setRootGraphicsLayer(nullptr); | 429 mainFrameWidget->setRootGraphicsLayer(nullptr); |
| 430 webViewImpl()->resize(IntSize(320, 240)); | 430 webViewImpl()->resize(IntSize(320, 240)); |
| 431 mainFrameWidget->setRootGraphicsLayer(rootGraphicsLayer); | 431 mainFrameWidget->setRootGraphicsLayer(rootGraphicsLayer); |
| 432 | 432 |
| 433 navigateTo("about:blank"); | 433 navigateTo("about:blank"); |
| 434 webViewImpl()->updateAllLifecyclePhases(); | 434 webViewImpl()->updateAllLifecyclePhases(); |
| (...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1859 webViewImpl()->handleInputEvent(pinchUpdate); | 1859 webViewImpl()->handleInputEvent(pinchUpdate); |
| 1860 | 1860 |
| 1861 VisualViewport& visualViewport = webViewImpl()->page()->frameHost().visualVi
ewport(); | 1861 VisualViewport& visualViewport = webViewImpl()->page()->frameHost().visualVi
ewport(); |
| 1862 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); | 1862 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); |
| 1863 | 1863 |
| 1864 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), visualViewport.location()); | 1864 EXPECT_FLOAT_POINT_EQ(FloatPoint(50, 50), visualViewport.location()); |
| 1865 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble()); | 1865 EXPECT_FLOAT_POINT_EQ(FloatPoint(0, 0), frameView.scrollPositionDouble()); |
| 1866 } | 1866 } |
| 1867 | 1867 |
| 1868 } // namespace | 1868 } // namespace |
| OLD | NEW |