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

Unified Diff: media/remoting/remoting_controller_unittest.cc

Issue 2435423002: Add media remoting unittests to media_unittests. (Closed)
Patch Set: Addressed comments. Created 4 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 | « media/remoting/BUILD.gn ('k') | media/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/remoting/remoting_controller_unittest.cc
diff --git a/media/remoting/remoting_controller_unittest.cc b/media/remoting/remoting_controller_unittest.cc
index b97d243da791b3d8b90a897ea2586feda0eeee33..3986b8cdbbea02d56d97cd501c888fab8c881344 100644
--- a/media/remoting/remoting_controller_unittest.cc
+++ b/media/remoting/remoting_controller_unittest.cc
@@ -103,11 +103,13 @@ class FakeRemoterFactory final : public mojom::RemoterFactory {
};
std::unique_ptr<RemotingController> CreateRemotingController(
- mojom::RemoterFactory* remoter_factory) {
+ bool start_will_fail) {
mojom::RemotingSourcePtr remoting_source;
mojom::RemotingSourceRequest remoting_source_request =
mojo::GetProxy(&remoting_source);
mojom::RemoterPtr remoter;
+ std::unique_ptr<mojom::RemoterFactory> remoter_factory =
+ base::MakeUnique<FakeRemoterFactory>(start_will_fail);
remoter_factory->Create(std::move(remoting_source), mojo::GetProxy(&remoter));
std::unique_ptr<RemotingController> remoting_controller =
base::MakeUnique<RemotingController>(std::move(remoting_source_request),
@@ -120,8 +122,7 @@ std::unique_ptr<RemotingController> CreateRemotingController(
class RemotingControllerTest : public ::testing::Test {
public:
RemotingControllerTest()
- : remoting_controller_(
- CreateRemotingController(new FakeRemoterFactory(false))),
+ : remoting_controller_(CreateRemotingController(false)),
is_remoting_(false) {
remoting_controller_->SetSwitchRendererCallback(base::Bind(
&RemotingControllerTest::ToggleRenderer, base::Unretained(this)));
@@ -159,7 +160,7 @@ TEST_F(RemotingControllerTest, ToggleRenderer) {
TEST_F(RemotingControllerTest, StartFailed) {
EXPECT_FALSE(is_remoting_);
- remoting_controller_ = CreateRemotingController(new FakeRemoterFactory(true));
+ remoting_controller_ = CreateRemotingController(true);
remoting_controller_->SetSwitchRendererCallback(base::Bind(
&RemotingControllerTest::ToggleRenderer, base::Unretained(this)));
remoting_controller_->OnSinkAvailable();
« no previous file with comments | « media/remoting/BUILD.gn ('k') | media/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698