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

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

Issue 1625433002: Missing m_failedParsing=true for unresolved namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/parser/CSSTokenizer.h" 9 #include "core/css/parser/CSSTokenizer.h"
9 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
10 11
11 namespace blink { 12 namespace blink {
12 13
13 typedef struct { 14 typedef struct {
14 const char* input; 15 const char* input;
15 const int a; 16 const int a;
16 const int b; 17 const int b;
17 } ANPlusBTestCase; 18 } ANPlusBTestCase;
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 }; 245 };
245 246
246 for (auto testCase : testCases) { 247 for (auto testCase : testCases) {
247 CSSTokenizer::Scope scope(testCase); 248 CSSTokenizer::Scope scope(testCase);
248 CSSParserTokenRange range = scope.tokenRange(); 249 CSSParserTokenRange range = scope.tokenRange();
249 CSSSelectorList list = CSSSelectorParser::parseSelector(range, CSSParser Context(HTMLStandardMode, nullptr), nullptr); 250 CSSSelectorList list = CSSSelectorParser::parseSelector(range, CSSParser Context(HTMLStandardMode, nullptr), nullptr);
250 EXPECT_FALSE(list.isValid()); 251 EXPECT_FALSE(list.isValid());
251 } 252 }
252 } 253 }
253 254
255 TEST(CSSSelectorParserTest, UnresolvedNamespacePrefix)
256 {
257 const char* testCases[] = {
258 "ns|div",
259 "div ns|div",
260 "div ns|div "
261 };
262
263 CSSParserContext context(HTMLStandardMode, nullptr);
264 RefPtrWillBeRawPtr<StyleSheetContents> sheet = StyleSheetContents::create(co ntext);
265
266 for (auto testCase : testCases) {
267 CSSTokenizer::Scope scope(testCase);
268 CSSParserTokenRange range = scope.tokenRange();
269 CSSSelectorList list = CSSSelectorParser::parseSelector(range, context, sheet.get());
270 EXPECT_FALSE(list.isValid());
271 }
272 }
273
254 } // namespace 274 } // namespace
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