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

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSParserValuesTest.cpp

Issue 1636453002: Use ASCII case-insensitive matching for ident-likes in the CSS parser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Consistent indentation in test. 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/parser/CSSParserValuesTest.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserValuesTest.cpp b/third_party/WebKit/Source/core/css/parser/CSSParserValuesTest.cpp
index 02944863adc9af38e7e6ef6528c7f63eb1f7f205..e73995d155df7cae573b4c7fdedc53d19d2546a2 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSParserValuesTest.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSParserValuesTest.cpp
@@ -59,20 +59,20 @@ TEST(CSSParserValuesTest, InitWithEmptyString)
EXPECT_FALSE(String(cssParserString).isNull());
}
-TEST(CSSParserValuesTest, EqualIgnoringCase8BitsString)
+TEST(CSSParserValuesTest, EqualIgnoringASCIICase8BitsString)
{
CSSParserString cssParserString;
String string8bit("sHaDOw");
cssParserString.init(string8bit);
- ASSERT_TRUE(cssParserString.equalIgnoringCase("shadow"));
- ASSERT_TRUE(cssParserString.equalIgnoringCase("ShaDow"));
- ASSERT_FALSE(cssParserString.equalIgnoringCase("shadow-all"));
- ASSERT_FALSE(cssParserString.equalIgnoringCase("sha"));
- ASSERT_FALSE(cssParserString.equalIgnoringCase("abCD"));
+ ASSERT_TRUE(cssParserString.equalIgnoringASCIICase("shadow"));
+ ASSERT_TRUE(cssParserString.equalIgnoringASCIICase("ShaDow"));
+ ASSERT_FALSE(cssParserString.equalIgnoringASCIICase("shadow-all"));
+ ASSERT_FALSE(cssParserString.equalIgnoringASCIICase("sha"));
+ ASSERT_FALSE(cssParserString.equalIgnoringASCIICase("abCD"));
}
-TEST(CSSParserValuesTest, EqualIgnoringCase16BitsString)
+TEST(CSSParserValuesTest, EqualIgnoringASCIICase16BitsString)
{
String string16bit("sHaDOw");
string16bit.ensure16Bit();
@@ -80,11 +80,21 @@ TEST(CSSParserValuesTest, EqualIgnoringCase16BitsString)
CSSParserString cssParserString;
cssParserString.init(string16bit);
- ASSERT_TRUE(cssParserString.equalIgnoringCase("shadow"));
- ASSERT_TRUE(cssParserString.equalIgnoringCase("ShaDow"));
- ASSERT_FALSE(cssParserString.equalIgnoringCase("shadow-all"));
- ASSERT_FALSE(cssParserString.equalIgnoringCase("sha"));
- ASSERT_FALSE(cssParserString.equalIgnoringCase("abCD"));
+ ASSERT_TRUE(cssParserString.equalIgnoringASCIICase("shadow"));
+ ASSERT_TRUE(cssParserString.equalIgnoringASCIICase("ShaDow"));
+ ASSERT_FALSE(cssParserString.equalIgnoringASCIICase("shadow-all"));
+ ASSERT_FALSE(cssParserString.equalIgnoringASCIICase("sha"));
+ ASSERT_FALSE(cssParserString.equalIgnoringASCIICase("abCD"));
+
+ StringBuilder builder;
+ builder.append(0x017f); // LATIN SMALL LETTER LONG S
+ builder.append("HaDOw");
+ ASSERT_FALSE(builder.is8Bit());
+
+ String string16BitFoldingToASCII = builder.toString();
+ cssParserString.init(string16BitFoldingToASCII);
+
+ ASSERT_FALSE(cssParserString.equalIgnoringASCIICase("shadow"));
}
TEST(CSSParserValuesTest, CSSParserValuelistClear)

Powered by Google App Engine
This is Rietveld 408576698