| 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 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 static void EosOnReadDone(bool* got_eos_buffer, | 39 static void EosOnReadDone(bool* got_eos_buffer, |
| 40 DemuxerStream::Status status, | 40 DemuxerStream::Status status, |
| 41 const scoped_refptr<DecoderBuffer>& buffer) { | 41 const scoped_refptr<DecoderBuffer>& buffer) { |
| 42 MessageLoop::current()->PostTask( | 42 MessageLoop::current()->PostTask( |
| 43 FROM_HERE, MessageLoop::QuitWhenIdleClosure()); | 43 FROM_HERE, MessageLoop::QuitWhenIdleClosure()); |
| 44 | 44 |
| 45 EXPECT_EQ(status, DemuxerStream::kOk); | 45 EXPECT_EQ(status, DemuxerStream::kOk); |
| 46 if (buffer->IsEndOfStream()) { | 46 if (buffer->IsEndOfStream()) { |
| 47 *got_eos_buffer = true; | 47 *got_eos_buffer = true; |
| 48 EXPECT_TRUE(!buffer->GetData()); | |
| 49 EXPECT_EQ(buffer->GetDataSize(), 0); | |
| 50 return; | 48 return; |
| 51 } | 49 } |
| 52 | 50 |
| 53 EXPECT_TRUE(buffer->GetData()); | 51 EXPECT_TRUE(buffer->GetData()); |
| 54 EXPECT_GT(buffer->GetDataSize(), 0); | 52 EXPECT_GT(buffer->GetDataSize(), 0); |
| 55 *got_eos_buffer = false; | 53 *got_eos_buffer = false; |
| 56 }; | 54 }; |
| 57 | 55 |
| 58 | 56 |
| 59 // Fixture class to facilitate writing tests. Takes care of setting up the | 57 // Fixture class to facilitate writing tests. Takes care of setting up the |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 TEST_F(FFmpegDemuxerTest, MP4_ZeroStszEntry) { | 621 TEST_F(FFmpegDemuxerTest, MP4_ZeroStszEntry) { |
| 624 #if !defined(USE_PROPRIETARY_CODECS) | 622 #if !defined(USE_PROPRIETARY_CODECS) |
| 625 return; | 623 return; |
| 626 #endif | 624 #endif |
| 627 CreateDemuxer("bear-1280x720-zero-stsz-entry.mp4"); | 625 CreateDemuxer("bear-1280x720-zero-stsz-entry.mp4"); |
| 628 InitializeDemuxer(); | 626 InitializeDemuxer(); |
| 629 ReadUntilEndOfStream(); | 627 ReadUntilEndOfStream(); |
| 630 } | 628 } |
| 631 | 629 |
| 632 } // namespace media | 630 } // namespace media |
| OLD | NEW |