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

Unified Diff: media/mojo/services/media_mojo_unittest.cc

Issue 2087473002: Fixes memory leak in media_mojo_shell_unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/media_mojo_unittest.cc
diff --git a/media/mojo/services/media_mojo_unittest.cc b/media/mojo/services/media_mojo_unittest.cc
index 2c6c9c04c83b76a96ac74631939d68a205f68c7a..db87a1f7764f894e1ca89ebf471649da8ebdafe0 100644
--- a/media/mojo/services/media_mojo_unittest.cc
+++ b/media/mojo/services/media_mojo_unittest.cc
@@ -59,7 +59,7 @@ class MediaShellTest : public shell::test::ShellTest {
MediaShellTest()
: ShellTest("exe:media_mojo_unittests"),
renderer_client_binding_(&renderer_client_),
- video_demuxer_stream_(DemuxerStream::VIDEO) {}
+ video_stream_(DemuxerStream::VIDEO) {}
~MediaShellTest() override {}
void SetUp() override {
@@ -102,16 +102,17 @@ class MediaShellTest : public shell::test::ShellTest {
bool expected_result) {
service_factory_->CreateRenderer(mojo::GetProxy(&renderer_));
- video_demuxer_stream_.set_video_decoder_config(video_config);
+ video_stream_.set_video_decoder_config(video_config);
- mojom::DemuxerStreamPtr video_stream;
- new MojoDemuxerStreamImpl(&video_demuxer_stream_, GetProxy(&video_stream));
+ mojom::DemuxerStreamPtr video_stream_proxy;
+ mojo_video_stream_.reset(new MojoDemuxerStreamImpl(
+ &video_stream_, GetProxy(&video_stream_proxy)));
EXPECT_CALL(*this, OnRendererInitialized(expected_result))
.Times(Exactly(1))
.WillOnce(InvokeWithoutArgs(run_loop_.get(), &base::RunLoop::Quit));
renderer_->Initialize(renderer_client_binding_.CreateInterfacePtrAndBind(),
- nullptr, std::move(video_stream),
+ nullptr, std::move(video_stream_proxy),
base::Bind(&MediaShellTest::OnRendererInitialized,
base::Unretained(this)));
}
@@ -128,7 +129,8 @@ class MediaShellTest : public shell::test::ShellTest {
StrictMock<MockRendererClient> renderer_client_;
mojo::Binding<mojom::RendererClient> renderer_client_binding_;
- StrictMock<MockDemuxerStream> video_demuxer_stream_;
+ StrictMock<MockDemuxerStream> video_stream_;
+ std::unique_ptr<MojoDemuxerStreamImpl> mojo_video_stream_;
private:
std::unique_ptr<shell::Connection> connection_;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698