| Index: ui/compositor/layer_unittest.cc
|
| diff --git a/ui/compositor/layer_unittest.cc b/ui/compositor/layer_unittest.cc
|
| index 3fe11c0d746a22e5023074c4c910dbd47b00a9b1..57e1e02d8d0ffb9ebe8339a50f786780fc7e5b5e 100644
|
| --- a/ui/compositor/layer_unittest.cc
|
| +++ b/ui/compositor/layer_unittest.cc
|
| @@ -125,7 +125,7 @@
|
| void DrawTree(Layer* root) {
|
| GetCompositor()->SetRootLayer(root);
|
| GetCompositor()->ScheduleDraw();
|
| - WaitForSwap();
|
| + WaitForDraw();
|
| }
|
|
|
| void ReadPixels(SkBitmap* bitmap) {
|
| @@ -145,7 +145,7 @@
|
| // be in the middle of a draw right now, and the commit with the
|
| // copy output request may not be done on the first draw.
|
| for (int i = 0; i < 2; i++) {
|
| - GetCompositor()->ScheduleFullRedraw();
|
| + GetCompositor()->ScheduleDraw();
|
| WaitForDraw();
|
| }
|
|
|
| @@ -155,13 +155,7 @@
|
| *bitmap = holder->result();
|
| }
|
|
|
| - void WaitForDraw() {
|
| - ui::DrawWaiterForTest::WaitForCompositingStarted(GetCompositor());
|
| - }
|
| -
|
| - void WaitForSwap() {
|
| - DrawWaiterForTest::WaitForCompositingEnded(GetCompositor());
|
| - }
|
| + void WaitForDraw() { ui::DrawWaiterForTest::Wait(GetCompositor()); }
|
|
|
| void WaitForCommit() {
|
| ui::DrawWaiterForTest::WaitForCommit(GetCompositor());
|
| @@ -446,9 +440,7 @@
|
| WaitForDraw();
|
| }
|
|
|
| - void WaitForDraw() {
|
| - DrawWaiterForTest::WaitForCompositingStarted(compositor());
|
| - }
|
| + void WaitForDraw() { DrawWaiterForTest::Wait(compositor()); }
|
|
|
| void WaitForCommit() {
|
| DrawWaiterForTest::WaitForCommit(compositor());
|
| @@ -1024,25 +1016,25 @@
|
| // Moving, but not resizing, a layer should alert the observers.
|
| observer.Reset();
|
| l2->SetBounds(gfx::Rect(0, 0, 350, 350));
|
| - WaitForSwap();
|
| + WaitForDraw();
|
| EXPECT_TRUE(observer.notified());
|
|
|
| // So should resizing a layer.
|
| observer.Reset();
|
| l2->SetBounds(gfx::Rect(0, 0, 400, 400));
|
| - WaitForSwap();
|
| + WaitForDraw();
|
| EXPECT_TRUE(observer.notified());
|
|
|
| // Opacity changes should alert the observers.
|
| observer.Reset();
|
| l2->SetOpacity(0.5f);
|
| - WaitForSwap();
|
| + WaitForDraw();
|
| EXPECT_TRUE(observer.notified());
|
|
|
| // So should setting the opacity back.
|
| observer.Reset();
|
| l2->SetOpacity(1.0f);
|
| - WaitForSwap();
|
| + WaitForDraw();
|
| EXPECT_TRUE(observer.notified());
|
|
|
| // Setting the transform of a layer should alert the observers.
|
| @@ -1052,7 +1044,7 @@
|
| transform.Rotate(90.0);
|
| transform.Translate(-200.0, -200.0);
|
| l2->SetTransform(transform);
|
| - WaitForSwap();
|
| + WaitForDraw();
|
| EXPECT_TRUE(observer.notified());
|
|
|
| // A change resulting in an aborted swap buffer should alert the observer
|
| @@ -1060,7 +1052,7 @@
|
| observer.Reset();
|
| l2->SetOpacity(0.1f);
|
| GetCompositor()->DidAbortSwapBuffers();
|
| - WaitForSwap();
|
| + WaitForDraw();
|
| EXPECT_TRUE(observer.notified());
|
| EXPECT_TRUE(observer.aborted());
|
|
|
| @@ -1069,7 +1061,7 @@
|
| // Opacity changes should no longer alert the removed observer.
|
| observer.Reset();
|
| l2->SetOpacity(0.5f);
|
| - WaitForSwap();
|
| + WaitForDraw();
|
|
|
| EXPECT_FALSE(observer.notified());
|
| }
|
|
|