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

Unified Diff: cc/layers/layer_unittest.cc

Issue 1405993008: compositor-worker: plumb element id and mutable properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix rebase error. 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 side-by-side diff with in-line comments
Download patch
Index: cc/layers/layer_unittest.cc
diff --git a/cc/layers/layer_unittest.cc b/cc/layers/layer_unittest.cc
index 212dff10e01700c246391b598abe0298874d49d4..30d182482b8d2a36681e1a5e5befeda72ccc9394 100644
--- a/cc/layers/layer_unittest.cc
+++ b/cc/layers/layer_unittest.cc
@@ -6,6 +6,7 @@
#include "base/thread_task_runner_handle.h"
#include "cc/animation/keyframed_animation_curve.h"
+#include "cc/animation/mutable_properties.h"
#include "cc/base/math_util.h"
#include "cc/layers/layer_impl.h"
#include "cc/layers/layer_settings.h"
@@ -636,6 +637,9 @@ TEST_F(LayerTest, CheckPropertyChangeCausesCorrectBehavior) {
gfx::Rect(10, 10)));
EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetForceRenderSurface(true));
EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetHideLayerAndSubtree(true));
+ EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetElementId(2));
+ EXPECT_SET_NEEDS_COMMIT(
+ 1, test_layer->SetMutableProperties(kMutablePropertyTransform));
EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, test_layer->SetMaskLayer(
dummy_layer1.get()));
@@ -1704,5 +1708,27 @@ TEST_F(LayerTest, SimplePropertiesDeserialization) {
EXPECT_FALSE(layer->descendant_needs_push_properties());
}
+TEST_F(LayerTest, ElementIdAndMutablePropertiesArePushed) {
+ scoped_refptr<Layer> test_layer = Layer::Create(layer_settings_);
+ scoped_ptr<LayerImpl> impl_layer =
+ LayerImpl::Create(host_impl_.active_tree(), 1);
+
+ EXPECT_SET_NEEDS_FULL_TREE_SYNC(1,
+ layer_tree_host_->SetRootLayer(test_layer));
+
+ EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(2);
+
+ test_layer->SetElementId(2);
+ test_layer->SetMutableProperties(kMutablePropertyTransform);
+
+ EXPECT_EQ(0lu, impl_layer->element_id());
+ EXPECT_EQ(kMutablePropertyNone, impl_layer->mutable_properties());
+
+ test_layer->PushPropertiesTo(impl_layer.get());
+
+ EXPECT_EQ(2lu, impl_layer->element_id());
+ EXPECT_EQ(kMutablePropertyTransform, impl_layer->mutable_properties());
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/layers/layer_impl_unittest.cc ('k') | third_party/WebKit/LayoutTests/media/track/track-delete-during-setup.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698