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

Side by Side Diff: third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp

Issue 2646493002: '*' is not a valid attribute selector (Closed)
Patch Set: Adjust serialization test Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/CSSParserContext.h" 9 #include "core/css/parser/CSSParserContext.h"
10 #include "core/css/parser/CSSTokenizer.h" 10 #include "core/css/parser/CSSTokenizer.h"
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 SCOPED_TRACE(testCase[0]); 324 SCOPED_TRACE(testCase[0]);
325 CSSTokenizer tokenizer(testCase[0]); 325 CSSTokenizer tokenizer(testCase[0]);
326 CSSParserTokenRange range = tokenizer.tokenRange(); 326 CSSParserTokenRange range = tokenizer.tokenRange();
327 CSSSelectorList list = 327 CSSSelectorList list =
328 CSSSelectorParser::parseSelector(range, context, sheet); 328 CSSSelectorParser::parseSelector(range, context, sheet);
329 EXPECT_TRUE(list.isValid()); 329 EXPECT_TRUE(list.isValid());
330 EXPECT_STREQ(testCase[1], list.selectorsText().ascii().data()); 330 EXPECT_STREQ(testCase[1], list.selectorsText().ascii().data());
331 } 331 }
332 } 332 }
333 333
334 TEST(CSSSelectorParserTest, AttributeSelectorUniversalInvalid) {
335 const char* testCases[] = {"[*]", "[*|*]"};
336
337 CSSParserContext* context = CSSParserContext::create(HTMLStandardMode);
338 StyleSheetContents* sheet = StyleSheetContents::create(context);
339
340 for (auto testCase : testCases) {
341 SCOPED_TRACE(testCase);
342 CSSTokenizer tokenizer(testCase);
343 CSSParserTokenRange range = tokenizer.tokenRange();
344 CSSSelectorList list =
345 CSSSelectorParser::parseSelector(range, context, sheet);
346 EXPECT_FALSE(list.isValid());
347 }
348 }
349
334 } // namespace blink 350 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698