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

Unified Diff: cc/layers/texture_layer_unittest.cc

Issue 1126253005: cc: Add LayerTreeHost::InitParams for LayerTreeHost creation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: all Created 5 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 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 3bd90ec5782195eeb21c197ace139f70057bdb83..2a54e7efd0bd2b66942b8502ffe2030d0d578d58 100644
--- a/cc/layers/texture_layer_unittest.cc
+++ b/cc/layers/texture_layer_unittest.cc
@@ -54,16 +54,24 @@ gpu::Mailbox MailboxFromChar(char value) {
class MockLayerTreeHost : public LayerTreeHost {
public:
- explicit MockLayerTreeHost(FakeLayerTreeHostClient* client)
- : LayerTreeHost(client, nullptr, nullptr, nullptr, LayerTreeSettings()) {
- InitializeSingleThreaded(client, base::ThreadTaskRunnerHandle::Get(),
- nullptr);
+ static scoped_ptr<MockLayerTreeHost> Create(FakeLayerTreeHostClient* client) {
+ LayerTreeHost::InitParams params;
+ params.client = client;
+ return make_scoped_ptr(new MockLayerTreeHost(client, &params));
}
MOCK_METHOD0(SetNeedsCommit, void());
MOCK_METHOD0(SetNeedsUpdateLayers, void());
MOCK_METHOD0(StartRateLimiter, void());
MOCK_METHOD0(StopRateLimiter, void());
+
+ private:
+ MockLayerTreeHost(FakeLayerTreeHostClient* client,
+ LayerTreeHost::InitParams* params)
+ : LayerTreeHost(params) {
+ InitializeSingleThreaded(client, base::ThreadTaskRunnerHandle::Get(),
+ nullptr);
+ }
};
class FakeTextureLayerClient : public TextureLayerClient {
@@ -180,7 +188,7 @@ class TextureLayerTest : public testing::Test {
protected:
void SetUp() override {
- layer_tree_host_.reset(new MockLayerTreeHost(&fake_client_));
+ layer_tree_host_ = MockLayerTreeHost::Create(&fake_client_);
EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(AnyNumber());
layer_tree_host_->SetViewportSize(gfx::Size(10, 10));
Mock::VerifyAndClearExpectations(layer_tree_host_.get());
@@ -908,7 +916,7 @@ class TextureLayerImplWithMailboxTest : public TextureLayerTest {
void SetUp() override {
TextureLayerTest::SetUp();
- layer_tree_host_.reset(new MockLayerTreeHost(&fake_client_));
+ layer_tree_host_ = MockLayerTreeHost::Create(&fake_client_);
EXPECT_TRUE(host_impl_.InitializeRenderer(FakeOutputSurface::Create3d()));
}

Powered by Google App Engine
This is Rietveld 408576698