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 2870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2881 TEST_F(WebFrameTest, DisambiguationPopupMobileSite) | 2881 TEST_F(WebFrameTest, DisambiguationPopupMobileSite) |
2882 { | 2882 { |
2883 const std::string htmlFile = "disambiguation_popup_mobile_site.html"; | 2883 const std::string htmlFile = "disambiguation_popup_mobile_site.html"; |
2884 registerMockedHttpURLLoad(htmlFile); | 2884 registerMockedHttpURLLoad(htmlFile); |
2885 | 2885 |
2886 DisambiguationPopupTestWebViewClient client; | 2886 DisambiguationPopupTestWebViewClient client; |
2887 | 2887 |
2888 // Make sure we initialize to minimum scale, even if the window size | 2888 // Make sure we initialize to minimum scale, even if the window size |
2889 // only becomes available after the load begins. | 2889 // only becomes available after the load begins. |
2890 m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + htmlFile, tru
e, 0, &client); | 2890 m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + htmlFile, tru
e, 0, &client); |
| 2891 m_webView->enableFixedLayoutMode(true); |
| 2892 m_webView->settings()->setViewportEnabled(true); |
2891 m_webView->resize(WebSize(1000, 1000)); | 2893 m_webView->resize(WebSize(1000, 1000)); |
2892 m_webView->layout(); | 2894 m_webView->layout(); |
2893 | 2895 |
| 2896 client.resetTriggered(); |
| 2897 m_webView->handleInputEvent(fatTap(0, 0)); |
| 2898 EXPECT_FALSE(client.triggered()); |
| 2899 |
| 2900 client.resetTriggered(); |
| 2901 m_webView->handleInputEvent(fatTap(200, 115)); |
| 2902 EXPECT_FALSE(client.triggered()); |
| 2903 |
| 2904 for (int i = 0; i <= 46; i++) { |
| 2905 client.resetTriggered(); |
| 2906 m_webView->handleInputEvent(fatTap(120, 230 + i * 5)); |
| 2907 EXPECT_FALSE(client.triggered()); |
| 2908 } |
| 2909 |
| 2910 for (int i = 0; i <= 46; i++) { |
| 2911 client.resetTriggered(); |
| 2912 m_webView->handleInputEvent(fatTap(10 + i * 5, 590)); |
| 2913 EXPECT_FALSE(client.triggered()); |
| 2914 } |
| 2915 |
| 2916 m_webView->close(); |
| 2917 m_webView = 0; |
| 2918 } |
| 2919 |
| 2920 TEST_F(WebFrameTest, DisambiguationPopupViewportSite) |
| 2921 { |
| 2922 const std::string htmlFile = "disambiguation_popup_viewport_site.html"; |
| 2923 registerMockedHttpURLLoad(htmlFile); |
| 2924 |
| 2925 DisambiguationPopupTestWebViewClient client; |
| 2926 |
| 2927 // Make sure we initialize to minimum scale, even if the window size |
| 2928 // only becomes available after the load begins. |
| 2929 m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + htmlFile, tru
e, 0, &client); |
| 2930 m_webView->enableFixedLayoutMode(true); |
| 2931 m_webView->settings()->setViewportEnabled(true); |
| 2932 m_webView->resize(WebSize(1000, 1000)); |
| 2933 m_webView->layout(); |
| 2934 |
2894 client.resetTriggered(); | 2935 client.resetTriggered(); |
2895 m_webView->handleInputEvent(fatTap(0, 0)); | 2936 m_webView->handleInputEvent(fatTap(0, 0)); |
2896 EXPECT_FALSE(client.triggered()); | 2937 EXPECT_FALSE(client.triggered()); |
2897 | 2938 |
2898 client.resetTriggered(); | 2939 client.resetTriggered(); |
2899 m_webView->handleInputEvent(fatTap(200, 115)); | 2940 m_webView->handleInputEvent(fatTap(200, 115)); |
2900 EXPECT_FALSE(client.triggered()); | 2941 EXPECT_FALSE(client.triggered()); |
2901 | 2942 |
2902 for (int i = 0; i <= 46; i++) { | 2943 for (int i = 0; i <= 46; i++) { |
2903 client.resetTriggered(); | 2944 client.resetTriggered(); |
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3678 m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "push_state.h
tml", true, 0, &client); | 3719 m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "push_state.h
tml", true, 0, &client); |
3679 runPendingTasks(); | 3720 runPendingTasks(); |
3680 | 3721 |
3681 EXPECT_EQ(client.startLoadingCount(), 2); | 3722 EXPECT_EQ(client.startLoadingCount(), 2); |
3682 EXPECT_EQ(client.stopLoadingCount(), 2); | 3723 EXPECT_EQ(client.stopLoadingCount(), 2); |
3683 m_webView->close(); | 3724 m_webView->close(); |
3684 m_webView = 0; | 3725 m_webView = 0; |
3685 } | 3726 } |
3686 | 3727 |
3687 } // namespace | 3728 } // namespace |
OLD | NEW |