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

Side by Side Diff: media/filters/pipeline_integration_test.cc

Issue 10796074: Move VideoRenderer out of Filter heirarchy. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: GetMediaTime Created 8 years, 5 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 | Annotate | Revision Log
OLDNEW
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 "media/base/decoder_buffer.h" 8 #include "media/base/decoder_buffer.h"
9 #include "media/base/decryptor_client.h" 9 #include "media/base/decryptor_client.h"
10 #include "media/base/mock_filters.h"
11 #include "media/base/test_data_util.h" 10 #include "media/base/test_data_util.h"
12 #include "media/crypto/aes_decryptor.h" 11 #include "media/crypto/aes_decryptor.h"
13 #include "media/filters/chunk_demuxer_client.h" 12 #include "media/filters/chunk_demuxer_client.h"
14 13
15 namespace media { 14 namespace media {
16 15
17 static const char kSourceId[] = "SourceId"; 16 static const char kSourceId[] = "SourceId";
18 static const char kClearKeySystem[] = "org.w3.clearkey"; 17 static const char kClearKeySystem[] = "org.w3.clearkey";
19 static const uint8 kInitData[] = { 0x69, 0x6e, 0x69, 0x74 }; 18 static const uint8 kInitData[] = { 0x69, 0x6e, 0x69, 0x74 };
20 19
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 ASSERT_TRUE(Start(GetTestDataURL("bear-320x240.webm"), PIPELINE_OK)); 305 ASSERT_TRUE(Start(GetTestDataURL("bear-320x240.webm"), PIPELINE_OK));
307 306
308 base::TimeDelta duration(pipeline_->GetMediaDuration()); 307 base::TimeDelta duration(pipeline_->GetMediaDuration());
309 base::TimeDelta start_seek_time(duration / 4); 308 base::TimeDelta start_seek_time(duration / 4);
310 base::TimeDelta seek_time(duration * 3 / 4); 309 base::TimeDelta seek_time(duration * 3 / 4);
311 310
312 Play(); 311 Play();
313 ASSERT_TRUE(WaitUntilCurrentTimeIsAfter(start_seek_time)); 312 ASSERT_TRUE(WaitUntilCurrentTimeIsAfter(start_seek_time));
314 Pause(); 313 Pause();
315 ASSERT_TRUE(Seek(seek_time)); 314 ASSERT_TRUE(Seek(seek_time));
316 EXPECT_EQ(pipeline_->GetCurrentTime(), seek_time); 315 EXPECT_EQ(pipeline_->GetMediaTime(), seek_time);
317 Play(); 316 Play();
318 ASSERT_TRUE(WaitUntilOnEnded()); 317 ASSERT_TRUE(WaitUntilOnEnded());
319 318
320 // Make sure seeking after reaching the end works as expected. 319 // Make sure seeking after reaching the end works as expected.
321 Pause(); 320 Pause();
322 ASSERT_TRUE(Seek(seek_time)); 321 ASSERT_TRUE(Seek(seek_time));
323 EXPECT_EQ(pipeline_->GetCurrentTime(), seek_time); 322 EXPECT_EQ(pipeline_->GetMediaTime(), seek_time);
324 Play(); 323 Play();
325 ASSERT_TRUE(WaitUntilOnEnded()); 324 ASSERT_TRUE(WaitUntilOnEnded());
326 } 325 }
327 326
328 // TODO(acolwell): Fix flakiness http://crbug.com/117921 327 // TODO(acolwell): Fix flakiness http://crbug.com/117921
329 TEST_F(PipelineIntegrationTest, DISABLED_SeekWhilePlaying) { 328 TEST_F(PipelineIntegrationTest, DISABLED_SeekWhilePlaying) {
330 ASSERT_TRUE(Start(GetTestDataURL("bear-320x240.webm"), PIPELINE_OK)); 329 ASSERT_TRUE(Start(GetTestDataURL("bear-320x240.webm"), PIPELINE_OK));
331 330
332 base::TimeDelta duration(pipeline_->GetMediaDuration()); 331 base::TimeDelta duration(pipeline_->GetMediaDuration());
333 base::TimeDelta start_seek_time(duration / 4); 332 base::TimeDelta start_seek_time(duration / 4);
334 base::TimeDelta seek_time(duration * 3 / 4); 333 base::TimeDelta seek_time(duration * 3 / 4);
335 334
336 Play(); 335 Play();
337 ASSERT_TRUE(WaitUntilCurrentTimeIsAfter(start_seek_time)); 336 ASSERT_TRUE(WaitUntilCurrentTimeIsAfter(start_seek_time));
338 ASSERT_TRUE(Seek(seek_time)); 337 ASSERT_TRUE(Seek(seek_time));
339 EXPECT_GE(pipeline_->GetCurrentTime(), seek_time); 338 EXPECT_GE(pipeline_->GetMediaTime(), seek_time);
340 ASSERT_TRUE(WaitUntilOnEnded()); 339 ASSERT_TRUE(WaitUntilOnEnded());
341 340
342 // Make sure seeking after reaching the end works as expected. 341 // Make sure seeking after reaching the end works as expected.
343 ASSERT_TRUE(Seek(seek_time)); 342 ASSERT_TRUE(Seek(seek_time));
344 EXPECT_GE(pipeline_->GetCurrentTime(), seek_time); 343 EXPECT_GE(pipeline_->GetMediaTime(), seek_time);
345 ASSERT_TRUE(WaitUntilOnEnded()); 344 ASSERT_TRUE(WaitUntilOnEnded());
346 } 345 }
347 346
348 // Verify audio decoder & renderer can handle aborted demuxer reads. 347 // Verify audio decoder & renderer can handle aborted demuxer reads.
349 TEST_F(PipelineIntegrationTest, ChunkDemuxerAbortRead_AudioOnly) { 348 TEST_F(PipelineIntegrationTest, ChunkDemuxerAbortRead_AudioOnly) {
350 ASSERT_TRUE(TestSeekDuringRead("bear-320x240-audio-only.webm", 8192, 349 ASSERT_TRUE(TestSeekDuringRead("bear-320x240-audio-only.webm", 8192,
351 base::TimeDelta::FromMilliseconds(464), 350 base::TimeDelta::FromMilliseconds(464),
352 base::TimeDelta::FromMilliseconds(617), 351 base::TimeDelta::FromMilliseconds(617),
353 0x10CA, 19730, true, false)); 352 0x10CA, 19730, true, false));
354 } 353 }
355 354
356 // Verify video decoder & renderer can handle aborted demuxer reads. 355 // Verify video decoder & renderer can handle aborted demuxer reads.
357 TEST_F(PipelineIntegrationTest, ChunkDemuxerAbortRead_VideoOnly) { 356 TEST_F(PipelineIntegrationTest, ChunkDemuxerAbortRead_VideoOnly) {
358 ASSERT_TRUE(TestSeekDuringRead("bear-320x240-video-only.webm", 32768, 357 ASSERT_TRUE(TestSeekDuringRead("bear-320x240-video-only.webm", 32768,
359 base::TimeDelta::FromMilliseconds(200), 358 base::TimeDelta::FromMilliseconds(200),
360 base::TimeDelta::FromMilliseconds(1668), 359 base::TimeDelta::FromMilliseconds(1668),
361 0x1C896, 65536, false, true)); 360 0x1C896, 65536, false, true));
362 } 361 }
363 362
364 } // namespace media 363 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/h264_to_annex_b_bitstream_converter_unittest.cc ('k') | media/filters/pipeline_integration_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698