| 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 | 7 |
| 7 #include "base/bind.h" | 8 #include "base/bind.h" |
| 8 #include "base/callback.h" | 9 #include "base/callback.h" |
| 9 #include "base/macros.h" | 10 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
| 12 #include "media/base/cdm_config.h" | 13 #include "media/base/cdm_config.h" |
| 13 #include "media/base/mock_filters.h" | 14 #include "media/base/mock_filters.h" |
| 14 #include "media/base/test_helpers.h" | 15 #include "media/base/test_helpers.h" |
| 15 #include "media/cdm/key_system_names.h" | 16 #include "media/cdm/key_system_names.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 100 |
| 100 interfaces::DemuxerStreamPtr video_stream; | 101 interfaces::DemuxerStreamPtr video_stream; |
| 101 new MojoDemuxerStreamImpl(&video_demuxer_stream_, GetProxy(&video_stream)); | 102 new MojoDemuxerStreamImpl(&video_demuxer_stream_, GetProxy(&video_stream)); |
| 102 | 103 |
| 103 interfaces::RendererClientPtr client_ptr; | 104 interfaces::RendererClientPtr client_ptr; |
| 104 renderer_client_binding_.Bind(GetProxy(&client_ptr)); | 105 renderer_client_binding_.Bind(GetProxy(&client_ptr)); |
| 105 | 106 |
| 106 EXPECT_CALL(*this, OnRendererInitialized(expected_result)) | 107 EXPECT_CALL(*this, OnRendererInitialized(expected_result)) |
| 107 .Times(Exactly(1)) | 108 .Times(Exactly(1)) |
| 108 .WillOnce(InvokeWithoutArgs(run_loop_.get(), &base::RunLoop::Quit)); | 109 .WillOnce(InvokeWithoutArgs(run_loop_.get(), &base::RunLoop::Quit)); |
| 109 renderer_->Initialize(client_ptr.Pass(), nullptr, video_stream.Pass(), | 110 renderer_->Initialize(std::move(client_ptr), nullptr, |
| 111 std::move(video_stream), |
| 110 base::Bind(&MediaAppTest::OnRendererInitialized, | 112 base::Bind(&MediaAppTest::OnRendererInitialized, |
| 111 base::Unretained(this))); | 113 base::Unretained(this))); |
| 112 } | 114 } |
| 113 | 115 |
| 114 MOCK_METHOD0(ConnectionClosed, void()); | 116 MOCK_METHOD0(ConnectionClosed, void()); |
| 115 | 117 |
| 116 protected: | 118 protected: |
| 117 scoped_ptr<base::RunLoop> run_loop_; | 119 scoped_ptr<base::RunLoop> run_loop_; |
| 118 | 120 |
| 119 interfaces::ServiceFactoryPtr service_factory_; | 121 interfaces::ServiceFactoryPtr service_factory_; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 // close the connection. | 167 // close the connection. |
| 166 EXPECT_CALL(*this, ConnectionClosed()) | 168 EXPECT_CALL(*this, ConnectionClosed()) |
| 167 .Times(Exactly(1)) | 169 .Times(Exactly(1)) |
| 168 .WillOnce(Invoke(run_loop_.get(), &base::RunLoop::Quit)); | 170 .WillOnce(Invoke(run_loop_.get(), &base::RunLoop::Quit)); |
| 169 service_factory_.reset(); | 171 service_factory_.reset(); |
| 170 | 172 |
| 171 run_loop_->Run(); | 173 run_loop_->Run(); |
| 172 } | 174 } |
| 173 | 175 |
| 174 } // namespace media | 176 } // namespace media |
| OLD | NEW |