OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 1843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1854 // Player should begin prefetch and resume preroll upon Start(). | 1854 // Player should begin prefetch and resume preroll upon Start(). |
1855 EXPECT_EQ(2, demuxer_->num_data_requests()); | 1855 EXPECT_EQ(2, demuxer_->num_data_requests()); |
1856 StartAudioDecoderJob(true); | 1856 StartAudioDecoderJob(true); |
1857 EXPECT_TRUE(IsPrerolling(true)); | 1857 EXPECT_TRUE(IsPrerolling(true)); |
1858 EXPECT_EQ(100.0, GetPrerollTimestamp().InMillisecondsF()); | 1858 EXPECT_EQ(100.0, GetPrerollTimestamp().InMillisecondsF()); |
1859 | 1859 |
1860 // No further seek should have been requested since Release(), above. | 1860 // No further seek should have been requested since Release(), above. |
1861 EXPECT_EQ(1, demuxer_->num_seek_requests()); | 1861 EXPECT_EQ(1, demuxer_->num_seek_requests()); |
1862 } | 1862 } |
1863 | 1863 |
1864 TEST_F(MediaSourcePlayerTest, SeekToThenReleaseThenDemuxerSeekThenStart) { | 1864 TEST_F(MediaSourcePlayerTest, |
| 1865 DISABLED_SeekToThenReleaseThenDemuxerSeekThenStart) { |
1865 SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE(); | 1866 SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE(); |
1866 | 1867 |
1867 // Test if Release() occurs after SeekTo(), but the DemuxerSeek IPC request | 1868 // Test if Release() occurs after SeekTo(), but the DemuxerSeek IPC request |
1868 // has not yet been sent, then the seek request is sent after Release(). Also, | 1869 // has not yet been sent, then the seek request is sent after Release(). Also, |
1869 // test if OnDemuxerSeekDone() does not occur until after the next Start(), | 1870 // test if OnDemuxerSeekDone() does not occur until after the next Start(), |
1870 // then the player remains pending seek done until (and resumes correct | 1871 // then the player remains pending seek done until (and resumes correct |
1871 // post-seek preroll after) OnDemuxerSeekDone(). | 1872 // post-seek preroll after) OnDemuxerSeekDone(). |
1872 StartAudioDecoderJobAndSeekToWhileDecoding( | 1873 StartAudioDecoderJobAndSeekToWhileDecoding( |
1873 base::TimeDelta::FromMilliseconds(100)); | 1874 base::TimeDelta::FromMilliseconds(100)); |
1874 ReleasePlayer(); | 1875 ReleasePlayer(); |
1875 EXPECT_EQ(1, demuxer_->num_seek_requests()); | 1876 EXPECT_EQ(1, demuxer_->num_seek_requests()); |
1876 | 1877 |
1877 // Player should not prefetch upon Start() nor create the decoder job, due to | 1878 // Player should not prefetch upon Start() nor create the decoder job, due to |
1878 // awaiting DemuxerSeekDone. | 1879 // awaiting DemuxerSeekDone. |
1879 EXPECT_EQ(2, demuxer_->num_data_requests()); | 1880 EXPECT_EQ(2, demuxer_->num_data_requests()); |
1880 StartAudioDecoderJob(false); | 1881 StartAudioDecoderJob(false); |
1881 | 1882 |
1882 player_.OnDemuxerSeekDone(kNoTimestamp()); | 1883 player_.OnDemuxerSeekDone(kNoTimestamp()); |
1883 EXPECT_TRUE(GetMediaDecoderJob(true)); | 1884 EXPECT_TRUE(GetMediaDecoderJob(true)); |
1884 EXPECT_TRUE(IsPrerolling(true)); | 1885 EXPECT_TRUE(IsPrerolling(true)); |
1885 EXPECT_EQ(100.0, GetPrerollTimestamp().InMillisecondsF()); | 1886 EXPECT_EQ(100.0, GetPrerollTimestamp().InMillisecondsF()); |
1886 EXPECT_EQ(3, demuxer_->num_data_requests()); | 1887 EXPECT_EQ(3, demuxer_->num_data_requests()); |
1887 | 1888 |
1888 // No further seek should have been requested since Release(), above. | 1889 // No further seek should have been requested since Release(), above. |
1889 EXPECT_EQ(1, demuxer_->num_seek_requests()); | 1890 EXPECT_EQ(1, demuxer_->num_seek_requests()); |
1890 } | 1891 } |
1891 | 1892 |
1892 TEST_F(MediaSourcePlayerTest, SeekToThenDemuxerSeekThenReleaseThenSeekDone) { | 1893 TEST_F(MediaSourcePlayerTest, |
| 1894 DISABLED_SeekToThenDemuxerSeekThenReleaseThenSeekDone) { |
1893 SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE(); | 1895 SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE(); |
1894 | 1896 |
1895 // Test if Release() occurs after a SeekTo()'s subsequent DemuxerSeek IPC | 1897 // Test if Release() occurs after a SeekTo()'s subsequent DemuxerSeek IPC |
1896 // request and OnDemuxerSeekDone() arrives prior to the next Start(), then the | 1898 // request and OnDemuxerSeekDone() arrives prior to the next Start(), then the |
1897 // player will resume correct post-seek preroll upon Start(). | 1899 // player will resume correct post-seek preroll upon Start(). |
1898 StartAudioDecoderJobAndSeekToWhileDecoding( | 1900 StartAudioDecoderJobAndSeekToWhileDecoding( |
1899 base::TimeDelta::FromMilliseconds(100)); | 1901 base::TimeDelta::FromMilliseconds(100)); |
1900 WaitForAudioDecodeDone(); | 1902 WaitForAudioDecodeDone(); |
1901 EXPECT_EQ(1, demuxer_->num_seek_requests()); | 1903 EXPECT_EQ(1, demuxer_->num_seek_requests()); |
1902 | 1904 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2058 DemuxerConfigs configs = CreateVideoDemuxerConfigs(); | 2060 DemuxerConfigs configs = CreateVideoDemuxerConfigs(); |
2059 configs.is_video_encrypted = true; | 2061 configs.is_video_encrypted = true; |
2060 | 2062 |
2061 player_.OnDemuxerConfigsAvailable(configs); | 2063 player_.OnDemuxerConfigsAvailable(configs); |
2062 CreateNextTextureAndSetVideoSurface(); | 2064 CreateNextTextureAndSetVideoSurface(); |
2063 EXPECT_FALSE(IsPendingSurfaceChange()); | 2065 EXPECT_FALSE(IsPendingSurfaceChange()); |
2064 EXPECT_FALSE(GetMediaDecoderJob(false)); | 2066 EXPECT_FALSE(GetMediaDecoderJob(false)); |
2065 } | 2067 } |
2066 | 2068 |
2067 } // namespace media | 2069 } // namespace media |
OLD | NEW |