Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: Source/web/tests/WebFrameTest.cpp

Issue 23592015: Use constrained values for shouldDisableDesktopWorkarounds. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Yet another comment fix Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2785 matching lines...) Expand 10 before | Expand all | Expand 10 after
2796 TEST_F(WebFrameTest, DisambiguationPopupMobileSite) 2796 TEST_F(WebFrameTest, DisambiguationPopupMobileSite)
2797 { 2797 {
2798 const std::string htmlFile = "disambiguation_popup_mobile_site.html"; 2798 const std::string htmlFile = "disambiguation_popup_mobile_site.html";
2799 registerMockedHttpURLLoad(htmlFile); 2799 registerMockedHttpURLLoad(htmlFile);
2800 2800
2801 DisambiguationPopupTestWebViewClient client; 2801 DisambiguationPopupTestWebViewClient client;
2802 2802
2803 // Make sure we initialize to minimum scale, even if the window size 2803 // Make sure we initialize to minimum scale, even if the window size
2804 // only becomes available after the load begins. 2804 // only becomes available after the load begins.
2805 m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + htmlFile, tru e, 0, &client); 2805 m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + htmlFile, tru e, 0, &client);
2806 m_webView->enableFixedLayoutMode(true);
2807 m_webView->settings()->setViewportEnabled(true);
2806 m_webView->resize(WebSize(1000, 1000)); 2808 m_webView->resize(WebSize(1000, 1000));
2807 m_webView->layout(); 2809 m_webView->layout();
2808 2810
2811 client.resetTriggered();
2812 m_webView->handleInputEvent(fatTap(0, 0));
2813 EXPECT_FALSE(client.triggered());
2814
2815 client.resetTriggered();
2816 m_webView->handleInputEvent(fatTap(200, 115));
2817 EXPECT_FALSE(client.triggered());
2818
2819 for (int i = 0; i <= 46; i++) {
2820 client.resetTriggered();
2821 m_webView->handleInputEvent(fatTap(120, 230 + i * 5));
2822 EXPECT_FALSE(client.triggered());
2823 }
2824
2825 for (int i = 0; i <= 46; i++) {
2826 client.resetTriggered();
2827 m_webView->handleInputEvent(fatTap(10 + i * 5, 590));
2828 EXPECT_FALSE(client.triggered());
2829 }
2830
2831 m_webView->close();
2832 m_webView = 0;
2833 }
2834
2835 TEST_F(WebFrameTest, DisambiguationPopupViewportSite)
2836 {
2837 const std::string htmlFile = "disambiguation_popup_viewport_site.html";
2838 registerMockedHttpURLLoad(htmlFile);
2839
2840 DisambiguationPopupTestWebViewClient client;
2841
2842 // Make sure we initialize to minimum scale, even if the window size
2843 // only becomes available after the load begins.
2844 m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + htmlFile, tru e, 0, &client);
2845 m_webView->enableFixedLayoutMode(true);
2846 m_webView->settings()->setViewportEnabled(true);
2847 m_webView->resize(WebSize(1000, 1000));
2848 m_webView->layout();
2849
2809 client.resetTriggered(); 2850 client.resetTriggered();
2810 m_webView->handleInputEvent(fatTap(0, 0)); 2851 m_webView->handleInputEvent(fatTap(0, 0));
2811 EXPECT_FALSE(client.triggered()); 2852 EXPECT_FALSE(client.triggered());
2812 2853
2813 client.resetTriggered(); 2854 client.resetTriggered();
2814 m_webView->handleInputEvent(fatTap(200, 115)); 2855 m_webView->handleInputEvent(fatTap(200, 115));
2815 EXPECT_FALSE(client.triggered()); 2856 EXPECT_FALSE(client.triggered());
2816 2857
2817 for (int i = 0; i <= 46; i++) { 2858 for (int i = 0; i <= 46; i++) {
2818 client.resetTriggered(); 2859 client.resetTriggered();
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
3593 m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "push_state.h tml", true, 0, &client); 3634 m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "push_state.h tml", true, 0, &client);
3594 runPendingTasks(); 3635 runPendingTasks();
3595 3636
3596 EXPECT_EQ(client.startLoadingCount(), 2); 3637 EXPECT_EQ(client.startLoadingCount(), 2);
3597 EXPECT_EQ(client.stopLoadingCount(), 2); 3638 EXPECT_EQ(client.stopLoadingCount(), 2);
3598 m_webView->close(); 3639 m_webView->close();
3599 m_webView = 0; 3640 m_webView = 0;
3600 } 3641 }
3601 3642
3602 } // namespace 3643 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698