| Index: chromecast/media/cma/backend/audio_video_pipeline_device_unittest.cc
|
| diff --git a/chromecast/media/cma/backend/audio_video_pipeline_device_unittest.cc b/chromecast/media/cma/backend/audio_video_pipeline_device_unittest.cc
|
| index 011ac946e1687cc67105e3f0d15e3cfdba924925..33d3cba0c5b81fe811dc6f64113a6dd38430fd5e 100644
|
| --- a/chromecast/media/cma/backend/audio_video_pipeline_device_unittest.cc
|
| +++ b/chromecast/media/cma/backend/audio_video_pipeline_device_unittest.cc
|
| @@ -19,6 +19,7 @@
|
| #include "base/memory/scoped_vector.h"
|
| #include "base/message_loop/message_loop.h"
|
| #include "base/path_service.h"
|
| +#include "base/run_loop.h"
|
| #include "base/single_thread_task_runner.h"
|
| #include "base/threading/thread.h"
|
| #include "base/threading/thread_checker.h"
|
| @@ -848,36 +849,36 @@ void AudioVideoPipelineDeviceTest::OnPauseCompleted() {
|
|
|
| void AudioVideoPipelineDeviceTest::TestBackendStates() {
|
| ASSERT_TRUE(backend()->Initialize());
|
| - base::MessageLoop::current()->RunUntilIdle();
|
| + base::RunLoop().RunUntilIdle();
|
|
|
| RunStoppedChecks();
|
| - base::MessageLoop::current()->RunUntilIdle();
|
| + base::RunLoop().RunUntilIdle();
|
|
|
| const int64_t start_pts = 222;
|
| ASSERT_TRUE(backend()->Start(start_pts));
|
| - base::MessageLoop::current()->RunUntilIdle();
|
| + base::RunLoop().RunUntilIdle();
|
| RunPlaybackChecks();
|
|
|
| ASSERT_TRUE(backend()->Pause());
|
| - base::MessageLoop::current()->RunUntilIdle();
|
| + base::RunLoop().RunUntilIdle();
|
| RunPlaybackChecks();
|
|
|
| ASSERT_TRUE(backend()->Resume());
|
| - base::MessageLoop::current()->RunUntilIdle();
|
| + base::RunLoop().RunUntilIdle();
|
| RunPlaybackChecks();
|
|
|
| ASSERT_TRUE(backend()->Stop());
|
| - base::MessageLoop::current()->RunUntilIdle();
|
| + base::RunLoop().RunUntilIdle();
|
|
|
| RunStoppedChecks();
|
| - base::MessageLoop::current()->RunUntilIdle();
|
| + base::RunLoop().RunUntilIdle();
|
| }
|
|
|
| void AudioVideoPipelineDeviceTest::StartImmediateEosTest() {
|
| RunStoppedChecks();
|
|
|
| ASSERT_TRUE(backend()->Initialize());
|
| - base::MessageLoop::current()->RunUntilIdle();
|
| + base::RunLoop().RunUntilIdle();
|
|
|
| Start();
|
| }
|
| @@ -887,13 +888,13 @@ void AudioVideoPipelineDeviceTest::EndImmediateEosTest() {
|
| RunPlaybackChecks();
|
|
|
| ASSERT_TRUE(backend_->Pause());
|
| - base::MessageLoop::current()->RunUntilIdle();
|
| + base::RunLoop().RunUntilIdle();
|
|
|
| EXPECT_EQ(kStartPts, backend_->GetCurrentPts());
|
| RunPlaybackChecks();
|
|
|
| ASSERT_TRUE(backend_->Stop());
|
| - base::MessageLoop::current()->RunUntilIdle();
|
| + base::RunLoop().RunUntilIdle();
|
|
|
| RunStoppedChecks();
|
|
|
| @@ -907,7 +908,7 @@ TEST_F(AudioVideoPipelineDeviceTest, Mp3Playback) {
|
| ConfigureForAudioOnly("sfx.mp3");
|
| PauseBeforeEos();
|
| Start();
|
| - message_loop->Run();
|
| + base::RunLoop().Run();
|
| }
|
|
|
| TEST_F(AudioVideoPipelineDeviceTest, AacPlayback) {
|
| @@ -917,7 +918,7 @@ TEST_F(AudioVideoPipelineDeviceTest, AacPlayback) {
|
| ConfigureForAudioOnly("sfx.m4a");
|
| PauseBeforeEos();
|
| Start();
|
| - message_loop->Run();
|
| + base::RunLoop().Run();
|
| }
|
|
|
| TEST_F(AudioVideoPipelineDeviceTest, VorbisPlayback) {
|
| @@ -926,7 +927,7 @@ TEST_F(AudioVideoPipelineDeviceTest, VorbisPlayback) {
|
| set_sync_type(MediaPipelineDeviceParams::kModeIgnorePts);
|
| ConfigureForAudioOnly("sfx.ogg");
|
| Start();
|
| - message_loop->Run();
|
| + base::RunLoop().Run();
|
| }
|
|
|
| // TODO(kmackay) FFmpegDemuxForTest can't handle AC3 or EAC3.
|
| @@ -938,7 +939,7 @@ TEST_F(AudioVideoPipelineDeviceTest, OpusPlayback_Optional) {
|
| ConfigureForAudioOnly("bear-opus.ogg");
|
| PauseBeforeEos();
|
| Start();
|
| - message_loop->Run();
|
| + base::RunLoop().Run();
|
| }
|
|
|
| TEST_F(AudioVideoPipelineDeviceTest, FlacPlayback_Optional) {
|
| @@ -948,7 +949,7 @@ TEST_F(AudioVideoPipelineDeviceTest, FlacPlayback_Optional) {
|
| ConfigureForAudioOnly("bear.flac");
|
| PauseBeforeEos();
|
| Start();
|
| - message_loop->Run();
|
| + base::RunLoop().Run();
|
| }
|
|
|
| TEST_F(AudioVideoPipelineDeviceTest, H264Playback) {
|
| @@ -958,7 +959,7 @@ TEST_F(AudioVideoPipelineDeviceTest, H264Playback) {
|
| ConfigureForVideoOnly("bear.h264", true /* raw_h264 */);
|
| PauseBeforeEos();
|
| Start();
|
| - message_loop->Run();
|
| + base::RunLoop().Run();
|
| }
|
|
|
| TEST_F(AudioVideoPipelineDeviceTest, WebmPlaybackWithPause) {
|
| @@ -971,7 +972,7 @@ TEST_F(AudioVideoPipelineDeviceTest, WebmPlaybackWithPause) {
|
|
|
| ConfigureForVideoOnly("bear-640x360.webm", false /* raw_h264 */);
|
| Start();
|
| - message_loop->Run();
|
| + base::RunLoop().Run();
|
| }
|
|
|
| TEST_F(AudioVideoPipelineDeviceTest, Vp8Playback) {
|
| @@ -980,7 +981,7 @@ TEST_F(AudioVideoPipelineDeviceTest, Vp8Playback) {
|
| set_sync_type(MediaPipelineDeviceParams::kModeSyncPts);
|
| ConfigureForVideoOnly("bear-vp8a.webm", false /* raw_h264 */);
|
| Start();
|
| - message_loop->Run();
|
| + base::RunLoop().Run();
|
| }
|
|
|
| TEST_F(AudioVideoPipelineDeviceTest, WebmPlayback) {
|
| @@ -990,7 +991,7 @@ TEST_F(AudioVideoPipelineDeviceTest, WebmPlayback) {
|
| ConfigureForFile("bear-640x360.webm");
|
| PauseBeforeEos();
|
| Start();
|
| - message_loop->Run();
|
| + base::RunLoop().Run();
|
| }
|
|
|
| // TODO(kmackay) FFmpegDemuxForTest can't handle HEVC or VP9.
|
| @@ -1087,7 +1088,7 @@ TEST_F(AudioVideoPipelineDeviceTest, Mp3Playback_WithEffectsStreams) {
|
| PauseBeforeEos();
|
| AddEffectsStreams();
|
| Start();
|
| - message_loop->Run();
|
| + base::RunLoop().Run();
|
| }
|
|
|
| TEST_F(AudioVideoPipelineDeviceTest, AacPlayback_WithEffectsStreams) {
|
| @@ -1098,7 +1099,7 @@ TEST_F(AudioVideoPipelineDeviceTest, AacPlayback_WithEffectsStreams) {
|
| PauseBeforeEos();
|
| AddEffectsStreams();
|
| Start();
|
| - message_loop->Run();
|
| + base::RunLoop().Run();
|
| }
|
|
|
| TEST_F(AudioVideoPipelineDeviceTest, VorbisPlayback_WithEffectsStreams) {
|
| @@ -1108,7 +1109,7 @@ TEST_F(AudioVideoPipelineDeviceTest, VorbisPlayback_WithEffectsStreams) {
|
| ConfigureForAudioOnly("sfx.ogg");
|
| AddEffectsStreams();
|
| Start();
|
| - message_loop->Run();
|
| + base::RunLoop().Run();
|
| }
|
|
|
| // TODO(kmackay) FFmpegDemuxForTest can't handle AC3 or EAC3.
|
| @@ -1121,7 +1122,7 @@ TEST_F(AudioVideoPipelineDeviceTest, OpusPlayback_WithEffectsStreams_Optional) {
|
| PauseBeforeEos();
|
| AddEffectsStreams();
|
| Start();
|
| - message_loop->Run();
|
| + base::RunLoop().Run();
|
| }
|
|
|
| TEST_F(AudioVideoPipelineDeviceTest, FlacPlayback_WithEffectsStreams_Optional) {
|
| @@ -1132,7 +1133,7 @@ TEST_F(AudioVideoPipelineDeviceTest, FlacPlayback_WithEffectsStreams_Optional) {
|
| PauseBeforeEos();
|
| AddEffectsStreams();
|
| Start();
|
| - message_loop->Run();
|
| + base::RunLoop().Run();
|
| }
|
|
|
| TEST_F(AudioVideoPipelineDeviceTest, H264Playback_WithEffectsStreams) {
|
| @@ -1143,7 +1144,7 @@ TEST_F(AudioVideoPipelineDeviceTest, H264Playback_WithEffectsStreams) {
|
| PauseBeforeEos();
|
| AddEffectsStreams();
|
| Start();
|
| - message_loop->Run();
|
| + base::RunLoop().Run();
|
| }
|
|
|
| TEST_F(AudioVideoPipelineDeviceTest, WebmPlaybackWithPause_WithEffectsStreams) {
|
| @@ -1157,7 +1158,7 @@ TEST_F(AudioVideoPipelineDeviceTest, WebmPlaybackWithPause_WithEffectsStreams) {
|
| ConfigureForVideoOnly("bear-640x360.webm", false /* raw_h264 */);
|
| AddEffectsStreams();
|
| Start();
|
| - message_loop->Run();
|
| + base::RunLoop().Run();
|
| }
|
|
|
| TEST_F(AudioVideoPipelineDeviceTest, Vp8Playback_WithEffectsStreams) {
|
| @@ -1167,7 +1168,7 @@ TEST_F(AudioVideoPipelineDeviceTest, Vp8Playback_WithEffectsStreams) {
|
| ConfigureForVideoOnly("bear-vp8a.webm", false /* raw_h264 */);
|
| AddEffectsStreams();
|
| Start();
|
| - message_loop->Run();
|
| + base::RunLoop().Run();
|
| }
|
|
|
| TEST_F(AudioVideoPipelineDeviceTest, WebmPlayback_WithEffectsStreams) {
|
| @@ -1178,7 +1179,7 @@ TEST_F(AudioVideoPipelineDeviceTest, WebmPlayback_WithEffectsStreams) {
|
| PauseBeforeEos();
|
| AddEffectsStreams();
|
| Start();
|
| - message_loop->Run();
|
| + base::RunLoop().Run();
|
| }
|
|
|
| } // namespace media
|
|
|