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

Unified Diff: cc/layers/texture_layer_unittest.cc

Issue 2183403002: cc: Move data to LayerTree from LayerTreeHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@layer_tree_change
Patch Set: remove unused test file. Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: cc/layers/texture_layer_unittest.cc
diff --git a/cc/layers/texture_layer_unittest.cc b/cc/layers/texture_layer_unittest.cc
index eaf59bb3e1329d28d4d50b11684821712d7855ef..9454055474f15442cdc8041d2497e16afc835fe6 100644
--- a/cc/layers/texture_layer_unittest.cc
+++ b/cc/layers/texture_layer_unittest.cc
@@ -220,8 +220,9 @@ class TextureLayerTest : public testing::Test {
void SetUp() override {
layer_tree_host_ =
MockLayerTreeHost::Create(&fake_client_, &task_graph_runner_);
+ layer_tree_ = layer_tree_host_->GetLayerTree();
EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(AnyNumber());
- layer_tree_host_->SetViewportSize(gfx::Size(10, 10));
+ layer_tree_->SetViewportSize(gfx::Size(10, 10));
Mock::VerifyAndClearExpectations(layer_tree_host_.get());
}
@@ -229,11 +230,12 @@ class TextureLayerTest : public testing::Test {
Mock::VerifyAndClearExpectations(layer_tree_host_.get());
EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(AnyNumber());
- layer_tree_host_->SetRootLayer(nullptr);
+ layer_tree_->SetRootLayer(nullptr);
layer_tree_host_ = nullptr;
}
std::unique_ptr<MockLayerTreeHost> layer_tree_host_;
+ LayerTree* layer_tree_;
FakeImplTaskRunnerProvider task_runner_provider_;
FakeLayerTreeHostClient fake_client_;
TestSharedBitmapManager shared_bitmap_manager_;
@@ -246,7 +248,7 @@ class TextureLayerTest : public testing::Test {
TEST_F(TextureLayerTest, CheckPropertyChangeCausesCorrectBehavior) {
scoped_refptr<TextureLayer> test_layer =
TextureLayer::CreateForMailbox(nullptr);
- EXPECT_SET_NEEDS_COMMIT(1, layer_tree_host_->SetRootLayer(test_layer));
+ EXPECT_SET_NEEDS_COMMIT(1, layer_tree_->SetRootLayer(test_layer));
// Test properties that should call SetNeedsCommit. All properties need to
// be set to new values in order for SetNeedsCommit to be called.
@@ -286,7 +288,7 @@ TEST_F(TextureLayerWithMailboxTest, ReplaceMailboxOnMainThreadBeforeCommit) {
ASSERT_TRUE(test_layer.get());
EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(AnyNumber());
- layer_tree_host_->SetRootLayer(test_layer);
+ layer_tree_->SetRootLayer(test_layer);
Mock::VerifyAndClearExpectations(layer_tree_host_.get());
EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(AtLeast(1));
@@ -688,8 +690,8 @@ class TextureLayerImplWithMailboxThreadedCallback : public LayerTreeTest {
layer_->SetBounds(bounds);
root_->AddChild(layer_);
- layer_tree_host()->SetRootLayer(root_);
- layer_tree_host()->SetViewportSize(bounds);
+ layer_tree()->SetRootLayer(root_);
+ layer_tree()->SetViewportSize(bounds);
SetMailbox('1');
EXPECT_EQ(0, callback_count_);
@@ -789,8 +791,8 @@ class TextureLayerMailboxIsActivatedDuringCommit : public LayerTreeTest {
layer_->SetBounds(bounds);
root_->AddChild(layer_);
- layer_tree_host()->SetRootLayer(root_);
- layer_tree_host()->SetViewportSize(bounds);
+ layer_tree()->SetRootLayer(root_);
+ layer_tree()->SetViewportSize(bounds);
SetMailbox('1');
PostSetNeedsCommitToMainThread();
@@ -850,6 +852,7 @@ class TextureLayerImplWithMailboxTest : public TextureLayerTest {
TextureLayerTest::SetUp();
layer_tree_host_ =
MockLayerTreeHost::Create(&fake_client_, &task_graph_runner_);
+ layer_tree_ = layer_tree_host_->GetLayerTree();
host_impl_.SetVisible(true);
EXPECT_TRUE(host_impl_.InitializeRenderer(output_surface_.get()));
}
@@ -1080,7 +1083,7 @@ class TextureLayerNoExtraCommitForMailboxTest
texture_layer_->SetIsDrawable(true);
root->AddChild(texture_layer_);
- layer_tree_host()->SetRootLayer(root);
+ layer_tree()->SetRootLayer(root);
LayerTreeTest::SetupTree();
}
@@ -1172,7 +1175,7 @@ class TextureLayerChangeInvisibleMailboxTest
texture_layer_->SetIsDrawable(true);
parent_layer_->AddChild(texture_layer_);
- layer_tree_host()->SetRootLayer(root);
+ layer_tree()->SetRootLayer(root);
LayerTreeTest::SetupTree();
}
@@ -1270,7 +1273,7 @@ class TextureLayerReleaseResourcesBase
texture_layer->SetBounds(gfx::Size(10, 10));
texture_layer->SetIsDrawable(true);
- layer_tree_host()->root_layer()->AddChild(texture_layer);
+ layer_tree()->root_layer()->AddChild(texture_layer);
texture_layer_id_ = texture_layer->id();
}
@@ -1344,8 +1347,8 @@ class TextureLayerWithMailboxMainThreadDeleted : public LayerTreeTest {
layer_->SetBounds(bounds);
root_->AddChild(layer_);
- layer_tree_host()->SetRootLayer(root_);
- layer_tree_host()->SetViewportSize(bounds);
+ layer_tree()->SetRootLayer(root_);
+ layer_tree()->SetViewportSize(bounds);
}
void BeginTest() override {
@@ -1414,8 +1417,8 @@ class TextureLayerWithMailboxImplThreadDeleted : public LayerTreeTest {
layer_->SetBounds(bounds);
root_->AddChild(layer_);
- layer_tree_host()->SetRootLayer(root_);
- layer_tree_host()->SetViewportSize(bounds);
+ layer_tree()->SetRootLayer(root_);
+ layer_tree()->SetViewportSize(bounds);
}
void BeginTest() override {

Powered by Google App Engine
This is Rietveld 408576698