Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: media/formats/webm/webm_stream_parser_unittest.cc

Issue 1861963008: Use StreamParser::TrackId instead of string for MediaTrack::byteStreamTrackId (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Include <algorithm> into stream_parser_buffer.cc Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "media/formats/webm/webm_stream_parser.h" 5 #include "media/formats/webm/webm_stream_parser.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "media/base/decoder_buffer.h" 10 #include "media/base/decoder_buffer.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 params.detected_audio_track_count = 1; 100 params.detected_audio_track_count = 1;
101 params.detected_video_track_count = 1; 101 params.detected_video_track_count = 1;
102 params.detected_text_track_count = 0; 102 params.detected_text_track_count = 0;
103 ParseWebMFile("bear.webm", params); 103 ParseWebMFile("bear.webm", params);
104 EXPECT_NE(media_tracks_.get(), nullptr); 104 EXPECT_NE(media_tracks_.get(), nullptr);
105 105
106 EXPECT_EQ(media_tracks_->tracks().size(), 2u); 106 EXPECT_EQ(media_tracks_->tracks().size(), 2u);
107 107
108 const MediaTrack& video_track = *(media_tracks_->tracks()[0]); 108 const MediaTrack& video_track = *(media_tracks_->tracks()[0]);
109 EXPECT_EQ(video_track.type(), MediaTrack::Video); 109 EXPECT_EQ(video_track.type(), MediaTrack::Video);
110 EXPECT_EQ(video_track.id(), "1"); 110 EXPECT_EQ(video_track.bytestream_track_id(), 1);
111 EXPECT_EQ(video_track.kind(), "main"); 111 EXPECT_EQ(video_track.kind(), "main");
112 EXPECT_EQ(video_track.label(), ""); 112 EXPECT_EQ(video_track.label(), "");
113 EXPECT_EQ(video_track.language(), "und"); 113 EXPECT_EQ(video_track.language(), "und");
114 114
115 const MediaTrack& audio_track = *(media_tracks_->tracks()[1]); 115 const MediaTrack& audio_track = *(media_tracks_->tracks()[1]);
116 EXPECT_EQ(audio_track.type(), MediaTrack::Audio); 116 EXPECT_EQ(audio_track.type(), MediaTrack::Audio);
117 EXPECT_EQ(audio_track.id(), "2"); 117 EXPECT_EQ(audio_track.bytestream_track_id(), 2);
118 EXPECT_EQ(audio_track.kind(), "main"); 118 EXPECT_EQ(audio_track.kind(), "main");
119 EXPECT_EQ(audio_track.label(), ""); 119 EXPECT_EQ(audio_track.label(), "");
120 EXPECT_EQ(audio_track.language(), "und"); 120 EXPECT_EQ(audio_track.language(), "und");
121 } 121 }
122 122
123 TEST_F(WebMStreamParserTest, VerifyDetectedTrack_AudioOnly) { 123 TEST_F(WebMStreamParserTest, VerifyDetectedTrack_AudioOnly) {
124 EXPECT_MEDIA_LOG(testing::HasSubstr("Estimating WebM block duration")) 124 EXPECT_MEDIA_LOG(testing::HasSubstr("Estimating WebM block duration"))
125 .Times(testing::AnyNumber()); 125 .Times(testing::AnyNumber());
126 StreamParser::InitParameters params(kInfiniteDuration()); 126 StreamParser::InitParameters params(kInfiniteDuration());
127 params.detected_audio_track_count = 1; 127 params.detected_audio_track_count = 1;
(...skipping 21 matching lines...) Expand all
149 params.detected_audio_track_count = 1; 149 params.detected_audio_track_count = 1;
150 params.detected_video_track_count = 1; 150 params.detected_video_track_count = 1;
151 params.detected_text_track_count = 1; 151 params.detected_text_track_count = 1;
152 ParseWebMFile("bear-vp8-webvtt.webm", params); 152 ParseWebMFile("bear-vp8-webvtt.webm", params);
153 EXPECT_EQ(media_tracks_->tracks().size(), 2u); 153 EXPECT_EQ(media_tracks_->tracks().size(), 2u);
154 EXPECT_EQ(media_tracks_->tracks()[0]->type(), MediaTrack::Video); 154 EXPECT_EQ(media_tracks_->tracks()[0]->type(), MediaTrack::Video);
155 EXPECT_EQ(media_tracks_->tracks()[1]->type(), MediaTrack::Audio); 155 EXPECT_EQ(media_tracks_->tracks()[1]->type(), MediaTrack::Audio);
156 } 156 }
157 157
158 } // namespace media 158 } // namespace media
OLDNEW
« no previous file with comments | « media/formats/mpeg/mpeg_audio_stream_parser_base.cc ('k') | media/formats/webm/webm_tracks_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698