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()->settings()->setUseWideViewport(true); | |
mnaganov (inactive)
2014/02/20 15:50:25
I think this isn't needed, as wide viewport is tur
mkosiba (inactive)
2014/02/20 15:59:32
Done.
| |
874 webViewHelper.webView()->resize(WebSize(viewportWidth, viewportHeight)); | |
875 | |
876 EXPECT_EQ(viewportWidth, webViewHelper.webViewImpl()->mainFrameImpl()->frame View()->layoutSize().width()); | |
877 EXPECT_EQ(viewportHeight, webViewHelper.webViewImpl()->mainFrameImpl()->fram eView()->layoutSize().height()); | |
878 } | |
879 | |
862 TEST_F(WebFrameTest, DeviceScaleFactorUsesDefaultWithoutViewportTag) | 880 TEST_F(WebFrameTest, DeviceScaleFactorUsesDefaultWithoutViewportTag) |
863 { | 881 { |
864 UseMockScrollbarSettings mockScrollbarSettings; | 882 UseMockScrollbarSettings mockScrollbarSettings; |
865 registerMockedHttpURLLoad("no_viewport_tag.html"); | 883 registerMockedHttpURLLoad("no_viewport_tag.html"); |
866 | 884 |
867 int viewportWidth = 640; | 885 int viewportWidth = 640; |
868 int viewportHeight = 480; | 886 int viewportHeight = 480; |
869 | 887 |
870 FixedLayoutTestWebViewClient client; | 888 FixedLayoutTestWebViewClient client; |
871 client.m_screenInfo.deviceScaleFactor = 2; | 889 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. | 5140 // Will scale the page by 1.5. |
5123 webView->resize(WebSize(300, 330)); | 5141 webView->resize(WebSize(300, 330)); |
5124 webView->layout(); | 5142 webView->layout(); |
5125 EXPECT_EQ(220, bottomFixed->offsetTop() + bottomFixed->offsetHeight()); | 5143 EXPECT_EQ(220, bottomFixed->offsetTop() + bottomFixed->offsetHeight()); |
5126 EXPECT_EQ(220, topBottomFixed->offsetHeight()); | 5144 EXPECT_EQ(220, topBottomFixed->offsetHeight()); |
5127 EXPECT_EQ(200, rightFixed->offsetLeft() + rightFixed->offsetWidth()); | 5145 EXPECT_EQ(200, rightFixed->offsetLeft() + rightFixed->offsetWidth()); |
5128 EXPECT_EQ(200, leftRightFixed->offsetWidth()); | 5146 EXPECT_EQ(200, leftRightFixed->offsetWidth()); |
5129 } | 5147 } |
5130 | 5148 |
5131 } // namespace | 5149 } // namespace |
OLD | NEW |