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/animation/DeferredLegacyStyleInterpolation.h" | 5 #include "core/animation/DeferredLegacyStyleInterpolation.h" |
6 | 6 |
7 #include "core/css/CSSInheritedValue.h" | 7 #include "core/css/CSSInheritedValue.h" |
8 #include "core/css/CSSPrimitiveValue.h" | 8 #include "core/css/CSSPrimitiveValue.h" |
9 #include "core/css/CSSValueList.h" | 9 #include "core/css/CSSValueList.h" |
10 #include "core/css/StylePropertySet.h" | 10 #include "core/css/StylePropertySet.h" |
11 #include "core/css/parser/CSSParser.h" | 11 #include "core/css/parser/CSSParser.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 class AnimationDeferredLegacyStyleInterpolationTest : public ::testing::Test { | 16 class AnimationDeferredLegacyStyleInterpolationTest : public ::testing::Test { |
17 protected: | 17 protected: |
18 static bool test(CSSPropertyID propertyID, const String& string) | 18 static bool test(CSSPropertyID propertyID, const String& string) |
19 { | 19 { |
20 CSSParserMode parserMode = HTMLStandardMode; | 20 CSSParserMode parserMode = HTMLStandardMode; |
21 if (propertyID == CSSPropertyFloodColor) | 21 if (propertyID == CSSPropertyFloodColor) |
22 parserMode = SVGAttributeMode; | 22 parserMode = SVGAttributeMode; |
23 CSSValue* value = CSSParser::parseSingleValue(propertyID, string, CSSPar
serContext(parserMode, 0)); | 23 CSSValue* value = CSSParser::parseSingleValue(propertyID, string, CSSPar
serContext(parserMode, nullptr)); |
24 ASSERT(value); | 24 ASSERT(value); |
25 return DeferredLegacyStyleInterpolation::interpolationRequiresStyleResol
ve(*value); | 25 return DeferredLegacyStyleInterpolation::interpolationRequiresStyleResol
ve(*value); |
26 } | 26 } |
27 }; | 27 }; |
28 | 28 |
29 TEST_F(AnimationDeferredLegacyStyleInterpolationTest, Inherit) | 29 TEST_F(AnimationDeferredLegacyStyleInterpolationTest, Inherit) |
30 { | 30 { |
31 EXPECT_TRUE(test(CSSPropertyCaptionSide, "inherit")); | 31 EXPECT_TRUE(test(CSSPropertyCaptionSide, "inherit")); |
32 } | 32 } |
33 | 33 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 EXPECT_TRUE(test(CSSPropertyBackdropFilter, "drop-shadow(20px 10vw green)"))
; | 98 EXPECT_TRUE(test(CSSPropertyBackdropFilter, "drop-shadow(20px 10vw green)"))
; |
99 EXPECT_TRUE(test(CSSPropertyBackdropFilter, "drop-shadow(0px 0px 0px current
color)")); | 99 EXPECT_TRUE(test(CSSPropertyBackdropFilter, "drop-shadow(0px 0px 0px current
color)")); |
100 EXPECT_FALSE(test(CSSPropertyBackdropFilter, "opacity(1)")); | 100 EXPECT_FALSE(test(CSSPropertyBackdropFilter, "opacity(1)")); |
101 EXPECT_FALSE(test(CSSPropertyBackdropFilter, "saturate(0)")); | 101 EXPECT_FALSE(test(CSSPropertyBackdropFilter, "saturate(0)")); |
102 EXPECT_FALSE(test(CSSPropertyBackdropFilter, "grayscale(1)")); | 102 EXPECT_FALSE(test(CSSPropertyBackdropFilter, "grayscale(1)")); |
103 EXPECT_FALSE(test(CSSPropertyBackdropFilter, "invert(1)")); | 103 EXPECT_FALSE(test(CSSPropertyBackdropFilter, "invert(1)")); |
104 EXPECT_FALSE(test(CSSPropertyBackdropFilter, "sepia(1)")); | 104 EXPECT_FALSE(test(CSSPropertyBackdropFilter, "sepia(1)")); |
105 EXPECT_TRUE(test(CSSPropertyBackdropFilter, "url(#svgfilter)")); | 105 EXPECT_TRUE(test(CSSPropertyBackdropFilter, "url(#svgfilter)")); |
106 } | 106 } |
107 } // namespace blink | 107 } // namespace blink |
OLD | NEW |