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

Side by Side Diff: third_party/WebKit/Source/platform/animation/CompositorAnimationHostTest.cpp

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. 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 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/CompositorAnimationHost.h" 5 #include "platform/animation/CompositorAnimationHost.h"
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "platform/animation/CompositorAnimationTimeline.h" 8 #include "platform/animation/CompositorAnimationTimeline.h"
9 #include "platform/testing/CompositorTest.h" 9 #include "platform/testing/CompositorTest.h"
10 #include "platform/testing/WebLayerTreeViewImplForTesting.h" 10 #include "platform/testing/WebLayerTreeViewImplForTesting.h"
11 #include "wtf/PtrUtil.h"
12 #include <memory>
11 13
12 namespace blink { 14 namespace blink {
13 15
14 class CompositorAnimationHostTest : public CompositorTest { 16 class CompositorAnimationHostTest : public CompositorTest {
15 }; 17 };
16 18
17 TEST_F(CompositorAnimationHostTest, AnimationHostNullWhenTimelineDetached) 19 TEST_F(CompositorAnimationHostTest, AnimationHostNullWhenTimelineDetached)
18 { 20 {
19 OwnPtr<CompositorAnimationTimeline> timeline = CompositorAnimationTimeline:: create(); 21 std::unique_ptr<CompositorAnimationTimeline> timeline = CompositorAnimationT imeline::create();
20 22
21 scoped_refptr<cc::AnimationTimeline> ccTimeline = timeline->animationTimelin e(); 23 scoped_refptr<cc::AnimationTimeline> ccTimeline = timeline->animationTimelin e();
22 EXPECT_FALSE(ccTimeline->animation_host()); 24 EXPECT_FALSE(ccTimeline->animation_host());
23 EXPECT_TRUE(timeline->compositorAnimationHost().isNull()); 25 EXPECT_TRUE(timeline->compositorAnimationHost().isNull());
24 26
25 OwnPtr<WebLayerTreeView> layerTreeHost = adoptPtr(new WebLayerTreeViewImplFo rTesting); 27 std::unique_ptr<WebLayerTreeView> layerTreeHost = wrapUnique(new WebLayerTre eViewImplForTesting);
26 DCHECK(layerTreeHost); 28 DCHECK(layerTreeHost);
27 29
28 layerTreeHost->attachCompositorAnimationTimeline(timeline->animationTimeline ()); 30 layerTreeHost->attachCompositorAnimationTimeline(timeline->animationTimeline ());
29 EXPECT_FALSE(timeline->compositorAnimationHost().isNull()); 31 EXPECT_FALSE(timeline->compositorAnimationHost().isNull());
30 32
31 layerTreeHost->detachCompositorAnimationTimeline(timeline->animationTimeline ()); 33 layerTreeHost->detachCompositorAnimationTimeline(timeline->animationTimeline ());
32 EXPECT_TRUE(timeline->compositorAnimationHost().isNull()); 34 EXPECT_TRUE(timeline->compositorAnimationHost().isNull());
33 } 35 }
34 36
35 } // namespace blink 37 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698