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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "content/child/child_process.h" 10 #include "content/child/child_process.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 PPB_ImageData_Impl::ForTest())); 90 PPB_ImageData_Impl::ForTest()));
91 image->Init(PP_IMAGEDATAFORMAT_BGRA_PREMUL, 640, 360, true); 91 image->Init(PP_IMAGEDATAFORMAT_BGRA_PREMUL, 640, 360, true);
92 { 92 {
93 base::RunLoop run_loop; 93 base::RunLoop run_loop;
94 base::Closure quit_closure = run_loop.QuitClosure(); 94 base::Closure quit_closure = run_loop.QuitClosure();
95 95
96 EXPECT_CALL(sink, OnVideoFrame()).WillOnce( 96 EXPECT_CALL(sink, OnVideoFrame()).WillOnce(
97 RunClosure(quit_closure)); 97 RunClosure(quit_closure));
98 frame_writer.Run(image.get(), 10); 98 frame_writer.Run(image.get(), 10);
99 run_loop.Run(); 99 run_loop.Run();
100 // Run all pending tasks to let the the test clean up before the test ends.
101 // This is due to that
102 // FrameWriterDelegate::FrameWriterDelegate::DeliverFrame use
103 // PostTaskAndReply to the IO thread and expects the reply to process
104 // on the main render thread to clean up its resources. However, the
105 // QuitClosure above ends before that.
106 base::MessageLoop::current()->RunUntilIdle();
100 } 107 }
101 EXPECT_EQ(1, sink.number_of_frames()); 108 EXPECT_EQ(1, sink.number_of_frames());
102 native_track->RemoveSink(&sink); 109 native_track->RemoveSink(&sink);
103 } 110 }
104 111
105 } // namespace content 112 } // namespace content
OLDNEW
« 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