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

Side by Side Diff: media/mojo/services/media_apptest.cc

Issue 1455833005: Convert ConnectToApplication to take a params class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 1 month 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 | « mash/wm/window_manager_apptest.cc ('k') | media/test/pipeline_integration_test.cc » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/callback.h" 6 #include "base/callback.h"
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "media/base/cdm_config.h" 10 #include "media/base/cdm_config.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 class MediaAppTest : public mojo::test::ApplicationTestBase { 50 class MediaAppTest : public mojo::test::ApplicationTestBase {
51 public: 51 public:
52 MediaAppTest() 52 MediaAppTest()
53 : renderer_client_binding_(&renderer_client_), 53 : renderer_client_binding_(&renderer_client_),
54 video_demuxer_stream_(DemuxerStream::VIDEO) {} 54 video_demuxer_stream_(DemuxerStream::VIDEO) {}
55 ~MediaAppTest() override {} 55 ~MediaAppTest() override {}
56 56
57 void SetUp() override { 57 void SetUp() override {
58 ApplicationTestBase::SetUp(); 58 ApplicationTestBase::SetUp();
59 59
60 mojo::URLRequestPtr request = mojo::URLRequest::New(); 60 connection_ = application_impl()->ConnectToApplication("mojo:media");
61 request->url = "mojo:media";
62 connection_ = application_impl()->ConnectToApplication(request.Pass());
63 connection_->SetRemoteServiceProviderConnectionErrorHandler( 61 connection_->SetRemoteServiceProviderConnectionErrorHandler(
64 base::Bind(&MediaAppTest::ConnectionClosed, base::Unretained(this))); 62 base::Bind(&MediaAppTest::ConnectionClosed, base::Unretained(this)));
65 63
66 connection_->ConnectToService(&service_factory_); 64 connection_->ConnectToService(&service_factory_);
67 service_factory_->CreateCdm(mojo::GetProxy(&cdm_)); 65 service_factory_->CreateCdm(mojo::GetProxy(&cdm_));
68 service_factory_->CreateRenderer(mojo::GetProxy(&renderer_)); 66 service_factory_->CreateRenderer(mojo::GetProxy(&renderer_));
69 67
70 run_loop_.reset(new base::RunLoop()); 68 run_loop_.reset(new base::RunLoop());
71 } 69 }
72 70
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 // close the connection. 160 // close the connection.
163 EXPECT_CALL(*this, ConnectionClosed()) 161 EXPECT_CALL(*this, ConnectionClosed())
164 .Times(Exactly(1)) 162 .Times(Exactly(1))
165 .WillOnce(Invoke(run_loop_.get(), &base::RunLoop::Quit)); 163 .WillOnce(Invoke(run_loop_.get(), &base::RunLoop::Quit));
166 service_factory_.reset(); 164 service_factory_.reset();
167 165
168 run_loop_->Run(); 166 run_loop_->Run();
169 } 167 }
170 168
171 } // namespace media 169 } // namespace media
OLDNEW
« no previous file with comments | « mash/wm/window_manager_apptest.cc ('k') | media/test/pipeline_integration_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698