summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/tests/WebViewTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/chromium/tests/WebViewTest.cpp')
-rw-r--r--Source/WebKit/chromium/tests/WebViewTest.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/Source/WebKit/chromium/tests/WebViewTest.cpp b/Source/WebKit/chromium/tests/WebViewTest.cpp
index 00d8a832d..460c62bd2 100644
--- a/Source/WebKit/chromium/tests/WebViewTest.cpp
+++ b/Source/WebKit/chromium/tests/WebViewTest.cpp
@@ -110,6 +110,8 @@ protected:
int expectedWidth, int expectedHeight,
HorizontalScrollbarState expectedHorizontalState, VerticalScrollbarState expectedVerticalState);
+ void testTextInputType(WebTextInputType expectedType, const std::string& htmlFile);
+
std::string m_baseURL;
};
@@ -245,4 +247,44 @@ TEST_F(WebViewTest, AutoResizeMaxSize)
expectedWidth, expectedHeight, NoHorizontalScrollbar, NoVerticalScrollbar);
}
+void WebViewTest::testTextInputType(WebTextInputType expectedType, const std::string& htmlFile)
+{
+ FrameTestHelpers::registerMockedURLLoad(m_baseURL, htmlFile);
+ WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + htmlFile);
+ webView->setInitialFocus(false);
+ EXPECT_EQ(expectedType, webView->textInputType());
+ webView->close();
+}
+
+// Disabled for https://bugs.webkit.org/show_bug.cgi?id=78746#c29
+TEST_F(WebViewTest, DISABLED_TextInputType)
+{
+ testTextInputType(WebTextInputTypeText, "input_field_default.html");
+ testTextInputType(WebTextInputTypePassword, "input_field_password.html");
+ testTextInputType(WebTextInputTypeEmail, "input_field_email.html");
+ testTextInputType(WebTextInputTypeSearch, "input_field_search.html");
+ testTextInputType(WebTextInputTypeNumber, "input_field_number.html");
+ testTextInputType(WebTextInputTypeTelephone, "input_field_tel.html");
+ testTextInputType(WebTextInputTypeURL, "input_field_url.html");
+#if ENABLE(INPUT_TYPE_DATE)
+ testTextInputType(WebTextInputTypeDate, "input_field_date.html");
+#endif
+#if ENABLE(INPUT_TYPE_DATETIME)
+ testTextInputType(WebTextInputTypeDateTime, "input_field_datetime.html");
+#endif
+#if ENABLE(INPUT_TYPE_DATETIMELOCAL)
+ testTextInputType(WebTextInputTypeDateTimeLocal, "input_field_datetimelocal.html");
+#endif
+#if ENABLE(INPUT_TYPE_MONTH)
+ testTextInputType(WebTextInputTypeMonth, "input_field_month.html");
+#endif
+#if ENABLE(INPUT_TYPE_TIME)
+ testTextInputType(WebTextInputTypeTime, "input_field_time.html");
+#endif
+#if ENABLE(INPUT_TYPE_WEEK)
+ testTextInputType(WebTextInputTypeWeek, "input_field_week.html");
+#endif
+
+}
+
}