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

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

Issue 1627713002: Add more missing closing namespace comments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, address comment (also filed llvm.org/PR26290) Created 4 years, 11 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/html/forms/EmailInputType.h" 5 #include "core/html/forms/EmailInputType.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
11 namespace { 11 namespace {
12 12
13 void expectToSucceed(const String& source) 13 void expectToSucceed(const String& source)
14 { 14 {
15 String result = EmailInputType::convertEmailAddressToASCII(source); 15 String result = EmailInputType::convertEmailAddressToASCII(source);
16 EXPECT_NE(source, result); 16 EXPECT_NE(source, result);
17 EXPECT_TRUE(EmailInputType::isValidEmailAddress(result)); 17 EXPECT_TRUE(EmailInputType::isValidEmailAddress(result));
18 } 18 }
19 19
20 void expectToFail(const String& source) 20 void expectToFail(const String& source)
21 { 21 {
22 // Conversion failed. The resultant value might contains non-ASCII 22 // Conversion failed. The resultant value might contains non-ASCII
23 // characters, and not a valid email address. 23 // characters, and not a valid email address.
24 EXPECT_FALSE(EmailInputType::isValidEmailAddress(EmailInputType::convertEmai lAddressToASCII(source))); 24 EXPECT_FALSE(EmailInputType::isValidEmailAddress(EmailInputType::convertEmai lAddressToASCII(source)));
25 } 25 }
26 26
27 } 27 } // namespace
28 28
29 TEST(EmailInputTypeTest, ConvertEmailAddressToASCII) 29 TEST(EmailInputTypeTest, ConvertEmailAddressToASCII)
30 { 30 {
31 // U+043C U+043E U+0439 . U+0434 U+043E U+043C U+0435 U+043D 31 // U+043C U+043E U+0439 . U+0434 U+043E U+043C U+0435 U+043D
32 expectToFail(String::fromUTF8("user@\xD0\xBC\xD0\xBE\xD0\xB9.\xD0\xB4\xD0\xB E\xD0\xBC\xD0\xB5\xD0\xBD@")); 32 expectToFail(String::fromUTF8("user@\xD0\xBC\xD0\xBE\xD0\xB9.\xD0\xB4\xD0\xB E\xD0\xBC\xD0\xB5\xD0\xBD@"));
33 expectToFail(String::fromUTF8("user@\xD0\xBC\xD0\xBE\xD0\xB9. \xD0\xB4\xD0\x BE\xD0\xBC\xD0\xB5\xD0\xBD")); 33 expectToFail(String::fromUTF8("user@\xD0\xBC\xD0\xBE\xD0\xB9. \xD0\xB4\xD0\x BE\xD0\xBC\xD0\xB5\xD0\xBD"));
34 expectToFail(String::fromUTF8("user@\xD0\xBC\xD0\xBE\xD0\xB9.\t\xD0\xB4\xD0\ xBE\xD0\xBC\xD0\xB5\xD0\xBD")); 34 expectToFail(String::fromUTF8("user@\xD0\xBC\xD0\xBE\xD0\xB9.\t\xD0\xB4\xD0\ xBE\xD0\xBC\xD0\xB5\xD0\xBD"));
35 } 35 }
36 36
37 TEST(EmailInputTypeTest, ConvertEmailAddressToASCIIUTS46) 37 TEST(EmailInputTypeTest, ConvertEmailAddressToASCIIUTS46)
(...skipping 22 matching lines...) Expand all
60 // U+0662 60 // U+0662
61 expectToFail(String::fromUTF8("foo@\xD8\x82.com")); 61 expectToFail(String::fromUTF8("foo@\xD8\x82.com"));
62 62
63 // U+2615 63 // U+2615
64 expectToSucceed(String::fromUTF8("foo@\xE2\x98\x95.com")); 64 expectToSucceed(String::fromUTF8("foo@\xE2\x98\x95.com"));
65 // U+023A 65 // U+023A
66 expectToSucceed(String::fromUTF8("foo@\xC8\xBA.com")); 66 expectToSucceed(String::fromUTF8("foo@\xC8\xBA.com"));
67 } 67 }
68 68
69 } // namespace blink 69 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698