Index: components/exo/surface_unittest.cc |
diff --git a/components/exo/surface_unittest.cc b/components/exo/surface_unittest.cc |
index 570e4acc075f2dd03a7c9ac3063e76fca51e88c8..4ec911fb9dbcbcf9a635545398330410be18b178 100644 |
--- a/components/exo/surface_unittest.cc |
+++ b/components/exo/surface_unittest.cc |
@@ -50,6 +50,11 @@ TEST_F(SurfaceTest, Attach) { |
// attached buffer. |
surface->Attach(nullptr); |
surface->Commit(); |
+ // CompositorFrameSinkHolder::ReclaimResources() gets called via |
+ // MojoCompositorFrameSinkClient interface. We need to wait here for the mojo |
+ // call to finish so that the release callback finishes running before |
+ // the assertion below |
reveman
2016/12/07 00:46:58
nit: s/below/below./
Alex Z.
2016/12/07 20:09:36
Done.
|
+ RunAllPendingInMessageLoop(); |
ASSERT_EQ(1, release_buffer_call_count); |
} |
@@ -191,8 +196,9 @@ const cc::CompositorFrame& GetFrameFromSurface(Surface* surface) { |
cc::SurfaceId surface_id = surface->GetSurfaceId(); |
cc::SurfaceManager* surface_manager = |
aura::Env::GetInstance()->context_factory()->GetSurfaceManager(); |
- const cc::CompositorFrame& frame = |
- surface_manager->GetSurfaceForId(surface_id)->GetEligibleFrame(); |
+ cc::Surface* another_surface = surface_manager->GetSurfaceForId(surface_id); |
reveman
2016/12/07 00:46:58
s/another_surface/cc_surface/
Alex Z.
2016/12/07 20:09:36
This cc::Surface was added for debugging. I have r
|
+ DCHECK(another_surface); |
+ const cc::CompositorFrame& frame = another_surface->GetEligibleFrame(); |
return frame; |
} |
@@ -205,6 +211,7 @@ TEST_F(SurfaceTest, SetBlendMode) { |
surface->Attach(buffer.get()); |
surface->SetBlendMode(SkBlendMode::kSrc); |
surface->Commit(); |
+ RunAllPendingInMessageLoop(); |
const cc::CompositorFrame& frame = GetFrameFromSurface(surface.get()); |
ASSERT_EQ(1u, frame.render_pass_list.size()); |
@@ -222,6 +229,7 @@ TEST_F(SurfaceTest, OverlayCandidate) { |
surface->Attach(buffer.get()); |
surface->Commit(); |
+ RunAllPendingInMessageLoop(); |
const cc::CompositorFrame& frame = GetFrameFromSurface(surface.get()); |
ASSERT_EQ(1u, frame.render_pass_list.size()); |
@@ -247,7 +255,6 @@ TEST_F(SurfaceTest, SetAlpha) { |
TEST_F(SurfaceTest, Commit) { |
std::unique_ptr<Surface> surface(new Surface); |
- |
reveman
2016/12/07 00:46:58
was this intentionally removed?
Alex Z.
2016/12/07 20:09:36
No. I guess it was removed along with the printf's
|
// Calling commit without a buffer should succeed. |
surface->Commit(); |
} |