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

Unified Diff: third_party/WebKit/Source/platform/animation/CompositorAnimationHostTest.cpp

Issue 2559273003: Blink Compositor Animation: Introduce CompositorAnimationHost correctly. (Closed)
Patch Set: Add nullcheck for m_layerTreeView in WebViewImpl Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/animation/CompositorAnimationHostTest.cpp
diff --git a/third_party/WebKit/Source/platform/animation/CompositorAnimationHostTest.cpp b/third_party/WebKit/Source/platform/animation/CompositorAnimationHostTest.cpp
index d564b80f535556ed43930eeedd4e8ac47594c605..55916ee8a7e1c70e46cb340ce9c413972e20c9bc 100644
--- a/third_party/WebKit/Source/platform/animation/CompositorAnimationHostTest.cpp
+++ b/third_party/WebKit/Source/platform/animation/CompositorAnimationHostTest.cpp
@@ -22,19 +22,19 @@ TEST_F(CompositorAnimationHostTest, AnimationHostNullWhenTimelineDetached) {
scoped_refptr<cc::AnimationTimeline> ccTimeline =
timeline->animationTimeline();
EXPECT_FALSE(ccTimeline->animation_host());
- EXPECT_TRUE(timeline->compositorAnimationHost().isNull());
std::unique_ptr<WebLayerTreeView> layerTreeHost =
WTF::wrapUnique(new WebLayerTreeViewImplForTesting);
DCHECK(layerTreeHost);
- layerTreeHost->attachCompositorAnimationTimeline(
- timeline->animationTimeline());
- EXPECT_FALSE(timeline->compositorAnimationHost().isNull());
+ auto compositorAnimationHost = WTF::makeUnique<CompositorAnimationHost>(
+ layerTreeHost->compositorAnimationHost());
- layerTreeHost->detachCompositorAnimationTimeline(
- timeline->animationTimeline());
- EXPECT_TRUE(timeline->compositorAnimationHost().isNull());
+ compositorAnimationHost->addTimeline(timeline.get());
+ EXPECT_TRUE(ccTimeline->animation_host());
+
+ compositorAnimationHost->removeTimeline(timeline.get());
+ EXPECT_FALSE(ccTimeline->animation_host());
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698