| Index: ui/compositor/layer_unittest.cc
|
| diff --git a/ui/compositor/layer_unittest.cc b/ui/compositor/layer_unittest.cc
|
| index bba28423a43c26b480aec087207eafda6a196e61..0fb061c7484be991a8a1f84a62e15559c4ff5ad8 100644
|
| --- a/ui/compositor/layer_unittest.cc
|
| +++ b/ui/compositor/layer_unittest.cc
|
| @@ -125,7 +125,7 @@ class LayerWithRealCompositorTest : public testing::Test {
|
| void DrawTree(Layer* root) {
|
| GetCompositor()->SetRootLayer(root);
|
| GetCompositor()->ScheduleDraw();
|
| - WaitForDraw();
|
| + WaitForSwap();
|
| }
|
|
|
| void ReadPixels(SkBitmap* bitmap) {
|
| @@ -145,7 +145,7 @@ class LayerWithRealCompositorTest : public testing::Test {
|
| // 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()->ScheduleDraw();
|
| + GetCompositor()->ScheduleFullRedraw();
|
| WaitForDraw();
|
| }
|
|
|
| @@ -155,7 +155,13 @@ class LayerWithRealCompositorTest : public testing::Test {
|
| *bitmap = holder->result();
|
| }
|
|
|
| - void WaitForDraw() { ui::DrawWaiterForTest::Wait(GetCompositor()); }
|
| + void WaitForDraw() {
|
| + ui::DrawWaiterForTest::WaitForCompositingStarted(GetCompositor());
|
| + }
|
| +
|
| + void WaitForSwap() {
|
| + DrawWaiterForTest::WaitForCompositingEnded(GetCompositor());
|
| + }
|
|
|
| void WaitForCommit() {
|
| ui::DrawWaiterForTest::WaitForCommit(GetCompositor());
|
| @@ -442,7 +448,9 @@ class LayerWithDelegateTest : public testing::Test {
|
| WaitForDraw();
|
| }
|
|
|
| - void WaitForDraw() { DrawWaiterForTest::Wait(compositor()); }
|
| + void WaitForDraw() {
|
| + DrawWaiterForTest::WaitForCompositingStarted(compositor());
|
| + }
|
|
|
| void WaitForCommit() {
|
| DrawWaiterForTest::WaitForCommit(compositor());
|
| @@ -1018,25 +1026,25 @@ TEST_F(LayerWithRealCompositorTest, CompositorObservers) {
|
| // Moving, but not resizing, a layer should alert the observers.
|
| observer.Reset();
|
| l2->SetBounds(gfx::Rect(0, 0, 350, 350));
|
| - WaitForDraw();
|
| + WaitForSwap();
|
| EXPECT_TRUE(observer.notified());
|
|
|
| // So should resizing a layer.
|
| observer.Reset();
|
| l2->SetBounds(gfx::Rect(0, 0, 400, 400));
|
| - WaitForDraw();
|
| + WaitForSwap();
|
| EXPECT_TRUE(observer.notified());
|
|
|
| // Opacity changes should alert the observers.
|
| observer.Reset();
|
| l2->SetOpacity(0.5f);
|
| - WaitForDraw();
|
| + WaitForSwap();
|
| EXPECT_TRUE(observer.notified());
|
|
|
| // So should setting the opacity back.
|
| observer.Reset();
|
| l2->SetOpacity(1.0f);
|
| - WaitForDraw();
|
| + WaitForSwap();
|
| EXPECT_TRUE(observer.notified());
|
|
|
| // Setting the transform of a layer should alert the observers.
|
| @@ -1046,7 +1054,7 @@ TEST_F(LayerWithRealCompositorTest, CompositorObservers) {
|
| transform.Rotate(90.0);
|
| transform.Translate(-200.0, -200.0);
|
| l2->SetTransform(transform);
|
| - WaitForDraw();
|
| + WaitForSwap();
|
| EXPECT_TRUE(observer.notified());
|
|
|
| // A change resulting in an aborted swap buffer should alert the observer
|
| @@ -1054,7 +1062,7 @@ TEST_F(LayerWithRealCompositorTest, CompositorObservers) {
|
| observer.Reset();
|
| l2->SetOpacity(0.1f);
|
| GetCompositor()->DidAbortSwapBuffers();
|
| - WaitForDraw();
|
| + WaitForSwap();
|
| EXPECT_TRUE(observer.notified());
|
| EXPECT_TRUE(observer.aborted());
|
|
|
| @@ -1063,7 +1071,7 @@ TEST_F(LayerWithRealCompositorTest, CompositorObservers) {
|
| // Opacity changes should no longer alert the removed observer.
|
| observer.Reset();
|
| l2->SetOpacity(0.5f);
|
| - WaitForDraw();
|
| + WaitForSwap();
|
|
|
| EXPECT_FALSE(observer.notified());
|
| }
|
|
|