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 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 doubleTapZoomAlreadyLegibleScale = webViewImpl->minimumPageScaleFactor() * d
oubleTapZoomAlreadyLegibleRatio; | 816 doubleTapZoomAlreadyLegibleScale = webViewImpl->minimumPageScaleFactor() * d
oubleTapZoomAlreadyLegibleRatio; |
817 setScaleAndScrollAndLayout(webViewImpl, WebPoint(0, 0), (webViewImpl->minimu
mPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2); | 817 setScaleAndScrollAndLayout(webViewImpl, WebPoint(0, 0), (webViewImpl->minimu
mPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2); |
818 simulateDoubleTap(webViewImpl, doubleTapPoint, scale); | 818 simulateDoubleTap(webViewImpl, doubleTapPoint, scale); |
819 EXPECT_FLOAT_EQ(webViewImpl->minimumPageScaleFactor(), scale); | 819 EXPECT_FLOAT_EQ(webViewImpl->minimumPageScaleFactor(), scale); |
820 simulateDoubleTap(webViewImpl, doubleTapPoint, scale); | 820 simulateDoubleTap(webViewImpl, doubleTapPoint, scale); |
821 EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale); | 821 EXPECT_FLOAT_EQ(doubleTapZoomAlreadyLegibleScale, scale); |
822 simulateDoubleTap(webViewImpl, doubleTapPoint, scale); | 822 simulateDoubleTap(webViewImpl, doubleTapPoint, scale); |
823 EXPECT_FLOAT_EQ(webViewImpl->minimumPageScaleFactor(), scale); | 823 EXPECT_FLOAT_EQ(webViewImpl->minimumPageScaleFactor(), scale); |
824 } | 824 } |
825 | 825 |
826 #if ENABLE(TEXT_AUTOSIZING) | |
827 TEST_F(WebFrameTest, DivAutoZoomScaleFontScaleFactorTest) | 826 TEST_F(WebFrameTest, DivAutoZoomScaleFontScaleFactorTest) |
828 { | 827 { |
829 registerMockedHttpURLLoad("get_scale_bounds_check_for_auto_zoom_test.html"); | 828 registerMockedHttpURLLoad("get_scale_bounds_check_for_auto_zoom_test.html"); |
830 | 829 |
831 int viewportWidth = 320; | 830 int viewportWidth = 320; |
832 int viewportHeight = 480; | 831 int viewportHeight = 480; |
833 float doubleTapZoomAlreadyLegibleRatio = 1.2f; | 832 float doubleTapZoomAlreadyLegibleRatio = 1.2f; |
834 float textAutosizingFontScaleFactor = 1.13f; | 833 float textAutosizingFontScaleFactor = 1.13f; |
835 m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "get_scale_bo
unds_check_for_auto_zoom_test.html"); | 834 m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "get_scale_bo
unds_check_for_auto_zoom_test.html"); |
836 m_webView->enableFixedLayoutMode(true); | 835 m_webView->enableFixedLayoutMode(true); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
894 m_webView->layout(); | 893 m_webView->layout(); |
895 doubleTapZoomAlreadyLegibleScale = webViewImpl->minimumPageScaleFactor() * d
oubleTapZoomAlreadyLegibleRatio; | 894 doubleTapZoomAlreadyLegibleScale = webViewImpl->minimumPageScaleFactor() * d
oubleTapZoomAlreadyLegibleRatio; |
896 setScaleAndScrollAndLayout(webViewImpl, WebPoint(0, 0), (webViewImpl->minimu
mPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2); | 895 setScaleAndScrollAndLayout(webViewImpl, WebPoint(0, 0), (webViewImpl->minimu
mPageScaleFactor()) * (1 + doubleTapZoomAlreadyLegibleRatio) / 2); |
897 simulateDoubleTap(webViewImpl, doubleTapPoint, scale); | 896 simulateDoubleTap(webViewImpl, doubleTapPoint, scale); |
898 EXPECT_FLOAT_EQ(legibleScale, scale); | 897 EXPECT_FLOAT_EQ(legibleScale, scale); |
899 simulateDoubleTap(webViewImpl, doubleTapPoint, scale); | 898 simulateDoubleTap(webViewImpl, doubleTapPoint, scale); |
900 EXPECT_FLOAT_EQ(webViewImpl->minimumPageScaleFactor(), scale); | 899 EXPECT_FLOAT_EQ(webViewImpl->minimumPageScaleFactor(), scale); |
901 simulateDoubleTap(webViewImpl, doubleTapPoint, scale); | 900 simulateDoubleTap(webViewImpl, doubleTapPoint, scale); |
902 EXPECT_FLOAT_EQ(legibleScale, scale); | 901 EXPECT_FLOAT_EQ(legibleScale, scale); |
903 } | 902 } |
904 #endif | |
905 | 903 |
906 TEST_F(WebFrameTest, DivScrollIntoEditableTest) | 904 TEST_F(WebFrameTest, DivScrollIntoEditableTest) |
907 { | 905 { |
908 registerMockedHttpURLLoad("get_scale_for_zoom_into_editable_test.html"); | 906 registerMockedHttpURLLoad("get_scale_for_zoom_into_editable_test.html"); |
909 | 907 |
910 int viewportWidth = 450; | 908 int viewportWidth = 450; |
911 int viewportHeight = 300; | 909 int viewportHeight = 300; |
912 float leftBoxRatio = 0.3f; | 910 float leftBoxRatio = 0.3f; |
913 int caretPadding = 10; | 911 int caretPadding = 10; |
914 float minReadableCaretHeight = 18.0f; | 912 float minReadableCaretHeight = 18.0f; |
(...skipping 1646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2561 EXPECT_FALSE(client.wasProgrammaticScroll()); | 2559 EXPECT_FALSE(client.wasProgrammaticScroll()); |
2562 EXPECT_TRUE(client.wasUserScroll()); | 2560 EXPECT_TRUE(client.wasUserScroll()); |
2563 client.reset(); | 2561 client.reset(); |
2564 | 2562 |
2565 m_webView->close(); | 2563 m_webView->close(); |
2566 m_webView = 0; | 2564 m_webView = 0; |
2567 } | 2565 } |
2568 | 2566 |
2569 | 2567 |
2570 } // namespace | 2568 } // namespace |
OLD | NEW |