| 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 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1202 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); | 1202 FrameView& frameView = *webViewImpl()->mainFrameImpl()->frameView(); |
| 1203 frameView.setScrollPosition(IntPoint(0, 10000)); | 1203 frameView.setScrollPosition(IntPoint(0, 10000)); |
| 1204 EXPECT_EQ(500, frameView.scrollPositionDouble().y()); | 1204 EXPECT_EQ(500, frameView.scrollPositionDouble().y()); |
| 1205 | 1205 |
| 1206 // Now send the resize, make sure the scroll offset doesn't change. | 1206 // Now send the resize, make sure the scroll offset doesn't change. |
| 1207 webViewImpl()->setTopControlsLayoutHeight(0); | 1207 webViewImpl()->setTopControlsLayoutHeight(0); |
| 1208 webViewImpl()->resize(IntSize(1000, 1500)); | 1208 webViewImpl()->resize(IntSize(1000, 1500)); |
| 1209 EXPECT_EQ(500, frameView.scrollPositionDouble().y()); | 1209 EXPECT_EQ(500, frameView.scrollPositionDouble().y()); |
| 1210 } | 1210 } |
| 1211 | 1211 |
| 1212 // Tests that when a new frame is created, it is created with the intended | |
| 1213 // size (i.e. the contentWidth). | |
| 1214 TEST_F(PinchViewportTest, TestMainFrameInitializationSizing) | |
| 1215 { | |
| 1216 initializeWithAndroidSettings(); | |
| 1217 | |
| 1218 webViewImpl()->setPageScaleFactorLimits(0.5, 2.0); | |
| 1219 webViewImpl()->resize(IntSize(100, 200)); | |
| 1220 | |
| 1221 registerMockedHttpURLLoad("content-width-1000.html"); | |
| 1222 navigateTo(m_baseURL + "content-width-1000.html"); | |
| 1223 | |
| 1224 WebLocalFrameImpl* localFrame = webViewImpl()->mainFrameImpl(); | |
| 1225 FrameView& frameView = *localFrame->frameView(); | |
| 1226 localFrame->createFrameView(); | |
| 1227 | |
| 1228 EXPECT_SIZE_EQ(IntSize(200, 400), frameView.frameRect().size()); | |
| 1229 } | |
| 1230 | 1212 |
| 1231 } // namespace | 1213 } // namespace |
| OLD | NEW |