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

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

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 // 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 "core/animation/InterpolationEffect.h" 5 #include "core/animation/InterpolationEffect.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include <memory>
9 8
10 namespace blink { 9 namespace blink {
11 10
12 namespace { 11 namespace {
13 12
14 class SampleInterpolation : public Interpolation { 13 class SampleInterpolation : public Interpolation {
15 public: 14 public:
16 static PassRefPtr<Interpolation> create(std::unique_ptr<InterpolableValue> s tart, std::unique_ptr<InterpolableValue> end) 15 static PassRefPtr<Interpolation> create(PassOwnPtr<InterpolableValue> start, PassOwnPtr<InterpolableValue> end)
17 { 16 {
18 return adoptRef(new SampleInterpolation(std::move(start), std::move(end) )); 17 return adoptRef(new SampleInterpolation(std::move(start), std::move(end) ));
19 } 18 }
20 19
21 PropertyHandle getProperty() const override 20 PropertyHandle getProperty() const override
22 { 21 {
23 return PropertyHandle(CSSPropertyBackgroundColor); 22 return PropertyHandle(CSSPropertyBackgroundColor);
24 } 23 }
25 private: 24 private:
26 SampleInterpolation(std::unique_ptr<InterpolableValue> start, std::unique_pt r<InterpolableValue> end) 25 SampleInterpolation(PassOwnPtr<InterpolableValue> start, PassOwnPtr<Interpol ableValue> end)
27 : Interpolation(std::move(start), std::move(end)) 26 : Interpolation(std::move(start), std::move(end))
28 { 27 {
29 } 28 }
30 }; 29 };
31 30
32 const double duration = 1.0; 31 const double duration = 1.0;
33 32
34 } // namespace 33 } // namespace
35 34
36 class AnimationInterpolationEffectTest : public ::testing::Test { 35 class AnimationInterpolationEffectTest : public ::testing::Test {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 interpolationEffect.getActiveInterpolations(1.5, duration, activeInterpolati ons); 107 interpolationEffect.getActiveInterpolations(1.5, duration, activeInterpolati ons);
109 EXPECT_EQ(1ul, activeInterpolations.size()); 108 EXPECT_EQ(1ul, activeInterpolations.size());
110 EXPECT_FLOAT_EQ(12.5f, getInterpolableNumber(activeInterpolations.at(0))); 109 EXPECT_FLOAT_EQ(12.5f, getInterpolableNumber(activeInterpolations.at(0)));
111 110
112 interpolationEffect.getActiveInterpolations(2, duration, activeInterpolation s); 111 interpolationEffect.getActiveInterpolations(2, duration, activeInterpolation s);
113 EXPECT_EQ(1ul, activeInterpolations.size()); 112 EXPECT_EQ(1ul, activeInterpolations.size());
114 EXPECT_FLOAT_EQ(15, getInterpolableNumber(activeInterpolations.at(0))); 113 EXPECT_FLOAT_EQ(15, getInterpolableNumber(activeInterpolations.at(0)));
115 } 114 }
116 115
117 } // namespace blink 116 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698