| OLD | NEW |
| 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 Loading... |
| 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 = 640; |
| 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 4250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5122 // Will scale the page by 1.5. | 5139 // Will scale the page by 1.5. |
| 5123 webView->resize(WebSize(300, 330)); | 5140 webView->resize(WebSize(300, 330)); |
| 5124 webView->layout(); | 5141 webView->layout(); |
| 5125 EXPECT_EQ(220, bottomFixed->offsetTop() + bottomFixed->offsetHeight()); | 5142 EXPECT_EQ(220, bottomFixed->offsetTop() + bottomFixed->offsetHeight()); |
| 5126 EXPECT_EQ(220, topBottomFixed->offsetHeight()); | 5143 EXPECT_EQ(220, topBottomFixed->offsetHeight()); |
| 5127 EXPECT_EQ(200, rightFixed->offsetLeft() + rightFixed->offsetWidth()); | 5144 EXPECT_EQ(200, rightFixed->offsetLeft() + rightFixed->offsetWidth()); |
| 5128 EXPECT_EQ(200, leftRightFixed->offsetWidth()); | 5145 EXPECT_EQ(200, leftRightFixed->offsetWidth()); |
| 5129 } | 5146 } |
| 5130 | 5147 |
| 5131 } // namespace | 5148 } // namespace |
| OLD | NEW |