| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 m_keyframeVector5 = createCompositableFloatKeyframeVector(5); | 99 m_keyframeVector5 = createCompositableFloatKeyframeVector(5); |
| 100 m_keyframeAnimationEffect5 = | 100 m_keyframeAnimationEffect5 = |
| 101 AnimatableValueKeyframeEffectModel::create(*m_keyframeVector5); | 101 AnimatableValueKeyframeEffectModel::create(*m_keyframeVector5); |
| 102 | 102 |
| 103 m_pageHolder = DummyPageHolder::create(); | 103 m_pageHolder = DummyPageHolder::create(); |
| 104 m_document = &m_pageHolder->document(); | 104 m_document = &m_pageHolder->document(); |
| 105 m_document->animationClock().resetTimeForTesting(); | 105 m_document->animationClock().resetTimeForTesting(); |
| 106 | 106 |
| 107 m_timeline = AnimationTimeline::create(m_document.get()); | 107 m_timeline = AnimationTimeline::create(m_document.get()); |
| 108 m_timeline->resetForTesting(); | 108 m_timeline->resetForTesting(); |
| 109 m_element = m_document->createElement("test", ASSERT_NO_EXCEPTION); | 109 m_element = m_document->createElement("test"); |
| 110 } | 110 } |
| 111 | 111 |
| 112 public: | 112 public: |
| 113 bool convertTimingForCompositor(const Timing& t, | 113 bool convertTimingForCompositor(const Timing& t, |
| 114 CompositorAnimations::CompositorTiming& out) { | 114 CompositorAnimations::CompositorTiming& out) { |
| 115 return CompositorAnimations::convertTimingForCompositor(t, 0, out, 1); | 115 return CompositorAnimations::convertTimingForCompositor(t, 0, out, 1); |
| 116 } | 116 } |
| 117 bool isCandidateForAnimationOnCompositor(const Timing& timing, | 117 bool isCandidateForAnimationOnCompositor(const Timing& timing, |
| 118 const EffectModel& effect) { | 118 const EffectModel& effect) { |
| 119 return CompositorAnimations::isCandidateForAnimationOnCompositor( | 119 return CompositorAnimations::isCandidateForAnimationOnCompositor( |
| (...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1184 keyframes[0]->getTimingFunctionForTesting()->getType()); | 1184 keyframes[0]->getTimingFunctionForTesting()->getType()); |
| 1185 | 1185 |
| 1186 EXPECT_EQ(1.0, keyframes[1]->time()); | 1186 EXPECT_EQ(1.0, keyframes[1]->time()); |
| 1187 EXPECT_EQ(5.0f, keyframes[1]->value()); | 1187 EXPECT_EQ(5.0f, keyframes[1]->value()); |
| 1188 EXPECT_EQ(TimingFunction::Type::LINEAR, | 1188 EXPECT_EQ(TimingFunction::Type::LINEAR, |
| 1189 keyframes[1]->getTimingFunctionForTesting()->getType()); | 1189 keyframes[1]->getTimingFunctionForTesting()->getType()); |
| 1190 } | 1190 } |
| 1191 | 1191 |
| 1192 TEST_F(AnimationCompositorAnimationsTest, | 1192 TEST_F(AnimationCompositorAnimationsTest, |
| 1193 cancelIncompatibleCompositorAnimations) { | 1193 cancelIncompatibleCompositorAnimations) { |
| 1194 Persistent<Element> element = | 1194 Persistent<Element> element = m_document->createElement("shared"); |
| 1195 m_document->createElement("shared", ASSERT_NO_EXCEPTION); | |
| 1196 | 1195 |
| 1197 LayoutObjectProxy* layoutObject = LayoutObjectProxy::create(element.get()); | 1196 LayoutObjectProxy* layoutObject = LayoutObjectProxy::create(element.get()); |
| 1198 element->setLayoutObject(layoutObject); | 1197 element->setLayoutObject(layoutObject); |
| 1199 | 1198 |
| 1200 AnimatableValueKeyframeVector keyFrames; | 1199 AnimatableValueKeyframeVector keyFrames; |
| 1201 keyFrames.append(createDefaultKeyframe(CSSPropertyOpacity, | 1200 keyFrames.append(createDefaultKeyframe(CSSPropertyOpacity, |
| 1202 EffectModel::CompositeReplace, 0.0) | 1201 EffectModel::CompositeReplace, 0.0) |
| 1203 .get()); | 1202 .get()); |
| 1204 keyFrames.append(createDefaultKeyframe(CSSPropertyOpacity, | 1203 keyFrames.append(createDefaultKeyframe(CSSPropertyOpacity, |
| 1205 EffectModel::CompositeReplace, 1.0) | 1204 EffectModel::CompositeReplace, 1.0) |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1245 simulateFrame(1.); | 1244 simulateFrame(1.); |
| 1246 | 1245 |
| 1247 element->setLayoutObject(nullptr); | 1246 element->setLayoutObject(nullptr); |
| 1248 LayoutObjectProxy::dispose(layoutObject); | 1247 LayoutObjectProxy::dispose(layoutObject); |
| 1249 | 1248 |
| 1250 ThreadState::current()->collectAllGarbage(); | 1249 ThreadState::current()->collectAllGarbage(); |
| 1251 EXPECT_TRUE(element->elementAnimations()->animations().isEmpty()); | 1250 EXPECT_TRUE(element->elementAnimations()->animations().isEmpty()); |
| 1252 } | 1251 } |
| 1253 | 1252 |
| 1254 } // namespace blink | 1253 } // namespace blink |
| OLD | NEW |