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/TransformStyleInterpolation.h" | 6 #include "core/animation/TransformStyleInterpolation.h" |
7 | 7 |
8 #include "core/css/CSSPrimitiveValue.h" | 8 #include "core/css/CSSPrimitiveValue.h" |
9 #include "core/css/CSSTransformValue.h" | 9 #include "core/css/CSSTransformValue.h" |
10 #include "core/css/resolver/StyleBuilder.h" | 10 #include "core/css/resolver/StyleBuilder.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 EXPECT_TRUE(transform->item(i)->isPrimitiveValue()); | 44 EXPECT_TRUE(transform->item(i)->isPrimitiveValue()); |
45 EXPECT_EQ(toCSSPrimitiveValue(transform->item(i))->getDoubleValu
e(), expectedValue); | 45 EXPECT_EQ(toCSSPrimitiveValue(transform->item(i))->getDoubleValu
e(), expectedValue); |
46 EXPECT_EQ(toCSSPrimitiveValue(transform->item(i))->primitiveType
(), units[j]); | 46 EXPECT_EQ(toCSSPrimitiveValue(transform->item(i))->primitiveType
(), units[j]); |
47 } | 47 } |
48 } | 48 } |
49 } | 49 } |
50 }; | 50 }; |
51 | 51 |
52 TEST_F(AnimationTransformStyleInterpolationTest, ZeroTransform) | 52 TEST_F(AnimationTransformStyleInterpolationTest, ZeroTransform) |
53 { | 53 { |
54 RefPtr<CSSValueList> result = CSSValueList::createSpaceSeparated(); | 54 RefPtrWillBeRawPtr<CSSValueList> result = CSSValueList::createSpaceSeparated
(); |
55 | 55 |
56 RefPtrWillBeRawPtr<CSSTransformValue> transform = CSSTransformValue::create(
CSSTransformValue::PerspectiveTransformOperation); | 56 RefPtrWillBeRawPtr<CSSTransformValue> transform = CSSTransformValue::create(
CSSTransformValue::PerspectiveTransformOperation); |
57 transform->append(CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_PX)); | 57 transform->append(CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_PX)); |
58 result->append(transform); | 58 result->append(transform); |
59 transform = CSSTransformValue::create(CSSTransformValue::TranslateTransformO
peration); | 59 transform = CSSTransformValue::create(CSSTransformValue::TranslateTransformO
peration); |
60 transform->append(CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_PX)); | 60 transform->append(CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_PX)); |
61 transform->append(CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_PX)); | 61 transform->append(CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_PX)); |
62 transform->append(CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_PX)); | 62 transform->append(CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_PX)); |
63 result->append(transform); | 63 result->append(transform); |
64 transform = CSSTransformValue::create(CSSTransformValue::TranslateXTransform
Operation); | 64 transform = CSSTransformValue::create(CSSTransformValue::TranslateXTransform
Operation); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 units[16] = CSSPrimitiveValue::CSS_NUMBER; | 172 units[16] = CSSPrimitiveValue::CSS_NUMBER; |
173 units[17] = CSSPrimitiveValue::CSS_DEG; | 173 units[17] = CSSPrimitiveValue::CSS_DEG; |
174 units[18] = CSSPrimitiveValue::CSS_NUMBER; | 174 units[18] = CSSPrimitiveValue::CSS_NUMBER; |
175 | 175 |
176 RefPtrWillBeRawPtr<CSSValue> value = roundTrip(*result, types); | 176 RefPtrWillBeRawPtr<CSSValue> value = roundTrip(*result, types); |
177 testPrimitiveValue(value, 0, units); | 177 testPrimitiveValue(value, 0, units); |
178 } | 178 } |
179 | 179 |
180 TEST_F(AnimationTransformStyleInterpolationTest, SingleUnitTransform) | 180 TEST_F(AnimationTransformStyleInterpolationTest, SingleUnitTransform) |
181 { | 181 { |
182 RefPtr<CSSValueList> result = CSSValueList::createSpaceSeparated(); | 182 RefPtrWillBeRawPtr<CSSValueList> result = CSSValueList::createSpaceSeparated
(); |
183 | 183 |
184 RefPtrWillBeRawPtr<CSSTransformValue> transform = CSSTransformValue::create(
CSSTransformValue::PerspectiveTransformOperation); | 184 RefPtrWillBeRawPtr<CSSTransformValue> transform = CSSTransformValue::create(
CSSTransformValue::PerspectiveTransformOperation); |
185 transform->append(CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_PX)); | 185 transform->append(CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_PX)); |
186 result->append(transform); | 186 result->append(transform); |
187 transform = CSSTransformValue::create(CSSTransformValue::TranslateTransformO
peration); | 187 transform = CSSTransformValue::create(CSSTransformValue::TranslateTransformO
peration); |
188 transform->append(CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_PX)); | 188 transform->append(CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_PX)); |
189 transform->append(CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_PX)); | 189 transform->append(CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_PX)); |
190 transform->append(CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_PX)); | 190 transform->append(CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_PX)); |
191 result->append(transform); | 191 result->append(transform); |
192 transform = CSSTransformValue::create(CSSTransformValue::TranslateXTransform
Operation); | 192 transform = CSSTransformValue::create(CSSTransformValue::TranslateXTransform
Operation); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 units[15] = CSSPrimitiveValue::CSS_NUMBER; | 299 units[15] = CSSPrimitiveValue::CSS_NUMBER; |
300 units[16] = CSSPrimitiveValue::CSS_NUMBER; | 300 units[16] = CSSPrimitiveValue::CSS_NUMBER; |
301 units[17] = CSSPrimitiveValue::CSS_DEG; | 301 units[17] = CSSPrimitiveValue::CSS_DEG; |
302 units[18] = CSSPrimitiveValue::CSS_NUMBER; | 302 units[18] = CSSPrimitiveValue::CSS_NUMBER; |
303 | 303 |
304 RefPtrWillBeRawPtr<CSSValue> value = roundTrip(*result, types); | 304 RefPtrWillBeRawPtr<CSSValue> value = roundTrip(*result, types); |
305 testPrimitiveValue(value, 10, units); | 305 testPrimitiveValue(value, 10, units); |
306 } | 306 } |
307 | 307 |
308 } | 308 } |
OLD | NEW |