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

Unified Diff: Source/core/css/MediaQuerySetTest.cpp

Issue 217423005: Get Media Query parser to handle parens, brackets and braces blocks correctly (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed algorithm and more tests Created 6 years, 9 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/MediaQuerySetTest.cpp
diff --git a/Source/core/css/MediaQuerySetTest.cpp b/Source/core/css/MediaQuerySetTest.cpp
index ef8178cf59cc3d05e32dcb0e72c3e4c59e4f4b98..a594a060bcd3ce51805f193da48b57a37d9b5474 100644
--- a/Source/core/css/MediaQuerySetTest.cpp
+++ b/Source/core/css/MediaQuerySetTest.cpp
@@ -97,6 +97,25 @@ TEST(MediaQueryParserTest, Basic)
{"all and (orientation:landscape)", "(orientation: landscape)"},
{"NOT braille, tv AND (max-width: 200px) and (min-WIDTH: 100px) and (orientation: landscape), (color)",
"not braille, tv and (max-width: 200px) and (min-width: 100px) and (orientation: landscape), (color)"},
+ {"(max-width: 700px), (max-width: 700px)", "(max-width: 700px), (max-width: 700px)"},
+ {"(max-width: 800px()), (max-width: 800px)", "not all, (max-width: 800px)"},
+ {"(max-width: 900px(()), (max-width: 900px)", "not all"},
+ {"(max-width: 600px(())))), (max-width: 600px)", "not all, (max-width: 600px)"},
+ {"(max-width: 500px(((((((((())))), (max-width: 500px)", "not all"},
+ {"(max-width: 800px[]), (max-width: 800px)", "not all, (max-width: 800px)"},
+ {"(max-width: 900px[[]), (max-width: 900px)", "not all"},
+ {"(max-width: 600px[[]]]]), (max-width: 600px)", "not all, (max-width: 600px)"},
+ {"(max-width: 500px[[[[[[[[[[]]]]), (max-width: 500px)", "not all"},
+ {"(max-width: 800px{}), (max-width: 800px)", "not all, (max-width: 800px)"},
+ {"(max-width: 900px{{}), (max-width: 900px)", "not all"},
+ {"(max-width: 600px{{}}}}), (max-width: 600px)", "not all, (max-width: 600px)"},
+ {"(max-width: 500px{{{{{{{{{{}}}}), (max-width: 500px)", "not all"},
+ {"[(), (max-width: 900px)", "not all"},
+ {"[{}, (max-width: 900px)", "not all"},
+ {"[{]}], (max-width: 900px)", "not all, (max-width: 900px)"},
+ {"[{[]{}{{{}}}}], (max-width: 900px)", "not all, (max-width: 900px)"},
+ {"[{[}], (max-width: 900px)", "not all"},
+ {"[({)}], (max-width: 900px)", "not all"},
{0, 0} // Do not remove the terminator line.
};

Powered by Google App Engine
This is Rietveld 408576698