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

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

Issue 705423002: Use expected main frame size from WebViewImpl when creating a new FrameView. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing build break from bad rebase Created 6 years, 1 month 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 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
1212 1230
1213 } // namespace 1231 } // 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