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

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: Added 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 4f3a959e70cbd0d9c318764026d5f8e2a5ee99bc..046d23c9d4d7da3f0f51a8fc1cd97056ef3b4db8 100644
--- a/Source/core/css/MediaQuerySetTest.cpp
+++ b/Source/core/css/MediaQuerySetTest.cpp
@@ -97,12 +97,31 @@ 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"},
+ {"[]((), (max-width: 900px)", "not all"},
+ {"[](()), (max-width: 900px)", "not all, (max-width: 900px)"},
+ {"all an[isdfs bla())()]icalc(i)(()), (max-width: 900px)", "not all, (max-width: 900px)"},
+ {"all an[isdfs bla())(]icalc(i)(()), (max-width: 900px)", "not all"},
+ {"all an[isdfs bla())(]icalc(i)(())), (max-width: 900px)", "not all"},
+ {"all an[isdfs bla())(]icalc(i)(()))], (max-width: 900px)", "not all, (max-width: 900px)"},
{0, 0} // Do not remove the terminator line.
};
« no previous file with comments | « Source/build/scripts/make_mediaquery_tokenizer_codepoints.py ('k') | Source/core/css/parser/MediaQueryParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698