Index: ui/gfx/compositor/layer_unittest.cc |
diff --git a/ui/gfx/compositor/layer_unittest.cc b/ui/gfx/compositor/layer_unittest.cc |
index aa16ceb94be5cac90380c21c9715ca8924ca3def..91bbc6438d96e453f226170e7a6891565819c32f 100644 |
--- a/ui/gfx/compositor/layer_unittest.cc |
+++ b/ui/gfx/compositor/layer_unittest.cc |
@@ -1007,16 +1007,24 @@ TEST_F(LayerWithNullDelegateTest, SetBoundsSchedulesPaint) { |
TEST_F(LayerWithRealCompositorTest, MAYBE_DrawPixels) { |
scoped_ptr<Layer> layer(CreateColorLayer(SK_ColorRED, |
gfx::Rect(0, 0, 500, 500))); |
+ scoped_ptr<Layer> layer2(CreateColorLayer(SK_ColorBLUE, |
+ gfx::Rect(0, 0, 500, 10))); |
+ |
+ layer->Add(layer2.get()); |
+ |
DrawTree(layer.get()); |
SkBitmap bitmap; |
- ASSERT_TRUE(GetCompositor()->ReadPixels(&bitmap)); |
+ gfx::Size size = GetCompositor()->size(); |
+ ASSERT_TRUE(GetCompositor()->ReadPixels(&bitmap, |
+ gfx::Rect(0, 10, |
+ size.width(), size.height() - 10))); |
ASSERT_FALSE(bitmap.empty()); |
SkAutoLockPixels lock(bitmap); |
bool is_all_red = true; |
for (int x = 0; is_all_red && x < 500; x++) |
- for (int y = 0; is_all_red && y < 500; y++) |
+ for (int y = 0; is_all_red && y < 490; y++) |
is_all_red = is_all_red && (bitmap.getColor(x, y) == SK_ColorRED); |
EXPECT_TRUE(is_all_red); |