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

Side by Side Diff: third_party/WebKit/Source/core/animation/CompositorAnimationsTest.cpp

Issue 2948193002: Merge AnimationTimeline and DocumentTimeline (Closed)
Patch Set: Fix rebase error Created 3 years, 5 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
OLDNEW
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 14 matching lines...) Expand all
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "core/animation/CompositorAnimations.h" 31 #include "core/animation/CompositorAnimations.h"
32 32
33 #include <memory> 33 #include <memory>
34 #include "core/animation/Animation.h" 34 #include "core/animation/Animation.h"
35 #include "core/animation/AnimationTimeline.h"
36 #include "core/animation/CompositorPendingAnimations.h" 35 #include "core/animation/CompositorPendingAnimations.h"
36 #include "core/animation/DocumentTimeline.h"
37 #include "core/animation/ElementAnimations.h" 37 #include "core/animation/ElementAnimations.h"
38 #include "core/animation/KeyframeEffect.h" 38 #include "core/animation/KeyframeEffect.h"
39 #include "core/animation/animatable/AnimatableDouble.h" 39 #include "core/animation/animatable/AnimatableDouble.h"
40 #include "core/animation/animatable/AnimatableFilterOperations.h" 40 #include "core/animation/animatable/AnimatableFilterOperations.h"
41 #include "core/animation/animatable/AnimatableTransform.h" 41 #include "core/animation/animatable/AnimatableTransform.h"
42 #include "core/dom/Document.h" 42 #include "core/dom/Document.h"
43 #include "core/layout/LayoutObject.h" 43 #include "core/layout/LayoutObject.h"
44 #include "core/paint/ObjectPaintProperties.h" 44 #include "core/paint/ObjectPaintProperties.h"
45 #include "core/style/FilterOperations.h" 45 #include "core/style/FilterOperations.h"
46 #include "core/testing/DummyPageHolder.h" 46 #include "core/testing/DummyPageHolder.h"
(...skipping 23 matching lines...) Expand all
70 70
71 Timing timing_; 71 Timing timing_;
72 CompositorAnimations::CompositorTiming compositor_timing_; 72 CompositorAnimations::CompositorTiming compositor_timing_;
73 std::unique_ptr<AnimatableValueKeyframeVector> keyframe_vector2_; 73 std::unique_ptr<AnimatableValueKeyframeVector> keyframe_vector2_;
74 Persistent<AnimatableValueKeyframeEffectModel> keyframe_animation_effect2_; 74 Persistent<AnimatableValueKeyframeEffectModel> keyframe_animation_effect2_;
75 std::unique_ptr<AnimatableValueKeyframeVector> keyframe_vector5_; 75 std::unique_ptr<AnimatableValueKeyframeVector> keyframe_vector5_;
76 Persistent<AnimatableValueKeyframeEffectModel> keyframe_animation_effect5_; 76 Persistent<AnimatableValueKeyframeEffectModel> keyframe_animation_effect5_;
77 77
78 Persistent<Document> document_; 78 Persistent<Document> document_;
79 Persistent<Element> element_; 79 Persistent<Element> element_;
80 Persistent<AnimationTimeline> timeline_; 80 Persistent<DocumentTimeline> timeline_;
81 std::unique_ptr<DummyPageHolder> page_holder_; 81 std::unique_ptr<DummyPageHolder> page_holder_;
82 82
83 void SetUp() override { 83 void SetUp() override {
84 linear_timing_function_ = LinearTimingFunction::Shared(); 84 linear_timing_function_ = LinearTimingFunction::Shared();
85 cubic_ease_timing_function_ = CubicBezierTimingFunction::Preset( 85 cubic_ease_timing_function_ = CubicBezierTimingFunction::Preset(
86 CubicBezierTimingFunction::EaseType::EASE); 86 CubicBezierTimingFunction::EaseType::EASE);
87 cubic_custom_timing_function_ = 87 cubic_custom_timing_function_ =
88 CubicBezierTimingFunction::Create(1, 2, 3, 4); 88 CubicBezierTimingFunction::Create(1, 2, 3, 4);
89 step_timing_function_ = 89 step_timing_function_ =
90 StepsTimingFunction::Create(1, StepsTimingFunction::StepPosition::END); 90 StepsTimingFunction::Create(1, StepsTimingFunction::StepPosition::END);
(...skipping 10 matching lines...) Expand all
101 AnimatableValueKeyframeEffectModel::Create(*keyframe_vector2_); 101 AnimatableValueKeyframeEffectModel::Create(*keyframe_vector2_);
102 102
103 keyframe_vector5_ = CreateCompositableFloatKeyframeVector(5); 103 keyframe_vector5_ = CreateCompositableFloatKeyframeVector(5);
104 keyframe_animation_effect5_ = 104 keyframe_animation_effect5_ =
105 AnimatableValueKeyframeEffectModel::Create(*keyframe_vector5_); 105 AnimatableValueKeyframeEffectModel::Create(*keyframe_vector5_);
106 106
107 page_holder_ = DummyPageHolder::Create(); 107 page_holder_ = DummyPageHolder::Create();
108 document_ = &page_holder_->GetDocument(); 108 document_ = &page_holder_->GetDocument();
109 document_->GetAnimationClock().ResetTimeForTesting(); 109 document_->GetAnimationClock().ResetTimeForTesting();
110 110
111 timeline_ = AnimationTimeline::Create(document_.Get()); 111 timeline_ = DocumentTimeline::Create(document_.Get());
112 timeline_->ResetForTesting(); 112 timeline_->ResetForTesting();
113 element_ = document_->createElement("test"); 113 element_ = document_->createElement("test");
114 } 114 }
115 115
116 public: 116 public:
117 bool ConvertTimingForCompositor(const Timing& t, 117 bool ConvertTimingForCompositor(const Timing& t,
118 CompositorAnimations::CompositorTiming& out) { 118 CompositorAnimations::CompositorTiming& out) {
119 return CompositorAnimations::ConvertTimingForCompositor(t, 0, out, 1); 119 return CompositorAnimations::ConvertTimingForCompositor(t, 0, out, 1);
120 } 120 }
121 bool CanStartEffectOnCompositor(const Timing& timing, 121 bool CanStartEffectOnCompositor(const Timing& timing,
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after
1326 // Clearing the effect node entirely should also produce false. 1326 // Clearing the effect node entirely should also produce false.
1327 properties.ClearEffect(); 1327 properties.ClearEffect();
1328 EXPECT_FALSE( 1328 EXPECT_FALSE(
1329 CompositorAnimations::CheckCanStartElementOnCompositor(*element).Ok()); 1329 CompositorAnimations::CheckCanStartElementOnCompositor(*element).Ok());
1330 1330
1331 element->SetLayoutObject(nullptr); 1331 element->SetLayoutObject(nullptr);
1332 LayoutObjectProxy::Dispose(layout_object); 1332 LayoutObjectProxy::Dispose(layout_object);
1333 } 1333 }
1334 1334
1335 } // namespace blink 1335 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698