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

Unified Diff: Source/core/css/parser/CSSTokenizerTest.cpp

Issue 656033010: CSS Tokenizer: Fix handling of escaped newlines (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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/core/css/parser/CSSTokenizer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/parser/CSSTokenizerTest.cpp
diff --git a/Source/core/css/parser/CSSTokenizerTest.cpp b/Source/core/css/parser/CSSTokenizerTest.cpp
index f4757883568eb05c765b97a3437af9d4bb1ddd57..3919339b767341ab73cd5d5dd7dae48f1974a5b4 100644
--- a/Source/core/css/parser/CSSTokenizerTest.cpp
+++ b/Source/core/css/parser/CSSTokenizerTest.cpp
@@ -157,6 +157,9 @@ TEST(CSSTokenizerTest, Escapes)
TEST_TOKENS("te\\s\\t", ident("test"));
TEST_TOKENS("spaces\\ in\\\tident", ident("spaces in\tident"));
TEST_TOKENS("\\.\\,\\:\\!", ident(".,:!"));
+ TEST_TOKENS("\\\r", delim('\\'), whitespace);
+ TEST_TOKENS("\\\f", delim('\\'), whitespace);
+ TEST_TOKENS("\\\r\n", delim('\\'), whitespace);
// FIXME: We don't correctly return replacement characters
// String replacement = fromUChar32(0xFFFD);
// TEST_TOKENS("null\\0", ident("null" + replacement));
@@ -168,10 +171,6 @@ TEST(CSSTokenizerTest, Escapes)
// FIXME: We don't correctly return supplementary plane characters
// TEST_TOKENS("\\10fFfF", ident(fromUChar32(0x10ffff) + "0"));
// TEST_TOKENS("\\10000000", ident(fromUChar32(0x100000) + "000"));
- // FIXME: We don't correctly match newlines (normally handled in preprocessing)
- // TEST_TOKENS("\\\r", delim('\\'), whitespace);
- // TEST_TOKENS("\\\f", delim('\\'), whitespace);
- // TEST_TOKENS("\\\r\n", delim('\\'), whitespace);
}
TEST(CSSTokenizerTest, IdentToken)
@@ -218,14 +217,13 @@ TEST(CSSTokenizerTest, StringToken)
TEST_TOKENS("'esca\\\nped'", string("escaped"));
TEST_TOKENS("\"esc\\\faped\"", string("escaped"));
TEST_TOKENS("'new\\\rline'", string("newline"));
+ TEST_TOKENS("\"new\\\r\nline\"", string("newline"));
TEST_TOKENS("'bad\nstring", badString, whitespace, ident("string"));
TEST_TOKENS("'bad\rstring", badString, whitespace, ident("string"));
TEST_TOKENS("'bad\r\nstring", badString, whitespace, ident("string"));
TEST_TOKENS("'bad\fstring", badString, whitespace, ident("string"));
// FIXME: Preprocessing is supposed to replace U+0000 with U+FFFD
// TEST_TOKENS("'\0'", string(fromUChar32(0xFFFD)));
- // FIXME: We don't correctly match newlines (normally handled in preprocessing)
- // TEST_TOKENS("\"new\\\r\nline\"", string("newline"));
}
TEST(CSSTokenizerTest, NumberToken)
« no previous file with comments | « Source/core/css/parser/CSSTokenizer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698