| 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 7824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7835 EXPECT_CALL(client, didOverscroll(_, _, _, _)).Times(0); | 7835 EXPECT_CALL(client, didOverscroll(_, _, _, _)).Times(0); |
| 7836 ScrollUpdate(&webViewHelper, 0, -320); | 7836 ScrollUpdate(&webViewHelper, 0, -320); |
| 7837 Mock::VerifyAndClearExpectations(&client); | 7837 Mock::VerifyAndClearExpectations(&client); |
| 7838 | 7838 |
| 7839 // Now On Scrolling IFrame, scroll is bubbled and root layer is over-scrolle
d. | 7839 // Now On Scrolling IFrame, scroll is bubbled and root layer is over-scrolle
d. |
| 7840 EXPECT_CALL(client, didOverscroll(WebFloatSize(0, 50), WebFloatSize(0, 50),
WebFloatPoint(100, 100), WebFloatSize())); | 7840 EXPECT_CALL(client, didOverscroll(WebFloatSize(0, 50), WebFloatSize(0, 50),
WebFloatPoint(100, 100), WebFloatSize())); |
| 7841 ScrollUpdate(&webViewHelper, 0, -50); | 7841 ScrollUpdate(&webViewHelper, 0, -50); |
| 7842 Mock::VerifyAndClearExpectations(&client); | 7842 Mock::VerifyAndClearExpectations(&client); |
| 7843 } | 7843 } |
| 7844 | 7844 |
| 7845 TEST_F(WebFrameOverscrollTest, NoOverscrollOnNonScrollableaxes) | |
| 7846 { | |
| 7847 OverscrollWebViewClient client; | |
| 7848 registerMockedHttpURLLoad("overscroll/no-overscroll-on-nonscrollable-axes.ht
ml"); | |
| 7849 FrameTestHelpers::WebViewHelper webViewHelper; | |
| 7850 webViewHelper.initializeAndLoad(m_baseURL + "overscroll/no-overscroll-on-non
scrollable-axes.html", true, 0, &client, configureAndroid); | |
| 7851 | |
| 7852 // Overscroll is not reported in all the directions. | |
| 7853 ScrollBegin(&webViewHelper); | |
| 7854 EXPECT_CALL(client, didOverscroll(_, _, _, _)).Times(0); | |
| 7855 ScrollUpdate(&webViewHelper, 0, -1); | |
| 7856 Mock::VerifyAndClearExpectations(&client); | |
| 7857 | |
| 7858 EXPECT_CALL(client, didOverscroll(_, _, _, _)).Times(0); | |
| 7859 ScrollUpdate(&webViewHelper, 0, 1); | |
| 7860 Mock::VerifyAndClearExpectations(&client); | |
| 7861 | |
| 7862 EXPECT_CALL(client, didOverscroll(_, _, _, _)).Times(0); | |
| 7863 ScrollUpdate(&webViewHelper, 1, 0); | |
| 7864 Mock::VerifyAndClearExpectations(&client); | |
| 7865 | |
| 7866 EXPECT_CALL(client, didOverscroll(_, _, _, _)).Times(0); | |
| 7867 ScrollUpdate(&webViewHelper, -1, 0); | |
| 7868 Mock::VerifyAndClearExpectations(&client); | |
| 7869 | |
| 7870 EXPECT_CALL(client, didOverscroll(_, _, _, _)).Times(0); | |
| 7871 ScrollUpdate(&webViewHelper, 1, 1); | |
| 7872 Mock::VerifyAndClearExpectations(&client); | |
| 7873 | |
| 7874 EXPECT_CALL(client, didOverscroll(_, _, _, _)).Times(0); | |
| 7875 ScrollUpdate(&webViewHelper, -1, 1); | |
| 7876 Mock::VerifyAndClearExpectations(&client); | |
| 7877 | |
| 7878 EXPECT_CALL(client, didOverscroll(_, _, _, _)).Times(0); | |
| 7879 ScrollUpdate(&webViewHelper, 1, -1); | |
| 7880 Mock::VerifyAndClearExpectations(&client); | |
| 7881 | |
| 7882 EXPECT_CALL(client, didOverscroll(_, _, _, _)).Times(0); | |
| 7883 ScrollUpdate(&webViewHelper, -1, -1); | |
| 7884 Mock::VerifyAndClearExpectations(&client); | |
| 7885 | |
| 7886 EXPECT_CALL(client, didOverscroll(_, _, _, _)).Times(0); | |
| 7887 ScrollEnd(&webViewHelper); | |
| 7888 Mock::VerifyAndClearExpectations(&client); | |
| 7889 } | |
| 7890 | |
| 7891 TEST_F(WebFrameOverscrollTest, ScaledPageRootLayerOverscrolled) | 7845 TEST_F(WebFrameOverscrollTest, ScaledPageRootLayerOverscrolled) |
| 7892 { | 7846 { |
| 7893 OverscrollWebViewClient client; | 7847 OverscrollWebViewClient client; |
| 7894 registerMockedHttpURLLoad("overscroll/overscroll.html"); | 7848 registerMockedHttpURLLoad("overscroll/overscroll.html"); |
| 7895 FrameTestHelpers::WebViewHelper webViewHelper; | 7849 FrameTestHelpers::WebViewHelper webViewHelper; |
| 7896 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "over
scroll/overscroll.html", true, 0, &client, configureAndroid); | 7850 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "over
scroll/overscroll.html", true, 0, &client, configureAndroid); |
| 7897 webViewImpl->setPageScaleFactor(3.0); | 7851 webViewImpl->setPageScaleFactor(3.0); |
| 7898 | 7852 |
| 7899 // Calculation of accumulatedRootOverscroll and unusedDelta on scaled page. | 7853 // Calculation of accumulatedRootOverscroll and unusedDelta on scaled page. |
| 7900 ScrollBegin(&webViewHelper); | 7854 ScrollBegin(&webViewHelper); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8001 | 7955 |
| 8002 TEST_F(WebFrameTest, MaxFramesDetach) | 7956 TEST_F(WebFrameTest, MaxFramesDetach) |
| 8003 { | 7957 { |
| 8004 registerMockedHttpURLLoad("max-frames-detach.html"); | 7958 registerMockedHttpURLLoad("max-frames-detach.html"); |
| 8005 FrameTestHelpers::WebViewHelper webViewHelper; | 7959 FrameTestHelpers::WebViewHelper webViewHelper; |
| 8006 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max-
frames-detach.html", true); | 7960 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max-
frames-detach.html", true); |
| 8007 webViewImpl->mainFrameImpl()->collectGarbage(); | 7961 webViewImpl->mainFrameImpl()->collectGarbage(); |
| 8008 } | 7962 } |
| 8009 | 7963 |
| 8010 } // namespace blink | 7964 } // namespace blink |
| OLD | NEW |