OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/layers/layer_proto_converter.h" | 5 #include "cc/layers/layer_proto_converter.h" |
6 | 6 |
7 #include "cc/layers/empty_content_layer_client.h" | 7 #include "cc/layers/empty_content_layer_client.h" |
8 #include "cc/layers/heads_up_display_layer.h" | 8 #include "cc/layers/heads_up_display_layer.h" |
9 #include "cc/layers/layer.h" | 9 #include "cc/layers/layer.h" |
10 #include "cc/layers/picture_layer.h" | 10 #include "cc/layers/picture_layer.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 FakeLayerTreeHost::Create(&fake_client_, &task_graph_runner_); | 28 FakeLayerTreeHost::Create(&fake_client_, &task_graph_runner_); |
29 } | 29 } |
30 | 30 |
31 void TearDown() override { | 31 void TearDown() override { |
32 layer_tree_host_->SetRootLayer(nullptr); | 32 layer_tree_host_->SetRootLayer(nullptr); |
33 layer_tree_host_ = nullptr; | 33 layer_tree_host_ = nullptr; |
34 } | 34 } |
35 | 35 |
36 TestTaskGraphRunner task_graph_runner_; | 36 TestTaskGraphRunner task_graph_runner_; |
37 FakeLayerTreeHostClient fake_client_; | 37 FakeLayerTreeHostClient fake_client_; |
38 scoped_ptr<FakeLayerTreeHost> layer_tree_host_; | 38 std::unique_ptr<FakeLayerTreeHost> layer_tree_host_; |
39 }; | 39 }; |
40 | 40 |
41 TEST_F(LayerProtoConverterTest, TestKeepingRoot) { | 41 TEST_F(LayerProtoConverterTest, TestKeepingRoot) { |
42 /* Test deserialization of a tree that looks like: | 42 /* Test deserialization of a tree that looks like: |
43 root | 43 root |
44 / \ | 44 / \ |
45 a b | 45 a b |
46 \ | 46 \ |
47 c | 47 c |
48 The old root node will be reused during deserialization. | 48 The old root node will be reused during deserialization. |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 // serialize to. | 396 // serialize to. |
397 proto::LayerNode layer_node; | 397 proto::LayerNode layer_node; |
398 new_root->SetTypeForProtoSerialization(&layer_node); | 398 new_root->SetTypeForProtoSerialization(&layer_node); |
399 EXPECT_EQ(proto::LayerNode::HEADS_UP_DISPLAY_LAYER, layer_node.type()); | 399 EXPECT_EQ(proto::LayerNode::HEADS_UP_DISPLAY_LAYER, layer_node.type()); |
400 | 400 |
401 new_root->SetLayerTreeHost(nullptr); | 401 new_root->SetLayerTreeHost(nullptr); |
402 } | 402 } |
403 | 403 |
404 } // namespace | 404 } // namespace |
405 } // namespace cc | 405 } // namespace cc |
OLD | NEW |