Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(562)

Unified Diff: content/renderer/media/webrtc/video_destination_handler_unittest.cc

Issue 649513003: Fix leak reported by valgrind in VideoDestinationHandlerTest.PutFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix broken rebase. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698