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

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

Issue 1226123008: CSSValue Immediates: Replace CSSPrimitiveValue usage with const references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cssvalue_patch_4_attempt_2
Patch Set: Rebase 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 // 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/DoubleStyleInterpolation.h" 6 #include "core/animation/DoubleStyleInterpolation.h"
7 7
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"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 static void testValueListMotionRotation(CSSValue value, double doubleValue, bool flag) 56 static void testValueListMotionRotation(CSSValue value, double doubleValue, bool flag)
57 { 57 {
58 EXPECT_TRUE(value.isValueList()); 58 EXPECT_TRUE(value.isValueList());
59 const CSSValueList& list = toCSSValueList(value); 59 const CSSValueList& list = toCSSValueList(value);
60 NullableCSSValue item; 60 NullableCSSValue item;
61 if (flag) { 61 if (flag) {
62 EXPECT_EQ(2U, list.length()); 62 EXPECT_EQ(2U, list.length());
63 item = list.item(0); 63 item = list.item(0);
64 EXPECT_TRUE(item->isPrimitiveValue()); 64 EXPECT_TRUE(item->isPrimitiveValue());
65 EXPECT_EQ(CSSValueAuto, toCSSPrimitiveValue(*item).getValueID()); 65 EXPECT_EQ(CSSValueAuto, toCSSPrimitiveValue(item).getValueID());
66 item = list.item(1); 66 item = list.item(1);
67 } else { 67 } else {
68 EXPECT_EQ(1U, list.length()); 68 EXPECT_EQ(1U, list.length());
69 item = list.item(0); 69 item = list.item(0);
70 } 70 }
71 EXPECT_TRUE(item->isPrimitiveValue()); 71 EXPECT_TRUE(item->isPrimitiveValue());
72 EXPECT_EQ(doubleValue, toCSSPrimitiveValue(*item).getDoubleValue()); 72 EXPECT_EQ(doubleValue, toCSSPrimitiveValue(item).getDoubleValue());
73 EXPECT_EQ(CSSPrimitiveValue::CSS_DEG, toCSSPrimitiveValue(*item).primiti veType()); 73 EXPECT_EQ(CSSPrimitiveValue::CSS_DEG, toCSSPrimitiveValue(item).primitiv eType());
74 } 74 }
75 75
76 static InterpolableValue* getCachedValue(Interpolation& interpolation) 76 static InterpolableValue* getCachedValue(Interpolation& interpolation)
77 { 77 {
78 return interpolation.getCachedValueForTesting(); 78 return interpolation.getCachedValueForTesting();
79 } 79 }
80 }; 80 };
81 81
82 TEST_F(AnimationDoubleStyleInterpolationTest, ZeroValue) 82 TEST_F(AnimationDoubleStyleInterpolationTest, ZeroValue)
83 { 83 {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 TEST_F(AnimationDoubleStyleInterpolationTest, ValueAutoMotionRotation) 138 TEST_F(AnimationDoubleStyleInterpolationTest, ValueAutoMotionRotation)
139 { 139 {
140 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated() ; 140 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated() ;
141 list->append(CSSPrimitiveValue::createIdentifier(CSSValueAuto)); 141 list->append(CSSPrimitiveValue::createIdentifier(CSSValueAuto));
142 list->append(CSSPrimitiveValue::create(90, CSSPrimitiveValue::CSS_DEG)); 142 list->append(CSSPrimitiveValue::create(90, CSSPrimitiveValue::CSS_DEG));
143 CSSValue value = roundTripMotionRotation(list.release(), true); 143 CSSValue value = roundTripMotionRotation(list.release(), true);
144 testValueListMotionRotation(value, 90, true); 144 testValueListMotionRotation(value, 90, true);
145 } 145 }
146 146
147 } 147 }
OLDNEW
« no previous file with comments | « Source/core/animation/DoubleStyleInterpolation.cpp ('k') | Source/core/animation/LengthBoxStyleInterpolation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698