Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Side by Side Diff: Source/core/animation/VisibilityStyleInterpolationTest.cpp

Issue 1265853003: CSSValue Immediates: Immediates from all CSSPrimitiveValue constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@tagged_ptrs_base
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698