| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/animation/DeferredLegacyStyleInterpolation.h" | 6 #include "core/animation/DeferredLegacyStyleInterpolation.h" |
| 7 | 7 |
| 8 #include "core/css/CSSInheritedValue.h" | 8 #include "core/css/CSSInheritedValue.h" |
| 9 #include "core/css/CSSPrimitiveValue.h" | 9 #include "core/css/CSSPrimitiveValue.h" |
| 10 #include "core/css/CSSValueList.h" | 10 #include "core/css/CSSValueList.h" |
| 11 #include "core/css/StylePropertySet.h" | 11 #include "core/css/StylePropertySet.h" |
| 12 #include "core/css/parser/BisonCSSParser.h" | 12 #include "core/css/parser/CSSParser.h" |
| 13 | 13 |
| 14 #include <gtest/gtest.h> | 14 #include <gtest/gtest.h> |
| 15 | 15 |
| 16 namespace blink { | 16 namespace blink { |
| 17 | 17 |
| 18 class AnimationDeferredLegacyStyleInterpolationTest : public ::testing::Test { | 18 class AnimationDeferredLegacyStyleInterpolationTest : public ::testing::Test { |
| 19 protected: | 19 protected: |
| 20 static bool test(CSSPropertyID propertyID, const String& string) | 20 static bool test(CSSPropertyID propertyID, const String& string) |
| 21 { | 21 { |
| 22 CSSParserMode parserMode = HTMLStandardMode; | 22 CSSParserMode parserMode = HTMLStandardMode; |
| 23 if (propertyID == CSSPropertyFloodColor) | 23 if (propertyID == CSSPropertyFloodColor) |
| 24 parserMode = SVGAttributeMode; | 24 parserMode = SVGAttributeMode; |
| 25 RefPtrWillBeRawPtr<MutableStylePropertySet> dummyStyle = MutableStylePro
pertySet::create(); | 25 RefPtrWillBeRawPtr<MutableStylePropertySet> dummyStyle = MutableStylePro
pertySet::create(); |
| 26 bool parseSuccess = BisonCSSParser::parseValue(dummyStyle.get(), propert
yID, string, false, parserMode, 0); | 26 bool parseSuccess = CSSParser::parseValue(dummyStyle.get(), propertyID,
string, false, parserMode, 0); |
| 27 ASSERT_UNUSED(parseSuccess, parseSuccess); | 27 ASSERT_UNUSED(parseSuccess, parseSuccess); |
| 28 return DeferredLegacyStyleInterpolation::interpolationRequiresStyleResol
ve(*dummyStyle->getPropertyCSSValue(propertyID)); | 28 return DeferredLegacyStyleInterpolation::interpolationRequiresStyleResol
ve(*dummyStyle->getPropertyCSSValue(propertyID)); |
| 29 } | 29 } |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 TEST_F(AnimationDeferredLegacyStyleInterpolationTest, Inherit) | 32 TEST_F(AnimationDeferredLegacyStyleInterpolationTest, Inherit) |
| 33 { | 33 { |
| 34 EXPECT_TRUE(test(CSSPropertyCaptionSide, "inherit")); | 34 EXPECT_TRUE(test(CSSPropertyCaptionSide, "inherit")); |
| 35 } | 35 } |
| 36 | 36 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 EXPECT_TRUE(test(CSSPropertyWebkitFilter, "drop-shadow(0px 0px 0px currentco
lor)")); | 85 EXPECT_TRUE(test(CSSPropertyWebkitFilter, "drop-shadow(0px 0px 0px currentco
lor)")); |
| 86 EXPECT_FALSE(test(CSSPropertyWebkitFilter, "opacity(1)")); | 86 EXPECT_FALSE(test(CSSPropertyWebkitFilter, "opacity(1)")); |
| 87 EXPECT_FALSE(test(CSSPropertyWebkitFilter, "saturate(0)")); | 87 EXPECT_FALSE(test(CSSPropertyWebkitFilter, "saturate(0)")); |
| 88 EXPECT_FALSE(test(CSSPropertyWebkitFilter, "grayscale(1)")); | 88 EXPECT_FALSE(test(CSSPropertyWebkitFilter, "grayscale(1)")); |
| 89 EXPECT_FALSE(test(CSSPropertyWebkitFilter, "invert(1)")); | 89 EXPECT_FALSE(test(CSSPropertyWebkitFilter, "invert(1)")); |
| 90 EXPECT_FALSE(test(CSSPropertyWebkitFilter, "sepia(1)")); | 90 EXPECT_FALSE(test(CSSPropertyWebkitFilter, "sepia(1)")); |
| 91 EXPECT_TRUE(test(CSSPropertyWebkitFilter, "url(#svgfilter)")); | 91 EXPECT_TRUE(test(CSSPropertyWebkitFilter, "url(#svgfilter)")); |
| 92 } | 92 } |
| 93 | 93 |
| 94 } | 94 } |
| OLD | NEW |