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

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

Issue 813233002: Animation: Fix loss of type information when interpolating value of 0 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix second accumulateLength method Created 5 years, 12 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
« no previous file with comments | « no previous file | Source/core/animation/LengthPairStyleInterpolationTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | Source/core/animation/LengthPairStyleInterpolationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698