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

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

Issue 175043002: Don't ignore size updates that have a width and height == 0. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 EXPECT_TRUE(webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->needs Layout()); 852 EXPECT_TRUE(webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->needs Layout());
853 webViewHelper.webView()->layout(); 853 webViewHelper.webView()->layout();
854 EXPECT_EQ(viewportWidth, webViewHelper.webViewImpl()->mainFrameImpl()->frame View()->contentsSize().width()); 854 EXPECT_EQ(viewportWidth, webViewHelper.webViewImpl()->mainFrameImpl()->frame View()->contentsSize().width());
855 855
856 webViewHelper.webView()->setFixedLayoutSize(WebSize(0, 0)); 856 webViewHelper.webView()->setFixedLayoutSize(WebSize(0, 0));
857 EXPECT_TRUE(webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->needs Layout()); 857 EXPECT_TRUE(webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->needs Layout());
858 webViewHelper.webView()->layout(); 858 webViewHelper.webView()->layout();
859 EXPECT_EQ(980, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->co ntentsSize().width()); 859 EXPECT_EQ(980, webViewHelper.webViewImpl()->mainFrameImpl()->frameView()->co ntentsSize().width());
860 } 860 }
861 861
862 TEST_F(WebFrameTest, ZeroHeightPositiveWidthNotIgnored)
863 {
864 UseMockScrollbarSettings mockScrollbarSettings;
865
866 FixedLayoutTestWebViewClient client;
867 client.m_screenInfo.deviceScaleFactor = 1;
868 int viewportWidth = 1280;
869 int viewportHeight = 0;
870
871 FrameTestHelpers::WebViewHelper webViewHelper;
872 webViewHelper.initialize(true, 0, &client, enableViewportSettings);
873 webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight));
874
875 EXPECT_EQ(viewportWidth, webViewHelper.webViewImpl()->mainFrameImpl()->frame View()->layoutSize().width());
876 EXPECT_EQ(viewportHeight, webViewHelper.webViewImpl()->mainFrameImpl()->fram eView()->layoutSize().height());
877 }
878
862 TEST_F(WebFrameTest, DeviceScaleFactorUsesDefaultWithoutViewportTag) 879 TEST_F(WebFrameTest, DeviceScaleFactorUsesDefaultWithoutViewportTag)
863 { 880 {
864 UseMockScrollbarSettings mockScrollbarSettings; 881 UseMockScrollbarSettings mockScrollbarSettings;
865 registerMockedHttpURLLoad("no_viewport_tag.html"); 882 registerMockedHttpURLLoad("no_viewport_tag.html");
866 883
867 int viewportWidth = 640; 884 int viewportWidth = 640;
868 int viewportHeight = 480; 885 int viewportHeight = 480;
869 886
870 FixedLayoutTestWebViewClient client; 887 FixedLayoutTestWebViewClient client;
871 client.m_screenInfo.deviceScaleFactor = 2; 888 client.m_screenInfo.deviceScaleFactor = 2;
(...skipping 4273 matching lines...) Expand 10 before | Expand all | Expand 10 after
5145 webViewHelper.initializeAndLoad("about:blank"); 5162 webViewHelper.initializeAndLoad("about:blank");
5146 5163
5147 WebCore::FrameView* frameView = webViewHelper.webViewImpl()->mainFrameImpl() ->frameView(); 5164 WebCore::FrameView* frameView = webViewHelper.webViewImpl()->mainFrameImpl() ->frameView();
5148 frameView->setFrameRect(WebCore::IntRect(0, 0, 200, 200)); 5165 frameView->setFrameRect(WebCore::IntRect(0, 0, 200, 200));
5149 EXPECT_EQ_RECT(WebCore::IntRect(0, 0, 200, 200), frameView->frameRect()); 5166 EXPECT_EQ_RECT(WebCore::IntRect(0, 0, 200, 200), frameView->frameRect());
5150 frameView->setFrameRect(WebCore::IntRect(100, 100, 200, 200)); 5167 frameView->setFrameRect(WebCore::IntRect(100, 100, 200, 200));
5151 EXPECT_EQ_RECT(WebCore::IntRect(100, 100, 200, 200), frameView->frameRect()) ; 5168 EXPECT_EQ_RECT(WebCore::IntRect(100, 100, 200, 200), frameView->frameRect()) ;
5152 } 5169 }
5153 5170
5154 } // namespace 5171 } // 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