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

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

Issue 1950243005: Communicate MT changes to impl-only scroll offset animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: attempt to fix rebase issue Created 4 years, 7 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/CompositorAnimationTimeline.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 "cc/animation/animation_host.h" 8 #include "platform/animation/CompositorAnimationTimeline.h"
9 #include "platform/animation/CompositorAnimationPlayer.h"
10 #include "platform/testing/CompositorTest.h" 9 #include "platform/testing/CompositorTest.h"
11 #include "platform/testing/WebLayerTreeViewImplForTesting.h" 10 #include "platform/testing/WebLayerTreeViewImplForTesting.h"
12 11
13 namespace blink { 12 namespace blink {
14 13
15 class CompositorAnimationTimelineTest : public CompositorTest { 14 class CompositorAnimationHostTest : public CompositorTest {
16 }; 15 };
17 16
18 TEST_F(CompositorAnimationTimelineTest, CompositorTimelineDeletionDetachesFromAn imationHost) 17 TEST_F(CompositorAnimationHostTest, AnimationHostNullWhenTimelineDetached)
19 { 18 {
20 OwnPtr<CompositorAnimationTimeline> timeline = adoptPtr(new CompositorAnimat ionTimeline); 19 OwnPtr<CompositorAnimationTimeline> timeline = adoptPtr(new CompositorAnimat ionTimeline);
21 20
22 scoped_refptr<cc::AnimationTimeline> ccTimeline = timeline->animationTimelin e(); 21 scoped_refptr<cc::AnimationTimeline> ccTimeline = timeline->animationTimelin e();
23 EXPECT_FALSE(ccTimeline->animation_host()); 22 EXPECT_FALSE(ccTimeline->animation_host());
23 EXPECT_TRUE(timeline->compositorAnimationHost().isNull());
24 24
25 OwnPtr<WebLayerTreeView> layerTreeHost = adoptPtr(new WebLayerTreeViewImplFo rTesting); 25 OwnPtr<WebLayerTreeView> layerTreeHost = adoptPtr(new WebLayerTreeViewImplFo rTesting);
26 DCHECK(layerTreeHost); 26 DCHECK(layerTreeHost);
27 27
28 layerTreeHost->attachCompositorAnimationTimeline(timeline->animationTimeline ()); 28 layerTreeHost->attachCompositorAnimationTimeline(timeline->animationTimeline ());
29 cc::AnimationHost* animationHost = ccTimeline->animation_host(); 29 EXPECT_FALSE(timeline->compositorAnimationHost().isNull());
30 EXPECT_TRUE(animationHost);
31 EXPECT_TRUE(animationHost->GetTimelineById(ccTimeline->id()));
32 30
33 // Delete CompositorAnimationTimeline while attached to host. 31 layerTreeHost->detachCompositorAnimationTimeline(timeline->animationTimeline ());
34 timeline = nullptr; 32 EXPECT_TRUE(timeline->compositorAnimationHost().isNull());
35
36 EXPECT_FALSE(ccTimeline->animation_host());
37 EXPECT_FALSE(animationHost->GetTimelineById(ccTimeline->id()));
38 } 33 }
39 34
40 } // namespace blink 35 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698