Index: content/renderer/media/webrtc/video_destination_handler_unittest.cc |
diff --git a/content/renderer/media/webrtc/video_destination_handler_unittest.cc b/content/renderer/media/webrtc/video_destination_handler_unittest.cc |
index c408e10d6e5462537e72681bc0fe3e34cab6196d..5913b21c414a11174863b4230fe2366804845247 100644 |
--- a/content/renderer/media/webrtc/video_destination_handler_unittest.cc |
+++ b/content/renderer/media/webrtc/video_destination_handler_unittest.cc |
@@ -97,6 +97,13 @@ TEST_F(VideoDestinationHandlerTest, PutFrame) { |
RunClosure(quit_closure)); |
frame_writer.Run(image.get(), 10); |
run_loop.Run(); |
+ // Run all pending tasks to let the the test clean up before the test ends. |
+ // This is due to that |
+ // FrameWriterDelegate::FrameWriterDelegate::DeliverFrame use |
+ // PostTaskAndReply to the IO thread and expects the reply to process |
+ // on the main render thread to clean up its resources. However, the |
+ // QuitClosure above ends before that. |
+ base::MessageLoop::current()->RunUntilIdle(); |
} |
EXPECT_EQ(1, sink.number_of_frames()); |
native_track->RemoveSink(&sink); |