| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/css/MediaList.h" | 5 #include "core/css/MediaList.h" |
| 6 #include "core/css/MediaQuery.h" | 6 #include "core/css/MediaQuery.h" |
| 7 #include "core/css/parser/CSSTokenizer.h" | 7 #include "core/css/parser/CSSTokenizer.h" |
| 8 #include "core/css/parser/MediaQueryParser.h" | 8 #include "core/css/parser/MediaQueryParser.h" |
| 9 #include "platform/wtf/text/StringBuilder.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "wtf/text/StringBuilder.h" | |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 typedef struct { | 14 typedef struct { |
| 15 const char* input; | 15 const char* input; |
| 16 const char* output; | 16 const char* output; |
| 17 } TestCase; | 17 } TestCase; |
| 18 | 18 |
| 19 TEST(MediaConditionParserTest, Basic) { | 19 TEST(MediaConditionParserTest, Basic) { |
| 20 // The first string represents the input string. | 20 // The first string represents the input string. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 40 CSSTokenizer tokenizer(test_cases[i].input); | 40 CSSTokenizer tokenizer(test_cases[i].input); |
| 41 MediaQuerySet* media_condition_query_set = | 41 MediaQuerySet* media_condition_query_set = |
| 42 MediaQueryParser::ParseMediaCondition(tokenizer.TokenRange()); | 42 MediaQueryParser::ParseMediaCondition(tokenizer.TokenRange()); |
| 43 ASSERT_EQ(media_condition_query_set->QueryVector().size(), (unsigned)1); | 43 ASSERT_EQ(media_condition_query_set->QueryVector().size(), (unsigned)1); |
| 44 String query_text = media_condition_query_set->QueryVector()[0]->CssText(); | 44 String query_text = media_condition_query_set->QueryVector()[0]->CssText(); |
| 45 ASSERT_STREQ(test_cases[i].output, query_text.Ascii().Data()); | 45 ASSERT_STREQ(test_cases[i].output, query_text.Ascii().Data()); |
| 46 } | 46 } |
| 47 } | 47 } |
| 48 | 48 |
| 49 } // namespace blink | 49 } // namespace blink |
| OLD | NEW |