Index: third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp |
diff --git a/third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp b/third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp |
index 539c1302aaa5d843a0c8fdcf7a04c7198c11d322..644d29416b8d69df0daaa11f6a2b16248020498a 100644 |
--- a/third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp |
+++ b/third_party/WebKit/Source/core/css/parser/CSSSelectorParserTest.cpp |
@@ -5,6 +5,7 @@ |
#include "core/css/parser/CSSSelectorParser.h" |
#include "core/css/CSSSelectorList.h" |
+#include "core/css/StyleSheetContents.h" |
#include "core/css/parser/CSSTokenizer.h" |
#include "testing/gtest/include/gtest/gtest.h" |
@@ -251,4 +252,23 @@ TEST(CSSSelectorParserTest, InvalidPseudoElementInNonRightmostCompound) |
} |
} |
+TEST(CSSSelectorParserTest, UnresolvedNamespacePrefix) |
+{ |
+ const char* testCases[] = { |
+ "ns|div", |
+ "div ns|div", |
+ "div ns|div " |
+ }; |
+ |
+ CSSParserContext context(HTMLStandardMode, nullptr); |
+ RefPtrWillBeRawPtr<StyleSheetContents> sheet = StyleSheetContents::create(context); |
+ |
+ for (auto testCase : testCases) { |
+ CSSTokenizer::Scope scope(testCase); |
+ CSSParserTokenRange range = scope.tokenRange(); |
+ CSSSelectorList list = CSSSelectorParser::parseSelector(range, context, sheet.get()); |
+ EXPECT_FALSE(list.isValid()); |
+ } |
+} |
+ |
} // namespace |