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

Unified Diff: Source/core/html/track/vtt/VTTScannerTest.cpp

Issue 137033002: Use VTTScanner for VTT region settings parsing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/track/vtt/VTTScanner.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/track/vtt/VTTScannerTest.cpp
diff --git a/Source/core/html/track/vtt/VTTScannerTest.cpp b/Source/core/html/track/vtt/VTTScannerTest.cpp
index 5e0393458af7bbc7915eaea0927b0392e69067b8..80053d03c6d4ccc771046f138cc416616f4c0b0f 100644
--- a/Source/core/html/track/vtt/VTTScannerTest.cpp
+++ b/Source/core/html/track/vtt/VTTScannerTest.cpp
@@ -161,7 +161,7 @@ void scanWithInvPredicate(const String& input)
// collectUntil doesn't move the scan position.
EXPECT_TRUE(scanner.match('B'));
// Consume "BAD".
- scanner.skipRun(ucRun);
+ scanner.skipUntil<lowerCaseAlpha>();
EXPECT_TRUE(scanner.match('a'));
EXPECT_TRUE(scanner.isAt(ucRun.end()));
@@ -173,12 +173,12 @@ void scanWithInvPredicate(const String& input)
// collectUntil doesn't move the scan position.
EXPECT_FALSE(scanner.isAtEnd());
// Consume "BING".
- scanner.skipRun(ucRun);
+ scanner.skipUntil<lowerCaseAlpha>();
EXPECT_TRUE(scanner.isAt(ucRun.end()));
EXPECT_TRUE(scanner.isAtEnd());
}
-// Tests collectUntil().
+// Tests skipUntil() and collectUntil().
TEST(VTTScanner, InversePredicateScanning)
{
TEST_WITH(scanWithInvPredicate, "BADaBING");
@@ -197,6 +197,12 @@ void scanRuns(const String& input)
EXPECT_TRUE(scanner.match(':'));
EXPECT_TRUE(scanner.scan(':'));
+ // Skip 'baz'.
+ scanner.skipRun(scanner.collectWhile<lowerCaseAlpha>());
+
+ EXPECT_TRUE(scanner.match(':'));
+ EXPECT_TRUE(scanner.scan(':'));
+
word = scanner.collectWhile<lowerCaseAlpha>();
EXPECT_FALSE(scanner.scanRun(word, fooString));
EXPECT_TRUE(scanner.scanRun(word, barString));
@@ -206,7 +212,7 @@ void scanRuns(const String& input)
// Tests scanRun/skipRun.
TEST(VTTScanner, RunScanning)
{
- TEST_WITH(scanRuns, "foo:bar");
+ TEST_WITH(scanRuns, "foo:baz:bar");
}
void scanRunsToStrings(const String& input)
« no previous file with comments | « Source/core/html/track/vtt/VTTScanner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698