| 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 "media/filters/pipeline_integration_test_base.h" | 5 #include "media/filters/pipeline_integration_test_base.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 virtual void NeedKey(const std::string& type, | 244 virtual void NeedKey(const std::string& type, |
| 245 const std::vector<uint8>& init_data, | 245 const std::vector<uint8>& init_data, |
| 246 AesDecryptor* decryptor) OVERRIDE { | 246 AesDecryptor* decryptor) OVERRIDE { |
| 247 } | 247 } |
| 248 }; | 248 }; |
| 249 | 249 |
| 250 // Helper class that emulates calls made on the ChunkDemuxer by the | 250 // Helper class that emulates calls made on the ChunkDemuxer by the |
| 251 // Media Source API. | 251 // Media Source API. |
| 252 class MockMediaSource { | 252 class MockMediaSource { |
| 253 public: | 253 public: |
| 254 MockMediaSource(const std::string& filename, const std::string& mimetype, | 254 MockMediaSource(const std::string& filename, |
| 255 const std::string& mimetype, |
| 255 int initial_append_size) | 256 int initial_append_size) |
| 256 : file_path_(GetTestDataFilePath(filename)), | 257 : file_path_(GetTestDataFilePath(filename)), |
| 257 current_position_(0), | 258 current_position_(0), |
| 258 initial_append_size_(initial_append_size), | 259 initial_append_size_(initial_append_size), |
| 259 mimetype_(mimetype), | 260 mimetype_(mimetype), |
| 260 chunk_demuxer_(new ChunkDemuxer( | 261 chunk_demuxer_(new ChunkDemuxer( |
| 261 base::Bind(&MockMediaSource::DemuxerOpened, | 262 base::Bind(&MockMediaSource::DemuxerOpened, base::Unretained(this)), |
| 262 base::Unretained(this)), | |
| 263 base::Bind(&MockMediaSource::DemuxerNeedKey, | 263 base::Bind(&MockMediaSource::DemuxerNeedKey, |
| 264 base::Unretained(this)), | 264 base::Unretained(this)), |
| 265 LogCB())), | 265 LogCB(), |
| 266 false)), |
| 266 owned_chunk_demuxer_(chunk_demuxer_) { | 267 owned_chunk_demuxer_(chunk_demuxer_) { |
| 267 | 268 |
| 268 file_data_ = ReadTestDataFile(filename); | 269 file_data_ = ReadTestDataFile(filename); |
| 269 | 270 |
| 270 if (initial_append_size_ == kAppendWholeFile) | 271 if (initial_append_size_ == kAppendWholeFile) |
| 271 initial_append_size_ = file_data_->data_size(); | 272 initial_append_size_ = file_data_->data_size(); |
| 272 | 273 |
| 273 DCHECK_GT(initial_append_size_, 0); | 274 DCHECK_GT(initial_append_size_, 0); |
| 274 DCHECK_LE(initial_append_size_, file_data_->data_size()); | 275 DCHECK_LE(initial_append_size_, file_data_->data_size()); |
| 275 } | 276 } |
| (...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1181 // Verify that VP8 video with inband text track can be played back. | 1182 // Verify that VP8 video with inband text track can be played back. |
| 1182 TEST_F(PipelineIntegrationTest, | 1183 TEST_F(PipelineIntegrationTest, |
| 1183 BasicPlayback_VP8_WebVTT_WebM) { | 1184 BasicPlayback_VP8_WebVTT_WebM) { |
| 1184 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8-webvtt.webm"), | 1185 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8-webvtt.webm"), |
| 1185 PIPELINE_OK)); | 1186 PIPELINE_OK)); |
| 1186 Play(); | 1187 Play(); |
| 1187 ASSERT_TRUE(WaitUntilOnEnded()); | 1188 ASSERT_TRUE(WaitUntilOnEnded()); |
| 1188 } | 1189 } |
| 1189 | 1190 |
| 1190 } // namespace media | 1191 } // namespace media |
| OLD | NEW |