| 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 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 doubleTapZoomAlreadyLegibleScale = webViewImpl->minimumPageScaleFactor() * d
oubleTapZoomAlreadyLegibleRatio; | 861 doubleTapZoomAlreadyLegibleScale = webViewImpl->minimumPageScaleFactor() * d
oubleTapZoomAlreadyLegibleRatio; |
| 862 setScaleAndScrollAndLayout(webViewImpl, WebPoint(0, 0), (webViewImpl->minimu
mPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2); | 862 setScaleAndScrollAndLayout(webViewImpl, WebPoint(0, 0), (webViewImpl->minimu
mPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2); |
| 863 simulateDoubleTap(webViewImpl, doubleTapPoint, scale); | 863 simulateDoubleTap(webViewImpl, doubleTapPoint, scale); |
| 864 EXPECT_FLOAT_EQ(webViewImpl->minimumPageScaleFactor(), scale); | 864 EXPECT_FLOAT_EQ(webViewImpl->minimumPageScaleFactor(), scale); |
| 865 simulateDoubleTap(webViewImpl, doubleTapPoint, scale); | 865 simulateDoubleTap(webViewImpl, doubleTapPoint, scale); |
| 866 EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale); | 866 EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale); |
| 867 simulateDoubleTap(webViewImpl, doubleTapPoint, scale); | 867 simulateDoubleTap(webViewImpl, doubleTapPoint, scale); |
| 868 EXPECT_FLOAT_EQ(webViewImpl->minimumPageScaleFactor(), scale); | 868 EXPECT_FLOAT_EQ(webViewImpl->minimumPageScaleFactor(), scale); |
| 869 } | 869 } |
| 870 | 870 |
| 871 #if ENABLE(TEXT_AUTOSIZING) | |
| 872 TEST_F(WebFrameTest, DivAutoZoomScaleFontScaleFactorTest) | 871 TEST_F(WebFrameTest, DivAutoZoomScaleFontScaleFactorTest) |
| 873 { | 872 { |
| 874 registerMockedHttpURLLoad("get_scale_bounds_check_for_auto_zoom_test.html"); | 873 registerMockedHttpURLLoad("get_scale_bounds_check_for_auto_zoom_test.html"); |
| 875 | 874 |
| 876 int viewportWidth = 320; | 875 int viewportWidth = 320; |
| 877 int viewportHeight = 480; | 876 int viewportHeight = 480; |
| 878 float doubleTapZoomAlreadyLegibleRatio = 1.2f; | 877 float doubleTapZoomAlreadyLegibleRatio = 1.2f; |
| 879 float textAutosizingFontScaleFactor = 1.13f; | 878 float textAutosizingFontScaleFactor = 1.13f; |
| 880 m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "get_scale_bo
unds_check_for_auto_zoom_test.html"); | 879 m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "get_scale_bo
unds_check_for_auto_zoom_test.html"); |
| 881 m_webView->enableFixedLayoutMode(true); | 880 m_webView->enableFixedLayoutMode(true); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 939 m_webView->layout(); | 938 m_webView->layout(); |
| 940 doubleTapZoomAlreadyLegibleScale = webViewImpl->minimumPageScaleFactor() * d
oubleTapZoomAlreadyLegibleRatio; | 939 doubleTapZoomAlreadyLegibleScale = webViewImpl->minimumPageScaleFactor() * d
oubleTapZoomAlreadyLegibleRatio; |
| 941 setScaleAndScrollAndLayout(webViewImpl, WebPoint(0, 0), (webViewImpl->minimu
mPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2); | 940 setScaleAndScrollAndLayout(webViewImpl, WebPoint(0, 0), (webViewImpl->minimu
mPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2); |
| 942 simulateDoubleTap(webViewImpl, doubleTapPoint, scale); | 941 simulateDoubleTap(webViewImpl, doubleTapPoint, scale); |
| 943 EXPECT_FLOAT_EQ(legibleScale, scale); | 942 EXPECT_FLOAT_EQ(legibleScale, scale); |
| 944 simulateDoubleTap(webViewImpl, doubleTapPoint, scale); | 943 simulateDoubleTap(webViewImpl, doubleTapPoint, scale); |
| 945 EXPECT_FLOAT_EQ(webViewImpl->minimumPageScaleFactor(), scale); | 944 EXPECT_FLOAT_EQ(webViewImpl->minimumPageScaleFactor(), scale); |
| 946 simulateDoubleTap(webViewImpl, doubleTapPoint, scale); | 945 simulateDoubleTap(webViewImpl, doubleTapPoint, scale); |
| 947 EXPECT_FLOAT_EQ(legibleScale, scale); | 946 EXPECT_FLOAT_EQ(legibleScale, scale); |
| 948 } | 947 } |
| 949 #endif | |
| 950 | 948 |
| 951 TEST_F(WebFrameTest, DivScrollIntoEditableTest) | 949 TEST_F(WebFrameTest, DivScrollIntoEditableTest) |
| 952 { | 950 { |
| 953 registerMockedHttpURLLoad("get_scale_for_zoom_into_editable_test.html"); | 951 registerMockedHttpURLLoad("get_scale_for_zoom_into_editable_test.html"); |
| 954 | 952 |
| 955 int viewportWidth = 450; | 953 int viewportWidth = 450; |
| 956 int viewportHeight = 300; | 954 int viewportHeight = 300; |
| 957 float leftBoxRatio = 0.3f; | 955 float leftBoxRatio = 0.3f; |
| 958 int caretPadding = 10; | 956 int caretPadding = 10; |
| 959 float minReadableCaretHeight = 18.0f; | 957 float minReadableCaretHeight = 18.0f; |
| (...skipping 1646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2606 EXPECT_FALSE(client.wasProgrammaticScroll()); | 2604 EXPECT_FALSE(client.wasProgrammaticScroll()); |
| 2607 EXPECT_TRUE(client.wasUserScroll()); | 2605 EXPECT_TRUE(client.wasUserScroll()); |
| 2608 client.reset(); | 2606 client.reset(); |
| 2609 | 2607 |
| 2610 m_webView->close(); | 2608 m_webView->close(); |
| 2611 m_webView = 0; | 2609 m_webView = 0; |
| 2612 } | 2610 } |
| 2613 | 2611 |
| 2614 | 2612 |
| 2615 } // namespace | 2613 } // namespace |
| OLD | NEW |