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

Unified Diff: cc/layers/layer_unittest.cc

Issue 2716583004: cc: Remove SetNeedsUpdate function from cc::Layer (Closed)
Patch Set: add/edit/transport comments Created 3 years, 10 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/layers/layer.cc ('k') | cc/test/layer_internals_for_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_unittest.cc
diff --git a/cc/layers/layer_unittest.cc b/cc/layers/layer_unittest.cc
index 04afe16b45d3c1292ba5d2b752bd499a61e73d55..1a227ca01aeb877cc50b945bcdd2676d320102d6 100644
--- a/cc/layers/layer_unittest.cc
+++ b/cc/layers/layer_unittest.cc
@@ -23,7 +23,6 @@
#include "cc/test/fake_layer_tree_host_client.h"
#include "cc/test/fake_layer_tree_host_impl.h"
#include "cc/test/geometry_test_utils.h"
-#include "cc/test/layer_internals_for_test.h"
#include "cc/test/layer_test_common.h"
#include "cc/test/stub_layer_tree_host_single_thread_client.h"
#include "cc/test/test_task_graph_runner.h"
@@ -1382,25 +1381,31 @@ TEST_F(LayerTest, DedupesCopyOutputRequestsBySource) {
}
TEST_F(LayerTest, AnimationSchedulesLayerUpdate) {
+ // TODO(weiliangc): This is really a LayerTreeHost unittest by this point,
+ // though currently there is no good place for this unittest to go. Move to
+ // LayerTreeHost unittest when there is a good setup.
scoped_refptr<Layer> layer = Layer::Create();
+ layer->SetElementId(ElementId(2, 0));
EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, layer_tree_host_->SetRootLayer(layer));
-
- LayerInternalsForTest layer_internals(layer.get());
+ auto element_id = layer->element_id();
EXPECT_CALL(*layer_tree_host_, SetNeedsUpdateLayers()).Times(1);
- layer_internals.OnOpacityAnimated(0.5f);
+ layer_tree_host_->SetElementOpacityMutated(element_id,
+ ElementListType::ACTIVE, 0.5f);
Mock::VerifyAndClearExpectations(layer_tree_host_.get());
EXPECT_CALL(*layer_tree_host_, SetNeedsUpdateLayers()).Times(1);
gfx::Transform transform;
transform.Rotate(45.0);
- layer_internals.OnTransformAnimated(transform);
+ layer_tree_host_->SetElementTransformMutated(
+ element_id, ElementListType::ACTIVE, transform);
Mock::VerifyAndClearExpectations(layer_tree_host_.get());
// Scroll offset animation should not schedule a layer update since it is
// handled similarly to normal compositor scroll updates.
EXPECT_CALL(*layer_tree_host_, SetNeedsUpdateLayers()).Times(0);
- layer_internals.OnScrollOffsetAnimated(gfx::ScrollOffset(10, 10));
+ layer_tree_host_->SetElementScrollOffsetMutated(
+ element_id, ElementListType::ACTIVE, gfx::ScrollOffset(10, 10));
Mock::VerifyAndClearExpectations(layer_tree_host_.get());
}
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/test/layer_internals_for_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698