| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013, Google Inc. All rights reserved. | 2 * Copyright 2013, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "core/css/parser/CSSParserValues.h" | 32 #include "core/css/parser/CSSParserValues.h" |
| 33 | 33 |
| 34 #include "core/css/parser/CSSParserTokenRange.h" | 34 #include "core/css/parser/CSSParserTokenRange.h" |
| 35 #include "core/css/parser/CSSTokenizer.h" | 35 #include "core/css/parser/CSSTokenizer.h" |
| 36 #include <gtest/gtest.h> | 36 #include <gtest/gtest.h> |
| 37 | 37 |
| 38 using namespace blink; | 38 namespace blink { |
| 39 | |
| 40 namespace { | |
| 41 | 39 |
| 42 TEST(CSSParserValuesTest, InitWithEmptyString) | 40 TEST(CSSParserValuesTest, InitWithEmptyString) |
| 43 { | 41 { |
| 44 String string; | 42 String string; |
| 45 | 43 |
| 46 CSSParserString cssParserString; | 44 CSSParserString cssParserString; |
| 47 cssParserString.init(string); | 45 cssParserString.init(string); |
| 48 EXPECT_EQ(0u, cssParserString.length()); | 46 EXPECT_EQ(0u, cssParserString.length()); |
| 49 EXPECT_EQ(string, String(cssParserString)); | 47 EXPECT_EQ(string, String(cssParserString)); |
| 50 EXPECT_TRUE(String(cssParserString).isNull()); | 48 EXPECT_TRUE(String(cssParserString).isNull()); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 ASSERT_EQ(valueList.valueAt(0)->unit, CSSPrimitiveValue::CSS_URI); | 110 ASSERT_EQ(valueList.valueAt(0)->unit, CSSPrimitiveValue::CSS_URI); |
| 113 EXPECT_EQ(String(valueList.valueAt(0)->string), "some"); | 111 EXPECT_EQ(String(valueList.valueAt(0)->string), "some"); |
| 114 ASSERT_EQ(valueList.valueAt(1)->unit, CSSPrimitiveValue::CSS_URI); | 112 ASSERT_EQ(valueList.valueAt(1)->unit, CSSPrimitiveValue::CSS_URI); |
| 115 EXPECT_EQ(String(valueList.valueAt(1)->string), "test"); | 113 EXPECT_EQ(String(valueList.valueAt(1)->string), "test"); |
| 116 ASSERT_EQ(valueList.valueAt(2)->unit, CSSPrimitiveValue::CSS_URI); | 114 ASSERT_EQ(valueList.valueAt(2)->unit, CSSPrimitiveValue::CSS_URI); |
| 117 EXPECT_EQ(String(valueList.valueAt(2)->string), "words"); | 115 EXPECT_EQ(String(valueList.valueAt(2)->string), "words"); |
| 118 ASSERT_EQ(valueList.valueAt(3)->unit, CSSPrimitiveValue::CSS_URI); | 116 ASSERT_EQ(valueList.valueAt(3)->unit, CSSPrimitiveValue::CSS_URI); |
| 119 EXPECT_EQ(String(valueList.valueAt(3)->string), "/**/hi/**/"); | 117 EXPECT_EQ(String(valueList.valueAt(3)->string), "/**/hi/**/"); |
| 120 } | 118 } |
| 121 | 119 |
| 122 } // namespace | 120 } // namespace blink |
| OLD | NEW |