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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 94 |
95 MOCK_METHOD1(OnRendererInitialized, void(bool)); | 95 MOCK_METHOD1(OnRendererInitialized, void(bool)); |
96 | 96 |
97 void InitializeRenderer(const VideoDecoderConfig& video_config, | 97 void InitializeRenderer(const VideoDecoderConfig& video_config, |
98 bool expected_result) { | 98 bool expected_result) { |
99 video_demuxer_stream_.set_video_decoder_config(video_config); | 99 video_demuxer_stream_.set_video_decoder_config(video_config); |
100 | 100 |
101 interfaces::DemuxerStreamPtr video_stream; | 101 interfaces::DemuxerStreamPtr video_stream; |
102 new MojoDemuxerStreamImpl(&video_demuxer_stream_, GetProxy(&video_stream)); | 102 new MojoDemuxerStreamImpl(&video_demuxer_stream_, GetProxy(&video_stream)); |
103 | 103 |
104 interfaces::RendererClientPtr client_ptr; | |
105 renderer_client_binding_.Bind(GetProxy(&client_ptr)); | |
106 | |
107 EXPECT_CALL(*this, OnRendererInitialized(expected_result)) | 104 EXPECT_CALL(*this, OnRendererInitialized(expected_result)) |
108 .Times(Exactly(1)) | 105 .Times(Exactly(1)) |
109 .WillOnce(InvokeWithoutArgs(run_loop_.get(), &base::RunLoop::Quit)); | 106 .WillOnce(InvokeWithoutArgs(run_loop_.get(), &base::RunLoop::Quit)); |
110 renderer_->Initialize(std::move(client_ptr), nullptr, | 107 renderer_->Initialize(renderer_client_binding_.CreateInterfacePtrAndBind(), |
111 std::move(video_stream), | 108 nullptr, std::move(video_stream), |
112 base::Bind(&MediaAppTest::OnRendererInitialized, | 109 base::Bind(&MediaAppTest::OnRendererInitialized, |
113 base::Unretained(this))); | 110 base::Unretained(this))); |
114 } | 111 } |
115 | 112 |
116 MOCK_METHOD0(ConnectionClosed, void()); | 113 MOCK_METHOD0(ConnectionClosed, void()); |
117 | 114 |
118 protected: | 115 protected: |
119 scoped_ptr<base::RunLoop> run_loop_; | 116 scoped_ptr<base::RunLoop> run_loop_; |
120 | 117 |
121 interfaces::ServiceFactoryPtr service_factory_; | 118 interfaces::ServiceFactoryPtr service_factory_; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 // close the connection. | 164 // close the connection. |
168 EXPECT_CALL(*this, ConnectionClosed()) | 165 EXPECT_CALL(*this, ConnectionClosed()) |
169 .Times(Exactly(1)) | 166 .Times(Exactly(1)) |
170 .WillOnce(Invoke(run_loop_.get(), &base::RunLoop::Quit)); | 167 .WillOnce(Invoke(run_loop_.get(), &base::RunLoop::Quit)); |
171 service_factory_.reset(); | 168 service_factory_.reset(); |
172 | 169 |
173 run_loop_->Run(); | 170 run_loop_->Run(); |
174 } | 171 } |
175 | 172 |
176 } // namespace media | 173 } // namespace media |
OLD | NEW |