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

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

Issue 171383002: A thread-safe Media Query Parser (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Moar rebase Created 6 years, 9 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
Index: Source/core/css/parser/MediaQueryTokenizerTest.cpp
diff --git a/Source/core/css/parser/MediaQueryTokenizerTest.cpp b/Source/core/css/parser/MediaQueryTokenizerTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..1138de99d588e8eaf21d6f7619b6a65d80fe3d51
--- /dev/null
+++ b/Source/core/css/parser/MediaQueryTokenizerTest.cpp
@@ -0,0 +1,27 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "core/css/parser/MediaQueryTokenizer.h"
+
+#include "wtf/PassOwnPtr.h"
+#include <gtest/gtest.h>
+
+namespace WebCore {
+
+typedef pair<String, MediaQueryTokenType* > TestCase;
+TEST(MediaQueryTokenizerTest, Basic)
+{
+ Vector<TestCase> testcases;
+ MediaQueryTokenType tokenTypeArr[] = {LeftParenthesisToken, IdentToken, ColonToken, WhitespaceToken, PercentageToken, RightParenthesisToken, EOFToken };
+ TestCase testCase1("(max-width: 50%)", (MediaQueryTokenType*)&tokenTypeArr);
+ testcases.append(testCase1);
+ Vector<MediaQueryToken> tokens;
+ MediaQueryTokenizer::tokenize(testcases[0].first, tokens);
+ for (size_t i = 0; i < tokens.size(); i++) {
+ ASSERT_EQ(testcases[0].second[i], tokens[i].type());
+ }
+}
+
+} // namespace
« Source/core/css/CSSPrimitiveValue.cpp ('K') | « Source/core/css/parser/MediaQueryTokenizer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698