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

Unified Diff: cc/layers/ui_resource_layer_unittest.cc

Issue 471233002: Removing the assumption that child->SetParent will not change Drawability (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/ui_resource_layer_unittest.cc
diff --git a/cc/layers/ui_resource_layer_unittest.cc b/cc/layers/ui_resource_layer_unittest.cc
index f6a460e018b54beeec0940a013566a1851ce04d6..b38a9bb2840223819097d4404fc15c4b76fd1b3b 100644
--- a/cc/layers/ui_resource_layer_unittest.cc
+++ b/cc/layers/ui_resource_layer_unittest.cc
@@ -102,5 +102,24 @@ TEST_F(UIResourceLayerTest, SetUIResourceId) {
EXPECT_TRUE(test_layer->DrawsContent());
}
+TEST_F(UIResourceLayerTest, SetUIResourceIdOrdering) {
+ scoped_refptr<Layer> test_root = Layer::Create();
+ layer_tree_host_->SetRootLayer(test_root);
+
+ scoped_refptr<UIResourceLayer> test_layer = UIResourceLayer::Create();
+ ASSERT_TRUE(test_layer.get());
+ test_layer->SetIsDrawable(true);
+ test_layer->SetBounds(gfx::Size(100, 100));
+
+ bool is_opaque = false;
+ scoped_ptr<ScopedUIResource> resource = ScopedUIResource::Create(
+ layer_tree_host_.get(), UIResourceBitmap(gfx::Size(10, 10), is_opaque));
+ test_layer->SetUIResourceId(resource->id());
+
+ EXPECT_TRUE(test_layer->DrawsContent());
+ test_root->AddChild(test_layer);
+ EXPECT_FALSE(test_layer->DrawsContent());
danakj 2014/08/14 22:00:14 Can you do this test with a test-only override of
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/layers/layer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698