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

Unified Diff: cc/layers/surface_layer_unittest.cc

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 Created 4 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
« no previous file with comments | « cc/layers/solid_color_layer_impl_unittest.cc ('k') | cc/layers/texture_layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/surface_layer_unittest.cc
diff --git a/cc/layers/surface_layer_unittest.cc b/cc/layers/surface_layer_unittest.cc
index 3ed3d7e8e6127bdb29396d63d608c771aa87c87b..7a76cd77e01dac6467ee3a2b4410166a68410bbc 100644
--- a/cc/layers/surface_layer_unittest.cc
+++ b/cc/layers/surface_layer_unittest.cc
@@ -10,6 +10,7 @@
#include "base/location.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "cc/animation/animation_host.h"
#include "cc/layers/solid_color_layer.h"
#include "cc/layers/surface_layer.h"
#include "cc/output/compositor_frame.h"
@@ -32,8 +33,9 @@ static constexpr FrameSinkId kArbitraryFrameSinkId(1, 1);
class SurfaceLayerTest : public testing::Test {
protected:
void SetUp() override {
- layer_tree_host_ =
- FakeLayerTreeHost::Create(&fake_client_, &task_graph_runner_);
+ animation_host_ = AnimationHost::CreateForTesting(ThreadInstance::MAIN);
+ layer_tree_host_ = FakeLayerTreeHost::Create(
+ &fake_client_, &task_graph_runner_, animation_host_.get());
layer_tree_ = layer_tree_host_->GetLayerTree();
layer_tree_->SetViewportSize(gfx::Size(10, 10));
}
@@ -47,6 +49,7 @@ class SurfaceLayerTest : public testing::Test {
FakeLayerTreeHostClient fake_client_;
TestTaskGraphRunner task_graph_runner_;
+ std::unique_ptr<AnimationHost> animation_host_;
std::unique_ptr<FakeLayerTreeHost> layer_tree_host_;
LayerTree* layer_tree_;
};
@@ -79,8 +82,10 @@ TEST_F(SurfaceLayerTest, MultipleFramesOneSurface) {
FrameSinkId(1, 1));
layer_tree_->SetRootLayer(layer);
+ auto animation_host2 = AnimationHost::CreateForTesting(ThreadInstance::MAIN);
std::unique_ptr<FakeLayerTreeHost> layer_tree_host2 =
- FakeLayerTreeHost::Create(&fake_client_, &task_graph_runner_);
+ FakeLayerTreeHost::Create(&fake_client_, &task_graph_runner_,
+ animation_host2.get());
scoped_refptr<SurfaceLayer> layer2(SurfaceLayer::Create(
base::Bind(&SatisfyCallback, &blank_change),
base::Bind(&RequireCallback, &required_id, &required_seq)));
@@ -98,6 +103,7 @@ TEST_F(SurfaceLayerTest, MultipleFramesOneSurface) {
layer_tree_host2->SetRootLayer(nullptr);
layer_tree_host2.reset();
+ animation_host2 = nullptr;
// Layer was removed so sequence from second LayerTreeHost should be
// satisfied.
« no previous file with comments | « cc/layers/solid_color_layer_impl_unittest.cc ('k') | cc/layers/texture_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698