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

Side by Side Diff: cc/layers/layer_unittest.cc

Issue 1547893003: WIP - compositor worker mega patch. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/test/fake_layer_tree_host_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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.h" 5 #include "cc/layers/layer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/thread_task_runner_handle.h" 9 #include "base/thread_task_runner_handle.h"
10 #include "cc/animation/keyframed_animation_curve.h" 10 #include "cc/animation/keyframed_animation_curve.h"
(...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after
1890 proto::LayerNode proto2; 1890 proto::LayerNode proto2;
1891 layer_src_root->ToLayerNodeProto(&proto2); 1891 layer_src_root->ToLayerNodeProto(&proto2);
1892 1892
1893 // Deserialization 2. 1893 // Deserialization 2.
1894 layer_dest_root->FromLayerNodeProto(proto2, dest_layer_map); 1894 layer_dest_root->FromLayerNodeProto(proto2, dest_layer_map);
1895 1895
1896 EXPECT_EQ(nullptr, layer_dest_root->mask_layer()); 1896 EXPECT_EQ(nullptr, layer_dest_root->mask_layer());
1897 EXPECT_EQ(nullptr, layer_dest_root->replica_layer()); 1897 EXPECT_EQ(nullptr, layer_dest_root->replica_layer());
1898 } 1898 }
1899 1899
1900 TEST_F(LayerTest, ElementIdAndMutablePropertiesArePushed) {
1901 scoped_refptr<Layer> test_layer = Layer::Create(layer_settings_);
1902 scoped_ptr<LayerImpl> impl_layer =
1903 LayerImpl::Create(host_impl_.active_tree(), 1);
1904
1905 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1,
1906 layer_tree_host_->SetRootLayer(test_layer));
1907
1908 EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(2);
1909
1910 test_layer->SetElementId(2);
1911 test_layer->SetMutableProperties(kMutablePropertyTransform);
1912
1913 EXPECT_EQ(0lu, impl_layer->element_id());
1914 EXPECT_EQ(kMutablePropertyNone, impl_layer->mutable_properties());
1915
1916 test_layer->PushPropertiesTo(impl_layer.get());
1917
1918 EXPECT_EQ(2lu, impl_layer->element_id());
1919 EXPECT_EQ(kMutablePropertyTransform, impl_layer->mutable_properties());
1920 }
1921
1900 TEST_F(LayerTest, SimplePropertiesSerialization) { 1922 TEST_F(LayerTest, SimplePropertiesSerialization) {
1901 /* Testing serialization of properties for a tree that looks like this: 1923 /* Testing serialization of properties for a tree that looks like this:
1902 root+ 1924 root+
1903 / \ 1925 / \
1904 a* b*+[mask:*,replica] 1926 a* b*+[mask:*,replica]
1905 / \ 1927 / \
1906 c d* 1928 c d*
1907 Layers marked with * have changed properties. 1929 Layers marked with * have changed properties.
1908 Layers marked with + have descendants with changed properties. 1930 Layers marked with + have descendants with changed properties.
1909 Layer b also has a mask layer and a replica layer. 1931 Layer b also has a mask layer and a replica layer.
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
2068 EXPECT_EQ(kMutablePropertyNone, impl_layer->mutable_properties()); 2090 EXPECT_EQ(kMutablePropertyNone, impl_layer->mutable_properties());
2069 2091
2070 test_layer->PushPropertiesTo(impl_layer.get()); 2092 test_layer->PushPropertiesTo(impl_layer.get());
2071 2093
2072 EXPECT_EQ(2lu, impl_layer->element_id()); 2094 EXPECT_EQ(2lu, impl_layer->element_id());
2073 EXPECT_EQ(kMutablePropertyTransform, impl_layer->mutable_properties()); 2095 EXPECT_EQ(kMutablePropertyTransform, impl_layer->mutable_properties());
2074 } 2096 }
2075 2097
2076 } // namespace 2098 } // namespace
2077 } // namespace cc 2099 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/test/fake_layer_tree_host_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698