OLD | NEW |
| (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 | |
OLD | NEW |