| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <deque> | 6 #include <deque> |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 EXPECT_TRUE(IsStreamStopped(DemuxerStream::AUDIO)); | 517 EXPECT_TRUE(IsStreamStopped(DemuxerStream::AUDIO)); |
| 518 | 518 |
| 519 // Attempt a read from the video stream: it should return valid data. | 519 // Attempt a read from the video stream: it should return valid data. |
| 520 video->Read(NewReadCB(FROM_HERE, 22084, 0)); | 520 video->Read(NewReadCB(FROM_HERE, 22084, 0)); |
| 521 message_loop_.Run(); | 521 message_loop_.Run(); |
| 522 | 522 |
| 523 // Attempt a read from the audio stream: it should immediately return end of | 523 // Attempt a read from the audio stream: it should immediately return end of |
| 524 // stream without requiring the message loop to read data. | 524 // stream without requiring the message loop to read data. |
| 525 bool got_eos_buffer = false; | 525 bool got_eos_buffer = false; |
| 526 audio->Read(base::Bind(&EosOnReadDone, &got_eos_buffer)); | 526 audio->Read(base::Bind(&EosOnReadDone, &got_eos_buffer)); |
| 527 message_loop_.RunUntilIdle(); |
| 527 EXPECT_TRUE(got_eos_buffer); | 528 EXPECT_TRUE(got_eos_buffer); |
| 528 } | 529 } |
| 529 | 530 |
| 530 // Verify that seek works properly when the WebM cues data is at the start of | 531 // Verify that seek works properly when the WebM cues data is at the start of |
| 531 // the file instead of at the end. | 532 // the file instead of at the end. |
| 532 TEST_F(FFmpegDemuxerTest, SeekWithCuesBeforeFirstCluster) { | 533 TEST_F(FFmpegDemuxerTest, SeekWithCuesBeforeFirstCluster) { |
| 533 CreateDemuxer("bear-320x240-cues-in-front.webm"); | 534 CreateDemuxer("bear-320x240-cues-in-front.webm"); |
| 534 InitializeDemuxer(); | 535 InitializeDemuxer(); |
| 535 | 536 |
| 536 // Get our streams. | 537 // Get our streams. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 TEST_F(FFmpegDemuxerTest, UnsupportedVideoSupportedAudioDemux) { | 611 TEST_F(FFmpegDemuxerTest, UnsupportedVideoSupportedAudioDemux) { |
| 611 CreateDemuxer("vorbis_audio_wmv_video.mkv"); | 612 CreateDemuxer("vorbis_audio_wmv_video.mkv"); |
| 612 InitializeDemuxer(); | 613 InitializeDemuxer(); |
| 613 | 614 |
| 614 // Ensure the expected streams are present. | 615 // Ensure the expected streams are present. |
| 615 EXPECT_FALSE(demuxer_->GetStream(DemuxerStream::VIDEO)); | 616 EXPECT_FALSE(demuxer_->GetStream(DemuxerStream::VIDEO)); |
| 616 EXPECT_TRUE(demuxer_->GetStream(DemuxerStream::AUDIO)); | 617 EXPECT_TRUE(demuxer_->GetStream(DemuxerStream::AUDIO)); |
| 617 } | 618 } |
| 618 | 619 |
| 619 } // namespace media | 620 } // namespace media |
| OLD | NEW |