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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1336 // but the numerator will be truncated in the TOC as 250, losing precision. | 1336 // but the numerator will be truncated in the TOC as 250, losing precision. |
1337 base::TimeDelta seek_time(0.98 * pipeline_->GetMediaDuration()); | 1337 base::TimeDelta seek_time(0.98 * pipeline_->GetMediaDuration()); |
1338 | 1338 |
1339 ASSERT_TRUE(Seek(seek_time)); | 1339 ASSERT_TRUE(Seek(seek_time)); |
1340 Play(); | 1340 Play(); |
1341 ASSERT_TRUE(WaitUntilOnEnded()); | 1341 ASSERT_TRUE(WaitUntilOnEnded()); |
1342 | 1342 |
1343 EXPECT_HASH_EQ(config.hash, GetAudioHash()); | 1343 EXPECT_HASH_EQ(config.hash, GetAudioHash()); |
1344 } | 1344 } |
1345 | 1345 |
| 1346 // TODO(CHCUNNINGHAM): Re-enable for OSX once 1% flakiness is root caused. |
| 1347 // See http://crbug.com/571898 |
| 1348 #if !defined(OS_MACOSX) |
1346 // CBR seeks should always be fast and accurate. | 1349 // CBR seeks should always be fast and accurate. |
1347 INSTANTIATE_TEST_CASE_P( | 1350 INSTANTIATE_TEST_CASE_P( |
1348 CBRSeeks, | 1351 CBRSeek_HasTOC, |
1349 Mp3FastSeekIntegrationTest, | 1352 Mp3FastSeekIntegrationTest, |
1350 ::testing::Values(Mp3FastSeekParams("bear-audio-10s-CBR-has-TOC.mp3", | 1353 ::testing::Values(Mp3FastSeekParams("bear-audio-10s-CBR-has-TOC.mp3", |
1351 "-0.71,0.36,2.96,2.68,2.10,-1.08,"), | 1354 "-0.71,0.36,2.96,2.68,2.10,-1.08,"))); |
1352 Mp3FastSeekParams("bear-audio-10s-CBR-no-TOC.mp3", | 1355 #endif |
| 1356 |
| 1357 INSTANTIATE_TEST_CASE_P( |
| 1358 CBRSeeks_NoTOC, |
| 1359 Mp3FastSeekIntegrationTest, |
| 1360 ::testing::Values(Mp3FastSeekParams("bear-audio-10s-CBR-no-TOC.mp3", |
1353 "0.95,0.56,1.34,0.47,1.77,0.84,"))); | 1361 "0.95,0.56,1.34,0.47,1.77,0.84,"))); |
1354 | 1362 |
1355 // VBR seeks can be fast *OR* accurate, but not both. We chose fast. | 1363 // VBR seeks can be fast *OR* accurate, but not both. We chose fast. |
1356 INSTANTIATE_TEST_CASE_P( | 1364 INSTANTIATE_TEST_CASE_P( |
1357 VBRSeeks, | 1365 VBRSeeks_HasTOC, |
1358 Mp3FastSeekIntegrationTest, | 1366 Mp3FastSeekIntegrationTest, |
1359 ::testing::Values(Mp3FastSeekParams("bear-audio-10s-VBR-has-TOC.mp3", | 1367 ::testing::Values(Mp3FastSeekParams("bear-audio-10s-VBR-has-TOC.mp3", |
1360 "-0.15,-0.83,0.54,1.00,1.94,0.93,"), | 1368 "-0.15,-0.83,0.54,1.00,1.94,0.93,"))); |
1361 Mp3FastSeekParams("bear-audio-10s-VBR-no-TOC.mp3", | 1369 |
| 1370 INSTANTIATE_TEST_CASE_P( |
| 1371 VBRSeeks_NoTOC, |
| 1372 Mp3FastSeekIntegrationTest, |
| 1373 ::testing::Values(Mp3FastSeekParams("bear-audio-10s-VBR-no-TOC.mp3", |
1362 "-0.22,0.80,1.19,0.73,-0.31,-1.12,"))); | 1374 "-0.22,0.80,1.19,0.73,-0.31,-1.12,"))); |
1363 | 1375 |
1364 TEST_F(PipelineIntegrationTest, MediaSource_MP3) { | 1376 TEST_F(PipelineIntegrationTest, MediaSource_MP3) { |
1365 MockMediaSource source("sfx.mp3", kMP3, kAppendWholeFile); | 1377 MockMediaSource source("sfx.mp3", kMP3, kAppendWholeFile); |
1366 StartHashedPipelineWithMediaSource(&source); | 1378 StartHashedPipelineWithMediaSource(&source); |
1367 source.EndOfStream(); | 1379 source.EndOfStream(); |
1368 | 1380 |
1369 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); | 1381 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); |
1370 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); | 1382 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); |
1371 EXPECT_EQ(313, pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); | 1383 EXPECT_EQ(313, pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2004 | 2016 |
2005 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { | 2017 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { |
2006 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); | 2018 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); |
2007 Play(); | 2019 Play(); |
2008 ASSERT_TRUE(WaitUntilOnEnded()); | 2020 ASSERT_TRUE(WaitUntilOnEnded()); |
2009 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), | 2021 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), |
2010 demuxer_->GetStartTime()); | 2022 demuxer_->GetStartTime()); |
2011 } | 2023 } |
2012 | 2024 |
2013 } // namespace media | 2025 } // namespace media |
OLD | NEW |