diff options
author | nyquist <nyquist@chromium.org> | 2016-01-15 17:51:10 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-16 01:52:02 +0000 |
commit | 7e179407a1a73a3c03be9dfc7f34f066a1edd3b0 (patch) | |
tree | b5fb6434875611103389c0681b5e78e8b2a28b1c /cc/trees/layer_tree_host_unittest_serialization.cc | |
parent | 249a2659a593710eeb6c9c506c6ba841e3aa4d12 (diff) | |
download | chromium_src-7e179407a1a73a3c03be9dfc7f34f066a1edd3b0.zip chromium_src-7e179407a1a73a3c03be9dfc7f34f066a1edd3b0.tar.gz chromium_src-7e179407a1a73a3c03be9dfc7f34f066a1edd3b0.tar.bz2 |
Add support for (de)serializing HeadsUpDisplayLayer
They LayerTreeHost has a HUD-layer as a member, and as part of the
CL for adding support for (de)serializing the LayerTreeHost,
the test code incorrectly creates a cc:Layer instead
of a cc:HeadsUpDisplayLayer, and this is not checked.
The Linux CFI bot luckily caught this error, so this CL fixes
the error by adding support for the layer type.
The HUD layer has no special members, but do have some special logic
for drawing, so only the type needed to be serialized.
BUG=577972
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1581693010
Cr-Commit-Position: refs/heads/master@{#369916}
Diffstat (limited to 'cc/trees/layer_tree_host_unittest_serialization.cc')
-rw-r--r-- | cc/trees/layer_tree_host_unittest_serialization.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cc/trees/layer_tree_host_unittest_serialization.cc b/cc/trees/layer_tree_host_unittest_serialization.cc index 2f662b6..085b84c 100644 --- a/cc/trees/layer_tree_host_unittest_serialization.cc +++ b/cc/trees/layer_tree_host_unittest_serialization.cc @@ -107,6 +107,19 @@ class LayerTreeHostSerializationTest : public testing::Test { if (layer_tree_host_src_->hud_layer_) { EXPECT_EQ(layer_tree_host_src_->hud_layer_->id(), layer_tree_host_dst_->hud_layer_->id()); + // The HUD layer member is a HeadsUpDisplayLayer instead of Layer, so + // inspect the proto to see if it contains the the right layer type. + bool found_hud_layer_type = false; + for (int i = 0; i < proto.root_layer().children_size(); ++i) { + if (proto.root_layer().children(i).id() == + layer_tree_host_src_->hud_layer_->id()) { + EXPECT_EQ(proto::HEADS_UP_DISPLAY_LAYER, + proto.root_layer().children(i).type()); + found_hud_layer_type = true; + break; + } + } + EXPECT_TRUE(found_hud_layer_type); } else { EXPECT_EQ(nullptr, layer_tree_host_dst_->hud_layer_); } |