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

Side by Side Diff: Source/core/css/parser/MediaQueryTokenizerTest.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, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/css/parser/MediaQueryTokenizer.h" 6 #include "core/css/parser/MediaQueryTokenizer.h"
7 7
8 #include "wtf/PassOwnPtr.h" 8 #include "wtf/PassOwnPtr.h"
9 #include <gtest/gtest.h> 9 #include <gtest/gtest.h>
10 10
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 else if (isASCIIAlpha(c)) 59 else if (isASCIIAlpha(c))
60 testToken(c, IdentToken); 60 testToken(c, IdentToken);
61 else if (c == '_') 61 else if (c == '_')
62 testToken(c, IdentToken); 62 testToken(c, IdentToken);
63 else if (c == '\r' || c == ' ' || c == '\n' || c == '\t' || c == '\f') 63 else if (c == '\r' || c == ' ' || c == '\n' || c == '\t' || c == '\f')
64 testToken(c, WhitespaceToken); 64 testToken(c, WhitespaceToken);
65 else if (c == '(') 65 else if (c == '(')
66 testToken(c, LeftParenthesisToken); 66 testToken(c, LeftParenthesisToken);
67 else if (c == ')') 67 else if (c == ')')
68 testToken(c, RightParenthesisToken); 68 testToken(c, RightParenthesisToken);
69 else if (c == '[')
70 testToken(c, LeftBracketToken);
71 else if (c == ']')
72 testToken(c, RightBracketToken);
73 else if (c == '{')
74 testToken(c, LeftBraceToken);
75 else if (c == '}')
76 testToken(c, RightBraceToken);
69 else if (c == '.' || c == '+' || c == '-' || c == '/' || c == '\\') 77 else if (c == '.' || c == '+' || c == '-' || c == '/' || c == '\\')
70 testToken(c, DelimiterToken); 78 testToken(c, DelimiterToken);
71 else if (c == ',') 79 else if (c == ',')
72 testToken(c, CommaToken); 80 testToken(c, CommaToken);
73 else if (c == ':') 81 else if (c == ':')
74 testToken(c, ColonToken); 82 testToken(c, ColonToken);
75 else if (c == ';') 83 else if (c == ';')
76 testToken(c, SemicolonToken); 84 testToken(c, SemicolonToken);
77 else if (!c) 85 else if (!c)
78 testToken(c, EOFToken); 86 testToken(c, EOFToken);
79 else if (c > SCHAR_MAX) 87 else if (c > SCHAR_MAX)
80 testToken(c, IdentToken); 88 testToken(c, IdentToken);
81 else 89 else
82 testToken(c, DelimiterToken); 90 testToken(c, DelimiterToken);
83 } 91 }
84 testToken(USHRT_MAX, IdentToken); 92 testToken(USHRT_MAX, IdentToken);
85 } 93 }
86 94
87 } // namespace 95 } // namespace
OLDNEW
« Source/core/css/parser/MediaQueryParser.cpp ('K') | « Source/core/css/parser/MediaQueryTokenizer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698