| OLD | NEW |
| 1 #include "config.h" | 1 #include "config.h" |
| 2 #include "core/animation/VisibilityStyleInterpolation.h" | 2 #include "core/animation/VisibilityStyleInterpolation.h" |
| 3 | 3 |
| 4 #include "core/css/CSSPrimitiveValue.h" | 4 #include "core/css/CSSPrimitiveValue.h" |
| 5 #include "core/css/StylePropertySet.h" | 5 #include "core/css/StylePropertySet.h" |
| 6 | 6 |
| 7 #include <gtest/gtest.h> | 7 #include <gtest/gtest.h> |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 } | 32 } |
| 33 | 33 |
| 34 static InterpolableValue* getCachedValue(Interpolation& interpolation) | 34 static InterpolableValue* getCachedValue(Interpolation& interpolation) |
| 35 { | 35 { |
| 36 return interpolation.getCachedValueForTesting(); | 36 return interpolation.getCachedValueForTesting(); |
| 37 } | 37 } |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 TEST_F(AnimationVisibilityStyleInterpolationTest, ValueIDs) | 40 TEST_F(AnimationVisibilityStyleInterpolationTest, ValueIDs) |
| 41 { | 41 { |
| 42 RefPtrWillBeRawPtr<CSSValue> value = roundTrip(CSSPrimitiveValue::createIden
tifier(CSSValueVisible), CSSValueHidden); | 42 RefPtrWillBeRawPtr<CSSValue> value = roundTrip(CSSPrimitiveValue::create(CSS
ValueVisible), CSSValueHidden); |
| 43 testPrimitiveValue(value, CSSValueVisible); | 43 testPrimitiveValue(value, CSSValueVisible); |
| 44 | 44 |
| 45 value = roundTrip(CSSPrimitiveValue::createIdentifier(CSSValueCollapse), CSS
ValueCollapse); | 45 value = roundTrip(CSSPrimitiveValue::create(CSSValueCollapse), CSSValueColla
pse); |
| 46 testPrimitiveValue(value, CSSValueCollapse); | 46 testPrimitiveValue(value, CSSValueCollapse); |
| 47 | 47 |
| 48 value = roundTrip(CSSPrimitiveValue::createIdentifier(CSSValueHidden), CSSVa
lueHidden); | 48 value = roundTrip(CSSPrimitiveValue::create(CSSValueHidden), CSSValueHidden)
; |
| 49 testPrimitiveValue(value, CSSValueHidden); | 49 testPrimitiveValue(value, CSSValueHidden); |
| 50 } | 50 } |
| 51 | 51 |
| 52 TEST_F(AnimationVisibilityStyleInterpolationTest, Interpolation) | 52 TEST_F(AnimationVisibilityStyleInterpolationTest, Interpolation) |
| 53 { | 53 { |
| 54 RefPtrWillBeRawPtr<Interpolation> interpolation = VisibilityStyleInterpolati
on::create( | 54 RefPtrWillBeRawPtr<Interpolation> interpolation = VisibilityStyleInterpolati
on::create( |
| 55 *CSSPrimitiveValue::createIdentifier(CSSValueHidden), | 55 *CSSPrimitiveValue::create(CSSValueHidden), |
| 56 *CSSPrimitiveValue::createIdentifier(CSSValueVisible), | 56 *CSSPrimitiveValue::create(CSSValueVisible), |
| 57 CSSPropertyVisibility); | 57 CSSPropertyVisibility); |
| 58 | 58 |
| 59 interpolation->interpolate(0, 0.0); | 59 interpolation->interpolate(0, 0.0); |
| 60 RefPtrWillBeRawPtr<CSSValue> value = interpolableValueToVisibility(getCached
Value(*interpolation), CSSValueHidden); | 60 RefPtrWillBeRawPtr<CSSValue> value = interpolableValueToVisibility(getCached
Value(*interpolation), CSSValueHidden); |
| 61 testPrimitiveValue(value, CSSValueHidden); | 61 testPrimitiveValue(value, CSSValueHidden); |
| 62 | 62 |
| 63 interpolation->interpolate(0, 0.5); | 63 interpolation->interpolate(0, 0.5); |
| 64 value = interpolableValueToVisibility(getCachedValue(*interpolation), CSSVal
ueHidden); | 64 value = interpolableValueToVisibility(getCachedValue(*interpolation), CSSVal
ueHidden); |
| 65 testPrimitiveValue(value, CSSValueVisible); | 65 testPrimitiveValue(value, CSSValueVisible); |
| 66 } | 66 } |
| 67 } | 67 } |
| OLD | NEW |