| 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/Rect.h" | 10 #include "core/css/Rect.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 RefPtrWillBeRawPtr<CSSValue> value = roundTrip(CSSPrimitiveValue::create(rec
tPx.release())); | 58 RefPtrWillBeRawPtr<CSSValue> value = roundTrip(CSSPrimitiveValue::create(rec
tPx.release())); |
| 59 testPrimitiveValue(value, 0, 0, 0, 0, CSSPrimitiveValue::CSS_PX); | 59 testPrimitiveValue(value, 0, 0, 0, 0, CSSPrimitiveValue::CSS_PX); |
| 60 | 60 |
| 61 RefPtrWillBeRawPtr<Rect> rectEms = Rect::create(); | 61 RefPtrWillBeRawPtr<Rect> rectEms = Rect::create(); |
| 62 rectEms->setLeft(CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_EMS)); | 62 rectEms->setLeft(CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_EMS)); |
| 63 rectEms->setRight(CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_EMS)); | 63 rectEms->setRight(CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_EMS)); |
| 64 rectEms->setTop(CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_EMS)); | 64 rectEms->setTop(CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_EMS)); |
| 65 rectEms->setBottom(CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_EMS))
; | 65 rectEms->setBottom(CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_EMS))
; |
| 66 | 66 |
| 67 value = roundTrip(CSSPrimitiveValue::create(rectEms.release())); | 67 value = roundTrip(CSSPrimitiveValue::create(rectEms.release())); |
| 68 testPrimitiveValue(value, 0, 0, 0, 0, CSSPrimitiveValue::CSS_PX); | 68 testPrimitiveValue(value, 0, 0, 0, 0, CSSPrimitiveValue::CSS_EMS); |
| 69 } | 69 } |
| 70 | 70 |
| 71 TEST_F(AnimationLengthBoxStyleInterpolationTest, SingleUnitBox) | 71 TEST_F(AnimationLengthBoxStyleInterpolationTest, SingleUnitBox) |
| 72 { | 72 { |
| 73 RefPtrWillBeRawPtr<Rect> rectPx = Rect::create(); | 73 RefPtrWillBeRawPtr<Rect> rectPx = Rect::create(); |
| 74 rectPx->setLeft(CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_PX)); | 74 rectPx->setLeft(CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_PX)); |
| 75 rectPx->setRight(CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_PX)); | 75 rectPx->setRight(CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_PX)); |
| 76 rectPx->setTop(CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_PX)); | 76 rectPx->setTop(CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_PX)); |
| 77 rectPx->setBottom(CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_PX)); | 77 rectPx->setBottom(CSSPrimitiveValue::create(10, CSSPrimitiveValue::CSS_PX)); |
| 78 | 78 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 rectPer->setLeft(CSSPrimitiveValue::create(30, CSSPrimitiveValue::CSS_PERCEN
TAGE)); | 113 rectPer->setLeft(CSSPrimitiveValue::create(30, CSSPrimitiveValue::CSS_PERCEN
TAGE)); |
| 114 rectPer->setRight(CSSPrimitiveValue::create(-30, CSSPrimitiveValue::CSS_PERC
ENTAGE)); | 114 rectPer->setRight(CSSPrimitiveValue::create(-30, CSSPrimitiveValue::CSS_PERC
ENTAGE)); |
| 115 rectPer->setTop(CSSPrimitiveValue::create(30, CSSPrimitiveValue::CSS_PERCENT
AGE)); | 115 rectPer->setTop(CSSPrimitiveValue::create(30, CSSPrimitiveValue::CSS_PERCENT
AGE)); |
| 116 rectPer->setBottom(CSSPrimitiveValue::create(-30, CSSPrimitiveValue::CSS_PER
CENTAGE)); | 116 rectPer->setBottom(CSSPrimitiveValue::create(-30, CSSPrimitiveValue::CSS_PER
CENTAGE)); |
| 117 | 117 |
| 118 value = roundTrip(CSSPrimitiveValue::create(rectPer.release())); | 118 value = roundTrip(CSSPrimitiveValue::create(rectPer.release())); |
| 119 testPrimitiveValue(value, 30, 0, 30, 0, CSSPrimitiveValue::CSS_PERCENTAGE); | 119 testPrimitiveValue(value, 30, 0, 30, 0, CSSPrimitiveValue::CSS_PERCENTAGE); |
| 120 } | 120 } |
| 121 | 121 |
| 122 } | 122 } |
| OLD | NEW |