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

Unified Diff: ui/gfx/compositor/layer_unittest.cc

Issue 8561014: Fixes some asserts in compositor_unittests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | « ui/gfx/compositor/compositor.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/compositor/layer_unittest.cc
diff --git a/ui/gfx/compositor/layer_unittest.cc b/ui/gfx/compositor/layer_unittest.cc
index 703f9ca93caf1417ef6b1624504e04746926302e..5e5fa5544e6da9fb41fffbe522fab99db54e941c 100644
--- a/ui/gfx/compositor/layer_unittest.cc
+++ b/ui/gfx/compositor/layer_unittest.cc
@@ -1106,27 +1106,29 @@ TEST_F(LayerWithRealCompositorTest, MAYBE_DrawPixels) {
// Checks the logic around Compositor::SetRootLayer and Layer::SetCompositor.
TEST_F(LayerWithRealCompositorTest, MAYBE_SetRootLayer) {
Compositor* compositor = GetCompositor();
- Layer l1;
- EXPECT_EQ(NULL, l1.GetCompositor());
+ scoped_ptr<Layer> l1(CreateColorLayer(SK_ColorRED,
+ gfx::Rect(20, 20, 400, 400)));
+ scoped_ptr<Layer> l2(CreateColorLayer(SK_ColorBLUE,
+ gfx::Rect(10, 10, 350, 350)));
- Layer l2;
- EXPECT_EQ(NULL, l2.GetCompositor());
+ EXPECT_EQ(NULL, l1->GetCompositor());
+ EXPECT_EQ(NULL, l2->GetCompositor());
- compositor->SetRootLayer(&l1);
- EXPECT_EQ(compositor, l1.GetCompositor());
+ compositor->SetRootLayer(l1.get());
+ EXPECT_EQ(compositor, l1->GetCompositor());
- l1.Add(&l2);
- EXPECT_EQ(compositor, l2.GetCompositor());
+ l1->Add(l2.get());
+ EXPECT_EQ(compositor, l2->GetCompositor());
- l1.Remove(&l2);
- EXPECT_EQ(NULL, l2.GetCompositor());
+ l1->Remove(l2.get());
+ EXPECT_EQ(NULL, l2->GetCompositor());
- l1.Add(&l2);
- EXPECT_EQ(compositor, l2.GetCompositor());
+ l1->Add(l2.get());
+ EXPECT_EQ(compositor, l2->GetCompositor());
compositor->SetRootLayer(NULL);
- EXPECT_EQ(NULL, l1.GetCompositor());
- EXPECT_EQ(NULL, l2.GetCompositor());
+ EXPECT_EQ(NULL, l1->GetCompositor());
+ EXPECT_EQ(NULL, l2->GetCompositor());
}
// Checks that compositor observers are notified when:
« no previous file with comments | « ui/gfx/compositor/compositor.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698