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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "media/base/audio_decoder_config.h" | 6 #include "media/base/audio_decoder_config.h" |
7 #include "media/base/mock_callback.h" | 7 #include "media/base/mock_callback.h" |
8 #include "media/base/mock_demuxer_host.h" | 8 #include "media/base/mock_demuxer_host.h" |
9 #include "media/base/test_data_util.h" | 9 #include "media/base/test_data_util.h" |
10 #include "media/filters/chunk_demuxer.h" | 10 #include "media/filters/chunk_demuxer.h" |
(...skipping 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 &host_, CreateInitDoneCB(kDefaultDuration(), PIPELINE_OK)); | 1069 &host_, CreateInitDoneCB(kDefaultDuration(), PIPELINE_OK)); |
1070 | 1070 |
1071 ASSERT_EQ(AddId(), ChunkDemuxer::kOk); | 1071 ASSERT_EQ(AddId(), ChunkDemuxer::kOk); |
1072 | 1072 |
1073 ASSERT_TRUE(AppendInfoTracks(true, true, false)); | 1073 ASSERT_TRUE(AppendInfoTracks(true, true, false)); |
1074 | 1074 |
1075 uint8 tmp = 0; | 1075 uint8 tmp = 0; |
1076 ASSERT_TRUE(demuxer_->AppendData(kSourceId, &tmp, 1)); | 1076 ASSERT_TRUE(demuxer_->AppendData(kSourceId, &tmp, 1)); |
1077 } | 1077 } |
1078 | 1078 |
| 1079 TEST_F(ChunkDemuxerTest, TestAVHeadersWithAudioOnlyType) { |
| 1080 EXPECT_CALL(*client_, DemuxerOpened(_)); |
| 1081 demuxer_->Initialize( |
| 1082 &host_, CreateInitDoneCB(kDefaultDuration(), |
| 1083 DEMUXER_ERROR_COULD_NOT_OPEN)); |
| 1084 |
| 1085 std::vector<std::string> codecs(1); |
| 1086 codecs[0] = "vorbis"; |
| 1087 ASSERT_EQ(demuxer_->AddId(kSourceId, "audio/webm", codecs), |
| 1088 ChunkDemuxer::kOk); |
| 1089 |
| 1090 ASSERT_TRUE(AppendInfoTracks(true, true, false)); |
| 1091 } |
| 1092 |
| 1093 TEST_F(ChunkDemuxerTest, TestAVHeadersWithVideoOnlyType) { |
| 1094 EXPECT_CALL(*client_, DemuxerOpened(_)); |
| 1095 demuxer_->Initialize( |
| 1096 &host_, CreateInitDoneCB(kDefaultDuration(), |
| 1097 DEMUXER_ERROR_COULD_NOT_OPEN)); |
| 1098 |
| 1099 std::vector<std::string> codecs(1); |
| 1100 codecs[0] = "vp8"; |
| 1101 ASSERT_EQ(demuxer_->AddId(kSourceId, "video/webm", codecs), |
| 1102 ChunkDemuxer::kOk); |
| 1103 |
| 1104 ASSERT_TRUE(AppendInfoTracks(true, true, false)); |
| 1105 } |
| 1106 |
1079 } // namespace media | 1107 } // namespace media |
OLD | NEW |