| 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/Animation.h" | 6 #include "core/animation/Animation.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/Dictionary.h" | 8 #include "bindings/core/v8/Dictionary.h" |
| 9 #include "bindings/core/v8/UnionTypesCore.h" | 9 #include "bindings/core/v8/UnionTypesCore.h" |
| 10 #include "bindings/core/v8/V8AnimationTimingProperties.h" | 10 #include "bindings/core/v8/V8AnimationTimingProperties.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 v8::Isolate* m_isolate; | 61 v8::Isolate* m_isolate; |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 V8TestingScope m_scope; | 64 V8TestingScope m_scope; |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 TEST_F(AnimationAnimationV8Test, CanCreateAnAnimation) | 67 TEST_F(AnimationAnimationV8Test, CanCreateAnAnimation) |
| 68 { | 68 { |
| 69 Vector<Dictionary> jsKeyframes; | 69 Vector<Dictionary> jsKeyframes; |
| 70 v8::Handle<v8::Object> keyframe1 = v8::Object::New(m_isolate); | 70 v8::Local<v8::Object> keyframe1 = v8::Object::New(m_isolate); |
| 71 v8::Handle<v8::Object> keyframe2 = v8::Object::New(m_isolate); | 71 v8::Local<v8::Object> keyframe2 = v8::Object::New(m_isolate); |
| 72 | 72 |
| 73 setV8ObjectPropertyAsString(keyframe1, "width", "100px"); | 73 setV8ObjectPropertyAsString(keyframe1, "width", "100px"); |
| 74 setV8ObjectPropertyAsString(keyframe1, "offset", "0"); | 74 setV8ObjectPropertyAsString(keyframe1, "offset", "0"); |
| 75 setV8ObjectPropertyAsString(keyframe1, "easing", "ease-in-out"); | 75 setV8ObjectPropertyAsString(keyframe1, "easing", "ease-in-out"); |
| 76 setV8ObjectPropertyAsString(keyframe2, "width", "0px"); | 76 setV8ObjectPropertyAsString(keyframe2, "width", "0px"); |
| 77 setV8ObjectPropertyAsString(keyframe2, "offset", "1"); | 77 setV8ObjectPropertyAsString(keyframe2, "offset", "1"); |
| 78 setV8ObjectPropertyAsString(keyframe2, "easing", "cubic-bezier(1, 1, 0.3, 0.
3)"); | 78 setV8ObjectPropertyAsString(keyframe2, "easing", "cubic-bezier(1, 1, 0.3, 0.
3)"); |
| 79 | 79 |
| 80 jsKeyframes.append(Dictionary(keyframe1, m_isolate, exceptionState)); | 80 jsKeyframes.append(Dictionary(keyframe1, m_isolate, exceptionState)); |
| 81 jsKeyframes.append(Dictionary(keyframe2, m_isolate, exceptionState)); | 81 jsKeyframes.append(Dictionary(keyframe2, m_isolate, exceptionState)); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 TEST_F(AnimationAnimationV8Test, NegativeDurationIsAuto) | 130 TEST_F(AnimationAnimationV8Test, NegativeDurationIsAuto) |
| 131 { | 131 { |
| 132 Vector<Dictionary, 0> jsKeyframes; | 132 Vector<Dictionary, 0> jsKeyframes; |
| 133 RefPtrWillBeRawPtr<Animation> animation = createAnimation(element.get(), jsK
eyframes, -2, exceptionState); | 133 RefPtrWillBeRawPtr<Animation> animation = createAnimation(element.get(), jsK
eyframes, -2, exceptionState); |
| 134 EXPECT_TRUE(std::isnan(animation->specifiedTiming().iterationDuration)); | 134 EXPECT_TRUE(std::isnan(animation->specifiedTiming().iterationDuration)); |
| 135 } | 135 } |
| 136 | 136 |
| 137 TEST_F(AnimationAnimationV8Test, MismatchedKeyframePropertyRaisesException) | 137 TEST_F(AnimationAnimationV8Test, MismatchedKeyframePropertyRaisesException) |
| 138 { | 138 { |
| 139 Vector<Dictionary> jsKeyframes; | 139 Vector<Dictionary> jsKeyframes; |
| 140 v8::Handle<v8::Object> keyframe1 = v8::Object::New(m_isolate); | 140 v8::Local<v8::Object> keyframe1 = v8::Object::New(m_isolate); |
| 141 v8::Handle<v8::Object> keyframe2 = v8::Object::New(m_isolate); | 141 v8::Local<v8::Object> keyframe2 = v8::Object::New(m_isolate); |
| 142 | 142 |
| 143 setV8ObjectPropertyAsString(keyframe1, "width", "100px"); | 143 setV8ObjectPropertyAsString(keyframe1, "width", "100px"); |
| 144 setV8ObjectPropertyAsString(keyframe1, "offset", "0"); | 144 setV8ObjectPropertyAsString(keyframe1, "offset", "0"); |
| 145 | 145 |
| 146 // Height property appears only in keyframe2 | 146 // Height property appears only in keyframe2 |
| 147 setV8ObjectPropertyAsString(keyframe2, "height", "100px"); | 147 setV8ObjectPropertyAsString(keyframe2, "height", "100px"); |
| 148 setV8ObjectPropertyAsString(keyframe2, "width", "0px"); | 148 setV8ObjectPropertyAsString(keyframe2, "width", "0px"); |
| 149 setV8ObjectPropertyAsString(keyframe2, "offset", "1"); | 149 setV8ObjectPropertyAsString(keyframe2, "offset", "1"); |
| 150 | 150 |
| 151 jsKeyframes.append(Dictionary(keyframe1, m_isolate, exceptionState)); | 151 jsKeyframes.append(Dictionary(keyframe1, m_isolate, exceptionState)); |
| 152 jsKeyframes.append(Dictionary(keyframe2, m_isolate, exceptionState)); | 152 jsKeyframes.append(Dictionary(keyframe2, m_isolate, exceptionState)); |
| 153 | 153 |
| 154 createAnimation(element.get(), jsKeyframes, 0, exceptionState); | 154 createAnimation(element.get(), jsKeyframes, 0, exceptionState); |
| 155 | 155 |
| 156 EXPECT_TRUE(exceptionState.hadException()); | 156 EXPECT_TRUE(exceptionState.hadException()); |
| 157 EXPECT_EQ(NotSupportedError, exceptionState.code()); | 157 EXPECT_EQ(NotSupportedError, exceptionState.code()); |
| 158 } | 158 } |
| 159 | 159 |
| 160 TEST_F(AnimationAnimationV8Test, MissingOffsetZeroRaisesException) | 160 TEST_F(AnimationAnimationV8Test, MissingOffsetZeroRaisesException) |
| 161 { | 161 { |
| 162 Vector<Dictionary> jsKeyframes; | 162 Vector<Dictionary> jsKeyframes; |
| 163 v8::Handle<v8::Object> keyframe1 = v8::Object::New(m_isolate); | 163 v8::Local<v8::Object> keyframe1 = v8::Object::New(m_isolate); |
| 164 v8::Handle<v8::Object> keyframe2 = v8::Object::New(m_isolate); | 164 v8::Local<v8::Object> keyframe2 = v8::Object::New(m_isolate); |
| 165 | 165 |
| 166 setV8ObjectPropertyAsString(keyframe1, "width", "100px"); | 166 setV8ObjectPropertyAsString(keyframe1, "width", "100px"); |
| 167 setV8ObjectPropertyAsString(keyframe1, "offset", "0.1"); | 167 setV8ObjectPropertyAsString(keyframe1, "offset", "0.1"); |
| 168 setV8ObjectPropertyAsString(keyframe2, "width", "0px"); | 168 setV8ObjectPropertyAsString(keyframe2, "width", "0px"); |
| 169 setV8ObjectPropertyAsString(keyframe2, "offset", "1"); | 169 setV8ObjectPropertyAsString(keyframe2, "offset", "1"); |
| 170 | 170 |
| 171 jsKeyframes.append(Dictionary(keyframe1, m_isolate, exceptionState)); | 171 jsKeyframes.append(Dictionary(keyframe1, m_isolate, exceptionState)); |
| 172 jsKeyframes.append(Dictionary(keyframe2, m_isolate, exceptionState)); | 172 jsKeyframes.append(Dictionary(keyframe2, m_isolate, exceptionState)); |
| 173 | 173 |
| 174 createAnimation(element.get(), jsKeyframes, 0, exceptionState); | 174 createAnimation(element.get(), jsKeyframes, 0, exceptionState); |
| 175 | 175 |
| 176 EXPECT_TRUE(exceptionState.hadException()); | 176 EXPECT_TRUE(exceptionState.hadException()); |
| 177 EXPECT_EQ(NotSupportedError, exceptionState.code()); | 177 EXPECT_EQ(NotSupportedError, exceptionState.code()); |
| 178 } | 178 } |
| 179 | 179 |
| 180 TEST_F(AnimationAnimationV8Test, MissingOffsetOneRaisesException) | 180 TEST_F(AnimationAnimationV8Test, MissingOffsetOneRaisesException) |
| 181 { | 181 { |
| 182 Vector<Dictionary> jsKeyframes; | 182 Vector<Dictionary> jsKeyframes; |
| 183 v8::Handle<v8::Object> keyframe1 = v8::Object::New(m_isolate); | 183 v8::Local<v8::Object> keyframe1 = v8::Object::New(m_isolate); |
| 184 v8::Handle<v8::Object> keyframe2 = v8::Object::New(m_isolate); | 184 v8::Local<v8::Object> keyframe2 = v8::Object::New(m_isolate); |
| 185 | 185 |
| 186 setV8ObjectPropertyAsString(keyframe1, "width", "100px"); | 186 setV8ObjectPropertyAsString(keyframe1, "width", "100px"); |
| 187 setV8ObjectPropertyAsString(keyframe1, "offset", "0"); | 187 setV8ObjectPropertyAsString(keyframe1, "offset", "0"); |
| 188 setV8ObjectPropertyAsString(keyframe2, "width", "0px"); | 188 setV8ObjectPropertyAsString(keyframe2, "width", "0px"); |
| 189 setV8ObjectPropertyAsString(keyframe2, "offset", "0.1"); | 189 setV8ObjectPropertyAsString(keyframe2, "offset", "0.1"); |
| 190 | 190 |
| 191 jsKeyframes.append(Dictionary(keyframe1, m_isolate, exceptionState)); | 191 jsKeyframes.append(Dictionary(keyframe1, m_isolate, exceptionState)); |
| 192 jsKeyframes.append(Dictionary(keyframe2, m_isolate, exceptionState)); | 192 jsKeyframes.append(Dictionary(keyframe2, m_isolate, exceptionState)); |
| 193 | 193 |
| 194 createAnimation(element.get(), jsKeyframes, 0, exceptionState); | 194 createAnimation(element.get(), jsKeyframes, 0, exceptionState); |
| 195 | 195 |
| 196 EXPECT_TRUE(exceptionState.hadException()); | 196 EXPECT_TRUE(exceptionState.hadException()); |
| 197 EXPECT_EQ(NotSupportedError, exceptionState.code()); | 197 EXPECT_EQ(NotSupportedError, exceptionState.code()); |
| 198 } | 198 } |
| 199 | 199 |
| 200 TEST_F(AnimationAnimationV8Test, MissingOffsetZeroAndOneRaisesException) | 200 TEST_F(AnimationAnimationV8Test, MissingOffsetZeroAndOneRaisesException) |
| 201 { | 201 { |
| 202 Vector<Dictionary> jsKeyframes; | 202 Vector<Dictionary> jsKeyframes; |
| 203 v8::Handle<v8::Object> keyframe1 = v8::Object::New(m_isolate); | 203 v8::Local<v8::Object> keyframe1 = v8::Object::New(m_isolate); |
| 204 v8::Handle<v8::Object> keyframe2 = v8::Object::New(m_isolate); | 204 v8::Local<v8::Object> keyframe2 = v8::Object::New(m_isolate); |
| 205 | 205 |
| 206 setV8ObjectPropertyAsString(keyframe1, "width", "100px"); | 206 setV8ObjectPropertyAsString(keyframe1, "width", "100px"); |
| 207 setV8ObjectPropertyAsString(keyframe1, "offset", "0.1"); | 207 setV8ObjectPropertyAsString(keyframe1, "offset", "0.1"); |
| 208 setV8ObjectPropertyAsString(keyframe2, "width", "0px"); | 208 setV8ObjectPropertyAsString(keyframe2, "width", "0px"); |
| 209 setV8ObjectPropertyAsString(keyframe2, "offset", "0.2"); | 209 setV8ObjectPropertyAsString(keyframe2, "offset", "0.2"); |
| 210 | 210 |
| 211 jsKeyframes.append(Dictionary(keyframe1, m_isolate, exceptionState)); | 211 jsKeyframes.append(Dictionary(keyframe1, m_isolate, exceptionState)); |
| 212 jsKeyframes.append(Dictionary(keyframe2, m_isolate, exceptionState)); | 212 jsKeyframes.append(Dictionary(keyframe2, m_isolate, exceptionState)); |
| 213 | 213 |
| 214 createAnimation(element.get(), jsKeyframes, 0, exceptionState); | 214 createAnimation(element.get(), jsKeyframes, 0, exceptionState); |
| 215 | 215 |
| 216 EXPECT_TRUE(exceptionState.hadException()); | 216 EXPECT_TRUE(exceptionState.hadException()); |
| 217 EXPECT_EQ(NotSupportedError, exceptionState.code()); | 217 EXPECT_EQ(NotSupportedError, exceptionState.code()); |
| 218 } | 218 } |
| 219 | 219 |
| 220 TEST_F(AnimationAnimationV8Test, SpecifiedGetters) | 220 TEST_F(AnimationAnimationV8Test, SpecifiedGetters) |
| 221 { | 221 { |
| 222 Vector<Dictionary, 0> jsKeyframes; | 222 Vector<Dictionary, 0> jsKeyframes; |
| 223 | 223 |
| 224 v8::Handle<v8::Object> timingInput = v8::Object::New(m_isolate); | 224 v8::Local<v8::Object> timingInput = v8::Object::New(m_isolate); |
| 225 setV8ObjectPropertyAsNumber(timingInput, "delay", 2); | 225 setV8ObjectPropertyAsNumber(timingInput, "delay", 2); |
| 226 setV8ObjectPropertyAsNumber(timingInput, "endDelay", 0.5); | 226 setV8ObjectPropertyAsNumber(timingInput, "endDelay", 0.5); |
| 227 setV8ObjectPropertyAsString(timingInput, "fill", "backwards"); | 227 setV8ObjectPropertyAsString(timingInput, "fill", "backwards"); |
| 228 setV8ObjectPropertyAsNumber(timingInput, "iterationStart", 2); | 228 setV8ObjectPropertyAsNumber(timingInput, "iterationStart", 2); |
| 229 setV8ObjectPropertyAsNumber(timingInput, "iterations", 10); | 229 setV8ObjectPropertyAsNumber(timingInput, "iterations", 10); |
| 230 setV8ObjectPropertyAsNumber(timingInput, "playbackRate", 2); | 230 setV8ObjectPropertyAsNumber(timingInput, "playbackRate", 2); |
| 231 setV8ObjectPropertyAsString(timingInput, "direction", "reverse"); | 231 setV8ObjectPropertyAsString(timingInput, "direction", "reverse"); |
| 232 setV8ObjectPropertyAsString(timingInput, "easing", "step-start"); | 232 setV8ObjectPropertyAsString(timingInput, "easing", "step-start"); |
| 233 AnimationTimingProperties timingInputDictionary; | 233 AnimationTimingProperties timingInputDictionary; |
| 234 V8AnimationTimingProperties::toImpl(m_isolate, timingInput, timingInputDicti
onary, exceptionState); | 234 V8AnimationTimingProperties::toImpl(m_isolate, timingInput, timingInputDicti
onary, exceptionState); |
| 235 | 235 |
| 236 RefPtrWillBeRawPtr<Animation> animation = createAnimation(element.get(), jsK
eyframes, timingInputDictionary, exceptionState); | 236 RefPtrWillBeRawPtr<Animation> animation = createAnimation(element.get(), jsK
eyframes, timingInputDictionary, exceptionState); |
| 237 | 237 |
| 238 RefPtrWillBeRawPtr<AnimationNodeTiming> specified = animation->timing(); | 238 RefPtrWillBeRawPtr<AnimationNodeTiming> specified = animation->timing(); |
| 239 EXPECT_EQ(2, specified->delay()); | 239 EXPECT_EQ(2, specified->delay()); |
| 240 EXPECT_EQ(0.5, specified->endDelay()); | 240 EXPECT_EQ(0.5, specified->endDelay()); |
| 241 EXPECT_EQ("backwards", specified->fill()); | 241 EXPECT_EQ("backwards", specified->fill()); |
| 242 EXPECT_EQ(2, specified->iterationStart()); | 242 EXPECT_EQ(2, specified->iterationStart()); |
| 243 EXPECT_EQ(10, specified->iterations()); | 243 EXPECT_EQ(10, specified->iterations()); |
| 244 EXPECT_EQ(2, specified->playbackRate()); | 244 EXPECT_EQ(2, specified->playbackRate()); |
| 245 EXPECT_EQ("reverse", specified->direction()); | 245 EXPECT_EQ("reverse", specified->direction()); |
| 246 EXPECT_EQ("step-start", specified->easing()); | 246 EXPECT_EQ("step-start", specified->easing()); |
| 247 } | 247 } |
| 248 | 248 |
| 249 TEST_F(AnimationAnimationV8Test, SpecifiedDurationGetter) | 249 TEST_F(AnimationAnimationV8Test, SpecifiedDurationGetter) |
| 250 { | 250 { |
| 251 Vector<Dictionary, 0> jsKeyframes; | 251 Vector<Dictionary, 0> jsKeyframes; |
| 252 | 252 |
| 253 v8::Handle<v8::Object> timingInputWithDuration = v8::Object::New(m_isolate); | 253 v8::Local<v8::Object> timingInputWithDuration = v8::Object::New(m_isolate); |
| 254 setV8ObjectPropertyAsNumber(timingInputWithDuration, "duration", 2.5); | 254 setV8ObjectPropertyAsNumber(timingInputWithDuration, "duration", 2.5); |
| 255 AnimationTimingProperties timingInputDictionaryWithDuration; | 255 AnimationTimingProperties timingInputDictionaryWithDuration; |
| 256 V8AnimationTimingProperties::toImpl(m_isolate, timingInputWithDuration, timi
ngInputDictionaryWithDuration, exceptionState); | 256 V8AnimationTimingProperties::toImpl(m_isolate, timingInputWithDuration, timi
ngInputDictionaryWithDuration, exceptionState); |
| 257 | 257 |
| 258 RefPtrWillBeRawPtr<Animation> animationWithDuration = createAnimation(elemen
t.get(), jsKeyframes, timingInputDictionaryWithDuration, exceptionState); | 258 RefPtrWillBeRawPtr<Animation> animationWithDuration = createAnimation(elemen
t.get(), jsKeyframes, timingInputDictionaryWithDuration, exceptionState); |
| 259 | 259 |
| 260 RefPtrWillBeRawPtr<AnimationNodeTiming> specifiedWithDuration = animationWit
hDuration->timing(); | 260 RefPtrWillBeRawPtr<AnimationNodeTiming> specifiedWithDuration = animationWit
hDuration->timing(); |
| 261 UnrestrictedDoubleOrString duration; | 261 UnrestrictedDoubleOrString duration; |
| 262 specifiedWithDuration->duration(duration); | 262 specifiedWithDuration->duration(duration); |
| 263 EXPECT_TRUE(duration.isUnrestrictedDouble()); | 263 EXPECT_TRUE(duration.isUnrestrictedDouble()); |
| 264 EXPECT_EQ(2.5, duration.getAsUnrestrictedDouble()); | 264 EXPECT_EQ(2.5, duration.getAsUnrestrictedDouble()); |
| 265 EXPECT_FALSE(duration.isString()); | 265 EXPECT_FALSE(duration.isString()); |
| 266 | 266 |
| 267 | 267 |
| 268 v8::Handle<v8::Object> timingInputNoDuration = v8::Object::New(m_isolate); | 268 v8::Local<v8::Object> timingInputNoDuration = v8::Object::New(m_isolate); |
| 269 AnimationTimingProperties timingInputDictionaryNoDuration; | 269 AnimationTimingProperties timingInputDictionaryNoDuration; |
| 270 V8AnimationTimingProperties::toImpl(m_isolate, timingInputNoDuration, timing
InputDictionaryNoDuration, exceptionState); | 270 V8AnimationTimingProperties::toImpl(m_isolate, timingInputNoDuration, timing
InputDictionaryNoDuration, exceptionState); |
| 271 | 271 |
| 272 RefPtrWillBeRawPtr<Animation> animationNoDuration = createAnimation(element.
get(), jsKeyframes, timingInputDictionaryNoDuration, exceptionState); | 272 RefPtrWillBeRawPtr<Animation> animationNoDuration = createAnimation(element.
get(), jsKeyframes, timingInputDictionaryNoDuration, exceptionState); |
| 273 | 273 |
| 274 RefPtrWillBeRawPtr<AnimationNodeTiming> specifiedNoDuration = animationNoDur
ation->timing(); | 274 RefPtrWillBeRawPtr<AnimationNodeTiming> specifiedNoDuration = animationNoDur
ation->timing(); |
| 275 UnrestrictedDoubleOrString duration2; | 275 UnrestrictedDoubleOrString duration2; |
| 276 specifiedNoDuration->duration(duration2); | 276 specifiedNoDuration->duration(duration2); |
| 277 EXPECT_FALSE(duration2.isUnrestrictedDouble()); | 277 EXPECT_FALSE(duration2.isUnrestrictedDouble()); |
| 278 EXPECT_TRUE(duration2.isString()); | 278 EXPECT_TRUE(duration2.isString()); |
| 279 EXPECT_EQ("auto", duration2.getAsString()); | 279 EXPECT_EQ("auto", duration2.getAsString()); |
| 280 } | 280 } |
| 281 | 281 |
| 282 TEST_F(AnimationAnimationV8Test, SpecifiedSetters) | 282 TEST_F(AnimationAnimationV8Test, SpecifiedSetters) |
| 283 { | 283 { |
| 284 Vector<Dictionary, 0> jsKeyframes; | 284 Vector<Dictionary, 0> jsKeyframes; |
| 285 v8::Handle<v8::Object> timingInput = v8::Object::New(m_isolate); | 285 v8::Local<v8::Object> timingInput = v8::Object::New(m_isolate); |
| 286 AnimationTimingProperties timingInputDictionary; | 286 AnimationTimingProperties timingInputDictionary; |
| 287 V8AnimationTimingProperties::toImpl(m_isolate, timingInput, timingInputDicti
onary, exceptionState); | 287 V8AnimationTimingProperties::toImpl(m_isolate, timingInput, timingInputDicti
onary, exceptionState); |
| 288 RefPtrWillBeRawPtr<Animation> animation = createAnimation(element.get(), jsK
eyframes, timingInputDictionary, exceptionState); | 288 RefPtrWillBeRawPtr<Animation> animation = createAnimation(element.get(), jsK
eyframes, timingInputDictionary, exceptionState); |
| 289 | 289 |
| 290 RefPtrWillBeRawPtr<AnimationNodeTiming> specified = animation->timing(); | 290 RefPtrWillBeRawPtr<AnimationNodeTiming> specified = animation->timing(); |
| 291 | 291 |
| 292 EXPECT_EQ(0, specified->delay()); | 292 EXPECT_EQ(0, specified->delay()); |
| 293 specified->setDelay(2); | 293 specified->setDelay(2); |
| 294 EXPECT_EQ(2, specified->delay()); | 294 EXPECT_EQ(2, specified->delay()); |
| 295 | 295 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 318 EXPECT_EQ("reverse", specified->direction()); | 318 EXPECT_EQ("reverse", specified->direction()); |
| 319 | 319 |
| 320 EXPECT_EQ("linear", specified->easing()); | 320 EXPECT_EQ("linear", specified->easing()); |
| 321 specified->setEasing("step-start"); | 321 specified->setEasing("step-start"); |
| 322 EXPECT_EQ("step-start", specified->easing()); | 322 EXPECT_EQ("step-start", specified->easing()); |
| 323 } | 323 } |
| 324 | 324 |
| 325 TEST_F(AnimationAnimationV8Test, SetSpecifiedDuration) | 325 TEST_F(AnimationAnimationV8Test, SetSpecifiedDuration) |
| 326 { | 326 { |
| 327 Vector<Dictionary, 0> jsKeyframes; | 327 Vector<Dictionary, 0> jsKeyframes; |
| 328 v8::Handle<v8::Object> timingInput = v8::Object::New(m_isolate); | 328 v8::Local<v8::Object> timingInput = v8::Object::New(m_isolate); |
| 329 AnimationTimingProperties timingInputDictionary; | 329 AnimationTimingProperties timingInputDictionary; |
| 330 V8AnimationTimingProperties::toImpl(m_isolate, timingInput, timingInputDicti
onary, exceptionState); | 330 V8AnimationTimingProperties::toImpl(m_isolate, timingInput, timingInputDicti
onary, exceptionState); |
| 331 RefPtrWillBeRawPtr<Animation> animation = createAnimation(element.get(), jsK
eyframes, timingInputDictionary, exceptionState); | 331 RefPtrWillBeRawPtr<Animation> animation = createAnimation(element.get(), jsK
eyframes, timingInputDictionary, exceptionState); |
| 332 | 332 |
| 333 RefPtrWillBeRawPtr<AnimationNodeTiming> specified = animation->timing(); | 333 RefPtrWillBeRawPtr<AnimationNodeTiming> specified = animation->timing(); |
| 334 | 334 |
| 335 UnrestrictedDoubleOrString duration; | 335 UnrestrictedDoubleOrString duration; |
| 336 specified->duration(duration); | 336 specified->duration(duration); |
| 337 EXPECT_FALSE(duration.isUnrestrictedDouble()); | 337 EXPECT_FALSE(duration.isUnrestrictedDouble()); |
| 338 EXPECT_TRUE(duration.isString()); | 338 EXPECT_TRUE(duration.isString()); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 EXPECT_EQ(element.get(), animation->target()); | 455 EXPECT_EQ(element.get(), animation->target()); |
| 456 document.timeline().play(animation.get()); | 456 document.timeline().play(animation.get()); |
| 457 pageHolder.clear(); | 457 pageHolder.clear(); |
| 458 element.clear(); | 458 element.clear(); |
| 459 #if !ENABLE(OILPAN) | 459 #if !ENABLE(OILPAN) |
| 460 EXPECT_EQ(0, animation->target()); | 460 EXPECT_EQ(0, animation->target()); |
| 461 #endif | 461 #endif |
| 462 } | 462 } |
| 463 | 463 |
| 464 } // namespace blink | 464 } // namespace blink |
| OLD | NEW |