Chromium Code Reviews| Index: media/formats/mp2t/mp2t_stream_parser_unittest.cc |
| diff --git a/media/formats/mp2t/mp2t_stream_parser_unittest.cc b/media/formats/mp2t/mp2t_stream_parser_unittest.cc |
| index 9395a241d3c5fd14e7cc0c48cea27e9715141b4e..fc6083a8cc9a38cba693195bf60c962fb34840e9 100644 |
| --- a/media/formats/mp2t/mp2t_stream_parser_unittest.cc |
| +++ b/media/formats/mp2t/mp2t_stream_parser_unittest.cc |
| @@ -118,14 +118,17 @@ class Mp2tStreamParserTest : public testing::Test { |
| bool OnNewConfig(std::unique_ptr<MediaTracks> tracks, |
| const StreamParser::TextTrackConfigMap& tc) { |
| - const AudioDecoderConfig& ac = tracks->getFirstAudioConfig(); |
| - const VideoDecoderConfig& vc = tracks->getFirstVideoConfig(); |
| - DVLOG(1) << "OnNewConfig: media tracks count=" << tracks->tracks().size() |
| - << ", audio=" << ac.IsValidConfig() |
| - << ", video=" << vc.IsValidConfig(); |
| + DVLOG(1) << "OnNewConfig: got " << tracks->tracks().size() << " tracks"; |
| + for (const auto& track : tracks->tracks()) { |
| + const auto& track_id = track->bytestream_track_id(); |
| + if (track->type() == MediaTrack::Audio) { |
| + EXPECT_TRUE(tracks->getAudioConfig(track_id).IsValidConfig()); |
| + } else if (track->type() == MediaTrack::Video) { |
| + EXPECT_TRUE(has_video_); |
|
wolenetz
2016/06/16 20:20:36
Versus previous code, this misses catching a poten
servolk
2016/06/16 21:14:07
Yep, good catch, thanks! We should also check that
|
| + EXPECT_TRUE(tracks->getVideoConfig(track_id).IsValidConfig()); |
| + } |
| + } |
| config_count_++; |
| - EXPECT_TRUE(ac.IsValidConfig()); |
| - EXPECT_EQ(vc.IsValidConfig(), has_video_); |
| return true; |
| } |