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

Unified 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: Rebased 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | Source/web/tests/data/disambiguation_popup_viewport_site.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/WebFrameTest.cpp
diff --git a/Source/web/tests/WebFrameTest.cpp b/Source/web/tests/WebFrameTest.cpp
index e60297a38762379674687cb860d2faf4a682c0af..3ea2d81ab60692061cfb3985d4a381fea48af30c 100644
--- a/Source/web/tests/WebFrameTest.cpp
+++ b/Source/web/tests/WebFrameTest.cpp
@@ -2888,6 +2888,47 @@ TEST_F(WebFrameTest, DisambiguationPopupMobileSite)
// Make sure we initialize to minimum scale, even if the window size
// only becomes available after the load begins.
m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + htmlFile, true, 0, &client);
+ m_webView->enableFixedLayoutMode(true);
+ m_webView->settings()->setViewportEnabled(true);
+ m_webView->resize(WebSize(1000, 1000));
+ m_webView->layout();
+
+ client.resetTriggered();
+ m_webView->handleInputEvent(fatTap(0, 0));
+ EXPECT_FALSE(client.triggered());
+
+ client.resetTriggered();
+ m_webView->handleInputEvent(fatTap(200, 115));
+ EXPECT_FALSE(client.triggered());
+
+ for (int i = 0; i <= 46; i++) {
+ client.resetTriggered();
+ m_webView->handleInputEvent(fatTap(120, 230 + i * 5));
+ EXPECT_FALSE(client.triggered());
+ }
+
+ for (int i = 0; i <= 46; i++) {
+ client.resetTriggered();
+ m_webView->handleInputEvent(fatTap(10 + i * 5, 590));
+ EXPECT_FALSE(client.triggered());
+ }
+
+ m_webView->close();
+ m_webView = 0;
+}
+
+TEST_F(WebFrameTest, DisambiguationPopupViewportSite)
+{
+ const std::string htmlFile = "disambiguation_popup_viewport_site.html";
+ registerMockedHttpURLLoad(htmlFile);
+
+ DisambiguationPopupTestWebViewClient client;
+
+ // Make sure we initialize to minimum scale, even if the window size
+ // only becomes available after the load begins.
+ m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + htmlFile, true, 0, &client);
+ m_webView->enableFixedLayoutMode(true);
+ m_webView->settings()->setViewportEnabled(true);
m_webView->resize(WebSize(1000, 1000));
m_webView->layout();
« no previous file with comments | « Source/web/WebViewImpl.cpp ('k') | Source/web/tests/data/disambiguation_popup_viewport_site.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698