OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "core/css/parser/CSSSelectorParser.h" | 5 #include "core/css/parser/CSSSelectorParser.h" |
6 | 6 |
7 #include "core/css/CSSSelectorList.h" | 7 #include "core/css/CSSSelectorList.h" |
8 #include "core/css/StyleSheetContents.h" | 8 #include "core/css/StyleSheetContents.h" |
9 #include "core/css/parser/CSSTokenizer.h" | 9 #include "core/css/parser/CSSTokenizer.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 "::shadow.class", | 183 "::shadow.class", |
184 "::selection:window-inactive::before", | 184 "::selection:window-inactive::before", |
185 "::-webkit-volume-slider.class", | 185 "::-webkit-volume-slider.class", |
186 "::content.a", | 186 "::content.a", |
187 "::content.a.b", | 187 "::content.a.b", |
188 ".a::content.b", | 188 ".a::content.b", |
189 "::before:not(.a)", | 189 "::before:not(.a)", |
190 "::shadow:not(::after)", | 190 "::shadow:not(::after)", |
191 "::content:not(#id)", | 191 "::content:not(#id)", |
192 "::-webkit-scrollbar:vertical:not(:first-child)", | 192 "::-webkit-scrollbar:vertical:not(:first-child)", |
193 "video::-webkit-media-text-track-region-container.scrolling" | 193 "video::-webkit-media-text-track-region-container.scrolling", |
| 194 "div ::before.a" |
194 }; | 195 }; |
195 | 196 |
196 for (auto testCase : testCases) { | 197 for (auto testCase : testCases) { |
197 CSSTokenizer::Scope scope(testCase); | 198 CSSTokenizer::Scope scope(testCase); |
198 CSSParserTokenRange range = scope.tokenRange(); | 199 CSSParserTokenRange range = scope.tokenRange(); |
199 CSSSelectorList list = CSSSelectorParser::parseSelector(range, CSSParser
Context(HTMLStandardMode, nullptr), nullptr); | 200 CSSSelectorList list = CSSSelectorParser::parseSelector(range, CSSParser
Context(HTMLStandardMode, nullptr), nullptr); |
200 EXPECT_FALSE(list.isValid()); | 201 EXPECT_FALSE(list.isValid()); |
201 } | 202 } |
202 } | 203 } |
203 | 204 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 SCOPED_TRACE(testCase[0]); | 299 SCOPED_TRACE(testCase[0]); |
299 CSSTokenizer::Scope scope(testCase[0]); | 300 CSSTokenizer::Scope scope(testCase[0]); |
300 CSSParserTokenRange range = scope.tokenRange(); | 301 CSSParserTokenRange range = scope.tokenRange(); |
301 CSSSelectorList list = CSSSelectorParser::parseSelector(range, context,
sheet.get()); | 302 CSSSelectorList list = CSSSelectorParser::parseSelector(range, context,
sheet.get()); |
302 EXPECT_TRUE(list.isValid()); | 303 EXPECT_TRUE(list.isValid()); |
303 EXPECT_STREQ(testCase[1], list.selectorsText().ascii().data()); | 304 EXPECT_STREQ(testCase[1], list.selectorsText().ascii().data()); |
304 } | 305 } |
305 } | 306 } |
306 | 307 |
307 } // namespace blink | 308 } // namespace blink |
OLD | NEW |