OLD | NEW |
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 <stdint.h> | 5 #include <stdint.h> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 video_demuxer_stream_(DemuxerStream::VIDEO) {} | 56 video_demuxer_stream_(DemuxerStream::VIDEO) {} |
57 ~MediaAppTest() override {} | 57 ~MediaAppTest() override {} |
58 | 58 |
59 void SetUp() override { | 59 void SetUp() override { |
60 ApplicationTestBase::SetUp(); | 60 ApplicationTestBase::SetUp(); |
61 | 61 |
62 connection_ = shell()->Connect("mojo:media"); | 62 connection_ = shell()->Connect("mojo:media"); |
63 connection_->SetRemoteServiceProviderConnectionErrorHandler( | 63 connection_->SetRemoteServiceProviderConnectionErrorHandler( |
64 base::Bind(&MediaAppTest::ConnectionClosed, base::Unretained(this))); | 64 base::Bind(&MediaAppTest::ConnectionClosed, base::Unretained(this))); |
65 | 65 |
66 connection_->ConnectToService(&service_factory_); | 66 connection_->GetInterface(&service_factory_); |
67 service_factory_->CreateCdm(mojo::GetProxy(&cdm_)); | 67 service_factory_->CreateCdm(mojo::GetProxy(&cdm_)); |
68 service_factory_->CreateRenderer(mojo::GetProxy(&renderer_)); | 68 service_factory_->CreateRenderer(mojo::GetProxy(&renderer_)); |
69 | 69 |
70 run_loop_.reset(new base::RunLoop()); | 70 run_loop_.reset(new base::RunLoop()); |
71 } | 71 } |
72 | 72 |
73 // MOCK_METHOD* doesn't support move only types. Work around this by having | 73 // MOCK_METHOD* doesn't support move only types. Work around this by having |
74 // an extra method. | 74 // an extra method. |
75 MOCK_METHOD2(OnCdmInitializedInternal, void(bool result, int cdm_id)); | 75 MOCK_METHOD2(OnCdmInitializedInternal, void(bool result, int cdm_id)); |
76 void OnCdmInitialized(interfaces::CdmPromiseResultPtr result, | 76 void OnCdmInitialized(interfaces::CdmPromiseResultPtr result, |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // close the connection. | 162 // close the connection. |
163 EXPECT_CALL(*this, ConnectionClosed()) | 163 EXPECT_CALL(*this, ConnectionClosed()) |
164 .Times(Exactly(1)) | 164 .Times(Exactly(1)) |
165 .WillOnce(Invoke(run_loop_.get(), &base::RunLoop::Quit)); | 165 .WillOnce(Invoke(run_loop_.get(), &base::RunLoop::Quit)); |
166 service_factory_.reset(); | 166 service_factory_.reset(); |
167 | 167 |
168 run_loop_->Run(); | 168 run_loop_->Run(); |
169 } | 169 } |
170 | 170 |
171 } // namespace media | 171 } // namespace media |
OLD | NEW |