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

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

Issue 2358413002: media: Use associated interface for mojo RendererClient (Closed)
Patch Set: more test update Created 4 years, 3 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
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 0b6005dd4b2a053fa5ffbc8ffb3d99dbc74ae7f4..036f255370c990baed70a21fa4b10e7cfd1205cb 100644
--- a/media/mojo/services/media_mojo_unittest.cc
+++ b/media/mojo/services/media_mojo_unittest.cc
@@ -20,6 +20,7 @@
#include "media/mojo/interfaces/decryptor.mojom.h"
#include "media/mojo/interfaces/renderer.mojom.h"
#include "media/mojo/interfaces/service_factory.mojom.h"
+#include "mojo/public/cpp/bindings/associated_binding.h"
#include "services/shell/public/cpp/service_test.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -116,11 +117,15 @@ class MediaServiceTest : public shell::test::ServiceTest {
mojo_video_stream_.reset(new MojoDemuxerStreamImpl(
&video_stream_, GetProxy(&video_stream_proxy)));
+ mojom::RendererClientAssociatedPtrInfo client_ptr_info;
+ renderer_client_binding_.Bind(&client_ptr_info,
+ renderer_.associated_group());
+
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_proxy), base::nullopt,
+ renderer_->Initialize(std::move(client_ptr_info), nullptr,
+ std::move(video_stream_proxy), base::nullopt,
base::Bind(&MediaServiceTest::OnRendererInitialized,
base::Unretained(this)));
}
@@ -135,7 +140,7 @@ class MediaServiceTest : public shell::test::ServiceTest {
mojom::RendererPtr renderer_;
StrictMock<MockRendererClient> renderer_client_;
- mojo::Binding<mojom::RendererClient> renderer_client_binding_;
+ mojo::AssociatedBinding<mojom::RendererClient> renderer_client_binding_;
StrictMock<MockDemuxerStream> video_stream_;
std::unique_ptr<MojoDemuxerStreamImpl> mojo_video_stream_;

Powered by Google App Engine
This is Rietveld 408576698