OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "platform/animation/CompositorAnimationPlayer.h" | 5 #include "platform/animation/CompositorAnimationPlayer.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "platform/animation/CompositorTargetProperty.h" |
9 #include "public/platform/WebCompositorAnimationDelegate.h" | 10 #include "public/platform/WebCompositorAnimationDelegate.h" |
10 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
12 | 13 |
13 using base::TimeTicks; | 14 using base::TimeTicks; |
14 using blink::WebCompositorAnimationDelegate; | 15 using blink::WebCompositorAnimationDelegate; |
15 using cc::Animation; | 16 using cc::Animation; |
16 using testing::_; | 17 using testing::_; |
17 | 18 |
18 namespace blink { | 19 namespace blink { |
(...skipping 14 matching lines...) Expand all Loading... |
33 scoped_ptr<WebCompositorAnimationDelegate> delegate( | 34 scoped_ptr<WebCompositorAnimationDelegate> delegate( |
34 new MockWebCompositorAnimationDelegate); | 35 new MockWebCompositorAnimationDelegate); |
35 EXPECT_CALL(*static_cast<MockWebCompositorAnimationDelegate*>(delegate.get()
), | 36 EXPECT_CALL(*static_cast<MockWebCompositorAnimationDelegate*>(delegate.get()
), |
36 notifyAnimationFinished(_, _)) | 37 notifyAnimationFinished(_, _)) |
37 .Times(1); | 38 .Times(1); |
38 | 39 |
39 scoped_ptr<CompositorAnimationPlayer> webPlayer(new CompositorAnimationPlaye
r); | 40 scoped_ptr<CompositorAnimationPlayer> webPlayer(new CompositorAnimationPlaye
r); |
40 cc::AnimationPlayer* player = webPlayer->animationPlayer(); | 41 cc::AnimationPlayer* player = webPlayer->animationPlayer(); |
41 | 42 |
42 webPlayer->setAnimationDelegate(delegate.get()); | 43 webPlayer->setAnimationDelegate(delegate.get()); |
43 player->NotifyAnimationFinished(TimeTicks(), Animation::SCROLL_OFFSET, 0); | 44 player->NotifyAnimationFinished(TimeTicks(), CompositorTargetProperty::SCROL
L_OFFSET, 0); |
44 | 45 |
45 webPlayer->setAnimationDelegate(nullptr); | 46 webPlayer->setAnimationDelegate(nullptr); |
46 player->NotifyAnimationFinished(TimeTicks(), Animation::SCROLL_OFFSET, 0); | 47 player->NotifyAnimationFinished(TimeTicks(), CompositorTargetProperty::SCROL
L_OFFSET, 0); |
47 } | 48 } |
48 | 49 |
49 } // namespace blink | 50 } // namespace blink |
OLD | NEW |