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

Unified Diff: content/test/web_layer_tree_view_impl_for_testing.cc

Issue 1413373007: CC AnimationHost: Fix LinkHighlights detach scope. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: GC. Created 5 years, 1 month 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: content/test/web_layer_tree_view_impl_for_testing.cc
diff --git a/content/test/web_layer_tree_view_impl_for_testing.cc b/content/test/web_layer_tree_view_impl_for_testing.cc
index 8b07ba26e9cc11f7ad4c170070c3cda8b196c9a0..a70aa245306638f9dfa4cc9c089f5a415844edea 100644
--- a/content/test/web_layer_tree_view_impl_for_testing.cc
+++ b/content/test/web_layer_tree_view_impl_for_testing.cc
@@ -8,7 +8,10 @@
#include "base/strings/string_number_conversions.h"
#include "base/synchronization/lock.h"
#include "base/thread_task_runner_handle.h"
+#include "cc/animation/animation_host.h"
+#include "cc/animation/animation_timeline.h"
#include "cc/base/switches.h"
+#include "cc/blink/web_compositor_animation_timeline_impl.h"
#include "cc/blink/web_layer_impl.h"
#include "cc/input/input_handler.h"
#include "cc/layers/layer.h"
@@ -58,6 +61,26 @@ void WebLayerTreeViewImplForTesting::clearRootLayer() {
layer_tree_host_->SetRootLayer(scoped_refptr<cc::Layer>());
}
+void WebLayerTreeViewImplForTesting::attachCompositorAnimationTimeline(
+ blink::WebCompositorAnimationTimeline* compositor_timeline) {
+ DCHECK(compositor_timeline);
+ DCHECK(layer_tree_host_->animation_host());
+ layer_tree_host_->animation_host()->AddAnimationTimeline(
+ static_cast<const cc_blink::WebCompositorAnimationTimelineImpl*>(
+ compositor_timeline)
+ ->animation_timeline());
+}
+
+void WebLayerTreeViewImplForTesting::detachCompositorAnimationTimeline(
+ blink::WebCompositorAnimationTimeline* compositor_timeline) {
+ DCHECK(compositor_timeline);
+ DCHECK(layer_tree_host_->animation_host());
+ layer_tree_host_->animation_host()->RemoveAnimationTimeline(
+ static_cast<const cc_blink::WebCompositorAnimationTimelineImpl*>(
+ compositor_timeline)
+ ->animation_timeline());
+}
+
void WebLayerTreeViewImplForTesting::setViewportSize(
const WebSize& unused_deprecated,
const WebSize& device_viewport_size) {

Powered by Google App Engine
This is Rietveld 408576698