| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/message_loop/message_loop.h" | |
| 10 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/test/test_message_loop.h" |
| 11 #include "base/threading/platform_thread.h" | 11 #include "base/threading/platform_thread.h" |
| 12 #include "base/timer/elapsed_timer.h" | 12 #include "base/timer/elapsed_timer.h" |
| 13 #include "media/base/audio_renderer_sink.h" | 13 #include "media/base/audio_renderer_sink.h" |
| 14 #include "media/base/cdm_config.h" | 14 #include "media/base/cdm_config.h" |
| 15 #include "media/base/cdm_context.h" | 15 #include "media/base/cdm_context.h" |
| 16 #include "media/base/gmock_callback_support.h" | 16 #include "media/base/gmock_callback_support.h" |
| 17 #include "media/base/mock_filters.h" | 17 #include "media/base/mock_filters.h" |
| 18 #include "media/base/test_helpers.h" | 18 #include "media/base/test_helpers.h" |
| 19 #include "media/base/video_renderer_sink.h" | 19 #include "media/base/video_renderer_sink.h" |
| 20 #include "media/cdm/default_cdm_factory.h" | 20 #include "media/cdm/default_cdm_factory.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 mojo_renderer_->StartPlayingFrom(start_time); | 186 mojo_renderer_->StartPlayingFrom(start_time); |
| 187 EXPECT_EQ(start_time, mojo_renderer_->GetMediaTime()); | 187 EXPECT_EQ(start_time, mojo_renderer_->GetMediaTime()); |
| 188 base::RunLoop().RunUntilIdle(); | 188 base::RunLoop().RunUntilIdle(); |
| 189 } | 189 } |
| 190 | 190 |
| 191 void Play() { | 191 void Play() { |
| 192 StartPlayingFrom(base::TimeDelta::FromMilliseconds(kStartPlayingTimeInMs)); | 192 StartPlayingFrom(base::TimeDelta::FromMilliseconds(kStartPlayingTimeInMs)); |
| 193 } | 193 } |
| 194 | 194 |
| 195 // Fixture members. | 195 // Fixture members. |
| 196 base::MessageLoop message_loop_; | 196 base::TestMessageLoop message_loop_; |
| 197 | 197 |
| 198 // The MojoRenderer that we are testing. | 198 // The MojoRenderer that we are testing. |
| 199 std::unique_ptr<MojoRenderer> mojo_renderer_; | 199 std::unique_ptr<MojoRenderer> mojo_renderer_; |
| 200 | 200 |
| 201 // Client side mocks and helpers. | 201 // Client side mocks and helpers. |
| 202 StrictMock<MockRendererClient> renderer_client_; | 202 StrictMock<MockRendererClient> renderer_client_; |
| 203 StrictMock<MockCdmContext> cdm_context_; | 203 StrictMock<MockCdmContext> cdm_context_; |
| 204 mojom::ContentDecryptionModulePtr remote_cdm_; | 204 mojom::ContentDecryptionModulePtr remote_cdm_; |
| 205 | 205 |
| 206 // Client side mock demuxer and demuxer streams. | 206 // Client side mock demuxer and demuxer streams. |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 Play(); | 425 Play(); |
| 426 remote_renderer_client_->OnError(PIPELINE_ERROR_DECODE); | 426 remote_renderer_client_->OnError(PIPELINE_ERROR_DECODE); |
| 427 base::RunLoop().RunUntilIdle(); | 427 base::RunLoop().RunUntilIdle(); |
| 428 | 428 |
| 429 EXPECT_CALL(*mock_renderer_, SetPlaybackRate(0.0)).Times(1); | 429 EXPECT_CALL(*mock_renderer_, SetPlaybackRate(0.0)).Times(1); |
| 430 mojo_renderer_->SetPlaybackRate(0.0); | 430 mojo_renderer_->SetPlaybackRate(0.0); |
| 431 Flush(); | 431 Flush(); |
| 432 } | 432 } |
| 433 | 433 |
| 434 } // namespace media | 434 } // namespace media |
| OLD | NEW |