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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "core/css/parser/MediaQueryTokenizer.h"
7
8 #include "wtf/PassOwnPtr.h"
9 #include <gtest/gtest.h>
10
11 namespace WebCore {
12
13 typedef pair<String, MediaQueryTokenType* > TestCase;
14 TEST(MediaQueryTokenizerTest, Basic)
15 {
16 Vector<TestCase> testcases;
17 MediaQueryTokenType tokenTypeArr[] = {LeftParenthesisToken, IdentToken, Colo nToken, WhitespaceToken, PercentageToken, RightParenthesisToken, EOFToken };
18 TestCase testCase1("(max-width: 50%)", (MediaQueryTokenType*)&tokenTypeArr);
19 testcases.append(testCase1);
20 Vector<MediaQueryToken> tokens;
21 MediaQueryTokenizer::tokenize(testcases[0].first, tokens);
22 for (size_t i = 0; i < tokens.size(); i++) {
23 ASSERT_EQ(testcases[0].second[i], tokens[i].type());
24 }
25 }
26
27 } // namespace
OLDNEW
« 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