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

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

Issue 662343002: CSS Tokenizer: Fix edge cases in number parsing (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
Index: Source/core/css/parser/CSSTokenizerTest.cpp
diff --git a/Source/core/css/parser/CSSTokenizerTest.cpp b/Source/core/css/parser/CSSTokenizerTest.cpp
index 427409426db36f0a8a3dea37ec5a643a1ddf419d..34cccd684094fd01d08ccd0bad8e9c68e93f23d7 100644
--- a/Source/core/css/parser/CSSTokenizerTest.cpp
+++ b/Source/core/css/parser/CSSTokenizerTest.cpp
@@ -26,9 +26,9 @@ TEST(CSSTokenizerTest, Basic)
{
TestCase testCases[] = {
{ "(max-width: 50px)", "(max-width: 50px)" },
- { "(max-width: 1e+2px)", "(max-width: 100px)" },
- { "(max-width: 1e2px)", "(max-width: 100px)" },
- { "(max-width: 1000e-1px)", "(max-width: 100px)" },
+ { "(max-width: 1e+2px)", "(max-width: 100.000000px)" },
+ { "(max-width: 1e2px)", "(max-width: 100.000000px)" },
+ { "(max-width: 1000e-1px)", "(max-width: 100.000000px)" },
Yoav Weiss 2014/10/20 07:06:46 These tests would fail on some system locales, whe
Timothy Loh 2014/10/20 07:18:24 Good catch. There's probably a more appropriate fl
{ "(max-width: 50\\70\\78)", "(max-width: 50px)" },
{ "(max-width: /* comment */50px)", "(max-width: 50px)" },
{ "(max-width: /** *commen*t */60px)", "(max-width: 60px)" },
@@ -57,6 +57,11 @@ TEST(CSSTokenizerTest, Basic)
{ "(max-aspect-ratio: +5bla)", "(max-aspect-ratio: 5other)" },
{ "(max-aspect-ratio: -bla)", "(max-aspect-ratio: -bla)" },
{ "(max-aspect-ratio: --bla)", "(max-aspect-ratio: '-'-bla)" },
+ { "5e0", "5.000000" },
+ { "5.0", "5.000000" },
+ { "5.", "5'.'" },
+ { "5.0e-1", "0.500000" },
+ { "5.e-1", "5'.'e-1" },
{ 0, 0 } // Do not remove the terminator line.
};
« Source/core/css/parser/CSSTokenizer.cpp ('K') | « Source/core/css/parser/CSSTokenizer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698