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/LengthBoxStyleInterpolation.h" | 6 #include "core/animation/LengthBoxStyleInterpolation.h" |
7 | 7 |
8 #include "core/animation/LengthStyleInterpolation.h" | 8 #include "core/animation/LengthStyleInterpolation.h" |
9 #include "core/css/CSSPrimitiveValue.h" | 9 #include "core/css/CSSPrimitiveValue.h" |
10 #include "core/css/CSSQuadValue.h" | 10 #include "core/css/CSSQuadValue.h" |
11 #include "core/css/StylePropertySet.h" | 11 #include "core/css/StylePropertySet.h" |
12 | 12 |
13 #include <gtest/gtest.h> | 13 #include <gtest/gtest.h> |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 | 16 |
17 class AnimationLengthBoxStyleInterpolationTest : public ::testing::Test { | 17 class AnimationLengthBoxStyleInterpolationTest : public ::testing::Test { |
18 protected: | 18 protected: |
19 static PassOwnPtrWillBeRawPtr<InterpolableValue> lengthBoxToInterpolableValu
e(const CSSValue& value) | 19 static PassOwnPtr<InterpolableValue> lengthBoxToInterpolableValue(const CSSV
alue& value) |
20 { | 20 { |
21 return LengthBoxStyleInterpolation::lengthBoxtoInterpolableValue(value,
value, false); | 21 return LengthBoxStyleInterpolation::lengthBoxtoInterpolableValue(value,
value, false); |
22 } | 22 } |
23 | 23 |
24 static PassRefPtrWillBeRawPtr<CSSValue> interpolableValueToLengthBox(Interpo
lableValue* value, const CSSValue& start, const CSSValue& end) | 24 static PassRefPtrWillBeRawPtr<CSSValue> interpolableValueToLengthBox(Interpo
lableValue* value, const CSSValue& start, const CSSValue& end) |
25 { | 25 { |
26 return LengthBoxStyleInterpolation::interpolableValueToLengthBox(value,
start, end); | 26 return LengthBoxStyleInterpolation::interpolableValueToLengthBox(value,
start, end); |
27 } | 27 } |
28 | 28 |
29 static PassRefPtrWillBeRawPtr<CSSValue> roundTrip(PassRefPtrWillBeRawPtr<CSS
Value> value) | 29 static PassRefPtrWillBeRawPtr<CSSValue> roundTrip(PassRefPtrWillBeRawPtr<CSS
Value> value) |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 RefPtrWillBeRawPtr<CSSPrimitiveValue> leftPer = CSSPrimitiveValue::create(30
, CSSPrimitiveValue::UnitType::Percentage); | 106 RefPtrWillBeRawPtr<CSSPrimitiveValue> leftPer = CSSPrimitiveValue::create(30
, CSSPrimitiveValue::UnitType::Percentage); |
107 RefPtrWillBeRawPtr<CSSPrimitiveValue> rightPer = CSSPrimitiveValue::create(-
30, CSSPrimitiveValue::UnitType::Percentage); | 107 RefPtrWillBeRawPtr<CSSPrimitiveValue> rightPer = CSSPrimitiveValue::create(-
30, CSSPrimitiveValue::UnitType::Percentage); |
108 RefPtrWillBeRawPtr<CSSPrimitiveValue> topPer = CSSPrimitiveValue::create(30,
CSSPrimitiveValue::UnitType::Percentage); | 108 RefPtrWillBeRawPtr<CSSPrimitiveValue> topPer = CSSPrimitiveValue::create(30,
CSSPrimitiveValue::UnitType::Percentage); |
109 RefPtrWillBeRawPtr<CSSPrimitiveValue> bottomPer = CSSPrimitiveValue::create(
-30, CSSPrimitiveValue::UnitType::Percentage); | 109 RefPtrWillBeRawPtr<CSSPrimitiveValue> bottomPer = CSSPrimitiveValue::create(
-30, CSSPrimitiveValue::UnitType::Percentage); |
110 | 110 |
111 value = roundTrip(CSSQuadValue::create(topPer.release(), rightPer.release(),
bottomPer.release(), leftPer.release(), CSSQuadValue::SerializeAsRect)); | 111 value = roundTrip(CSSQuadValue::create(topPer.release(), rightPer.release(),
bottomPer.release(), leftPer.release(), CSSQuadValue::SerializeAsRect)); |
112 testQuadValue(value, 30, -30, 30, -30, CSSPrimitiveValue::UnitType::Percenta
ge); | 112 testQuadValue(value, 30, -30, 30, -30, CSSPrimitiveValue::UnitType::Percenta
ge); |
113 } | 113 } |
114 | 114 |
115 } | 115 } |
OLD | NEW |