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

Unified Diff: cc/trees/layer_tree_host_unittest_serialization.cc

Issue 1581693010: Add support for (de)serializing HeadsUpDisplayLayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix naming nit Created 4 years, 11 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
« no previous file with comments | « cc/proto/layer.proto ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest_serialization.cc
diff --git a/cc/trees/layer_tree_host_unittest_serialization.cc b/cc/trees/layer_tree_host_unittest_serialization.cc
index 2f662b6e218ac88173e3f049a69a72d941faaa24..085b84c11effaad61cb4f2abb2c2d77ac1786210 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_);
}
« no previous file with comments | « cc/proto/layer.proto ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698