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

Unified Diff: third_party/WebKit/Source/core/html/forms/EmailInputTypeTest.cpp

Issue 2037963002: Make ScriptRegexp for email address a member of EmailInputType. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: explicit, simplify ensureEmailRegexp() Created 4 years, 6 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 | « third_party/WebKit/Source/core/html/forms/EmailInputType.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/forms/EmailInputTypeTest.cpp
diff --git a/third_party/WebKit/Source/core/html/forms/EmailInputTypeTest.cpp b/third_party/WebKit/Source/core/html/forms/EmailInputTypeTest.cpp
index 15b18eb17f313562d338b0eb51e76783c479cd99..9a760f327387bc18365f07d6ddc6409610e91136 100644
--- a/third_party/WebKit/Source/core/html/forms/EmailInputTypeTest.cpp
+++ b/third_party/WebKit/Source/core/html/forms/EmailInputTypeTest.cpp
@@ -4,6 +4,7 @@
#include "core/html/forms/EmailInputType.h"
+#include "bindings/core/v8/ScriptRegexp.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace blink {
@@ -12,16 +13,18 @@ namespace {
void expectToSucceed(const String& source)
{
- String result = EmailInputType::convertEmailAddressToASCII(source);
+ std::unique_ptr<ScriptRegexp> emailRegexp = EmailInputType::createEmailRegexp();
+ String result = EmailInputType::convertEmailAddressToASCII(*emailRegexp, source);
EXPECT_NE(source, result);
- EXPECT_TRUE(EmailInputType::isValidEmailAddress(result));
+ EXPECT_TRUE(EmailInputType::isValidEmailAddress(*emailRegexp, result));
}
void expectToFail(const String& source)
{
+ std::unique_ptr<ScriptRegexp> emailRegexp = EmailInputType::createEmailRegexp();
// Conversion failed. The resultant value might contains non-ASCII
// characters, and not a valid email address.
- EXPECT_FALSE(EmailInputType::isValidEmailAddress(EmailInputType::convertEmailAddressToASCII(source)));
+ EXPECT_FALSE(EmailInputType::isValidEmailAddress(*emailRegexp, EmailInputType::convertEmailAddressToASCII(*emailRegexp, source)));
}
} // namespace
« no previous file with comments | « third_party/WebKit/Source/core/html/forms/EmailInputType.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698