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

Unified Diff: Source/core/css/parser/CSSSelectorParserTest.cpp

Issue 962093002: CSS Tokenizer: Add an on-stack tokenizer scope (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/parser/CSSParserValuesTest.cpp ('k') | Source/core/css/parser/CSSTokenizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/parser/CSSSelectorParserTest.cpp
diff --git a/Source/core/css/parser/CSSSelectorParserTest.cpp b/Source/core/css/parser/CSSSelectorParserTest.cpp
index 441e47eba0817cf647901d38df1f251ac37fcadd..b3a52cd2b4daeb0bca50aea7f07edd5b26cd8ea2 100644
--- a/Source/core/css/parser/CSSSelectorParserTest.cpp
+++ b/Source/core/css/parser/CSSSelectorParserTest.cpp
@@ -73,11 +73,9 @@ TEST(CSSSelectorParserTest, ValidANPlusB)
for (unsigned i = 0; i < WTF_ARRAY_LENGTH(testCases); ++i) {
SCOPED_TRACE(testCases[i].input);
- Vector<CSSParserToken> tokens;
- CSSTokenizer::tokenize(testCases[i].input, tokens);
- CSSParserTokenRange range(tokens);
-
std::pair<int, int> ab;
+ CSSTokenizer::Scope scope(testCases[i].input);
+ CSSParserTokenRange range = scope.tokenRange();
bool passed = CSSSelectorParser::consumeANPlusB(range, ab);
EXPECT_TRUE(passed);
EXPECT_EQ(ab.first, testCases[i].a);
@@ -106,11 +104,9 @@ TEST(CSSSelectorParserTest, InvalidANPlusB)
for (unsigned i = 0; i < WTF_ARRAY_LENGTH(testCases); ++i) {
SCOPED_TRACE(testCases[i]);
- Vector<CSSParserToken> tokens;
- CSSTokenizer::tokenize(testCases[i], tokens);
- CSSParserTokenRange range(tokens);
-
std::pair<int, int> ab;
+ CSSTokenizer::Scope scope(testCases[i]);
+ CSSParserTokenRange range = scope.tokenRange();
bool passed = CSSSelectorParser::consumeANPlusB(range, ab);
EXPECT_FALSE(passed);
}
« no previous file with comments | « Source/core/css/parser/CSSParserValuesTest.cpp ('k') | Source/core/css/parser/CSSTokenizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698