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 "media/base/test_data_util.h" | 8 #include "media/base/test_data_util.h" |
9 #include "media/filters/chunk_demuxer_client.h" | 9 #include "media/filters/chunk_demuxer_client.h" |
10 | 10 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 source.EndOfStream(); | 136 source.EndOfStream(); |
137 ASSERT_EQ(PIPELINE_OK, pipeline_status_); | 137 ASSERT_EQ(PIPELINE_OK, pipeline_status_); |
138 | 138 |
139 Play(); | 139 Play(); |
140 | 140 |
141 ASSERT_TRUE(WaitUntilOnEnded()); | 141 ASSERT_TRUE(WaitUntilOnEnded()); |
142 source.Abort(); | 142 source.Abort(); |
143 Stop(); | 143 Stop(); |
144 } | 144 } |
145 | 145 |
146 // TODO(acolwell): Fix flakiness http://crbug.com/109875 | 146 TEST_F(PipelineIntegrationTest, SeekWhilePaused) { |
147 TEST_F(PipelineIntegrationTest, DISABLED_SeekWhilePaused) { | |
148 ASSERT_TRUE(Start(GetTestDataURL("bear-320x240.webm"), PIPELINE_OK)); | 147 ASSERT_TRUE(Start(GetTestDataURL("bear-320x240.webm"), PIPELINE_OK)); |
149 | 148 |
150 base::TimeDelta duration(pipeline_->GetMediaDuration()); | 149 base::TimeDelta duration(pipeline_->GetMediaDuration()); |
151 base::TimeDelta start_seek_time(duration / 4); | 150 base::TimeDelta start_seek_time(duration / 4); |
152 base::TimeDelta seek_time(duration * 3 / 4); | 151 base::TimeDelta seek_time(duration * 3 / 4); |
153 | 152 |
154 Play(); | 153 Play(); |
155 ASSERT_TRUE(WaitUntilCurrentTimeIsAfter(start_seek_time)); | 154 ASSERT_TRUE(WaitUntilCurrentTimeIsAfter(start_seek_time)); |
156 Pause(); | 155 Pause(); |
157 ASSERT_TRUE(Seek(seek_time)); | 156 ASSERT_TRUE(Seek(seek_time)); |
158 EXPECT_EQ(pipeline_->GetCurrentTime(), seek_time); | 157 EXPECT_EQ(pipeline_->GetCurrentTime(), seek_time); |
159 Play(); | 158 Play(); |
160 ASSERT_TRUE(WaitUntilOnEnded()); | 159 ASSERT_TRUE(WaitUntilOnEnded()); |
161 | 160 |
162 // Make sure seeking after reaching the end works as expected. | 161 // Make sure seeking after reaching the end works as expected. |
163 Pause(); | 162 Pause(); |
164 ASSERT_TRUE(Seek(seek_time)); | 163 ASSERT_TRUE(Seek(seek_time)); |
165 EXPECT_EQ(pipeline_->GetCurrentTime(), seek_time); | 164 EXPECT_EQ(pipeline_->GetCurrentTime(), seek_time); |
166 Play(); | 165 Play(); |
167 ASSERT_TRUE(WaitUntilOnEnded()); | 166 ASSERT_TRUE(WaitUntilOnEnded()); |
168 } | 167 } |
169 | 168 |
170 // TODO(acolwell): Fix flakiness http://crbug.com/109875 | 169 TEST_F(PipelineIntegrationTest, SeekWhilePlaying) { |
171 TEST_F(PipelineIntegrationTest, DISABLED_SeekWhilePlaying) { | |
172 ASSERT_TRUE(Start(GetTestDataURL("bear-320x240.webm"), PIPELINE_OK)); | 170 ASSERT_TRUE(Start(GetTestDataURL("bear-320x240.webm"), PIPELINE_OK)); |
173 | 171 |
174 base::TimeDelta duration(pipeline_->GetMediaDuration()); | 172 base::TimeDelta duration(pipeline_->GetMediaDuration()); |
175 base::TimeDelta start_seek_time(duration / 4); | 173 base::TimeDelta start_seek_time(duration / 4); |
176 base::TimeDelta seek_time(duration * 3 / 4); | 174 base::TimeDelta seek_time(duration * 3 / 4); |
177 | 175 |
178 Play(); | 176 Play(); |
179 ASSERT_TRUE(WaitUntilCurrentTimeIsAfter(start_seek_time)); | 177 ASSERT_TRUE(WaitUntilCurrentTimeIsAfter(start_seek_time)); |
180 ASSERT_TRUE(Seek(seek_time)); | 178 ASSERT_TRUE(Seek(seek_time)); |
181 EXPECT_GE(pipeline_->GetCurrentTime(), seek_time); | 179 EXPECT_GE(pipeline_->GetCurrentTime(), seek_time); |
(...skipping 15 matching lines...) Expand all Loading... |
197 | 195 |
198 // Verify video decoder & renderer can handle aborted demuxer reads. | 196 // Verify video decoder & renderer can handle aborted demuxer reads. |
199 TEST_F(PipelineIntegrationTest, ChunkDemuxerAbortRead_VideoOnly) { | 197 TEST_F(PipelineIntegrationTest, ChunkDemuxerAbortRead_VideoOnly) { |
200 ASSERT_TRUE(TestSeekDuringRead("bear-320x240-video-only.webm", 32768, | 198 ASSERT_TRUE(TestSeekDuringRead("bear-320x240-video-only.webm", 32768, |
201 base::TimeDelta::FromMilliseconds(200), | 199 base::TimeDelta::FromMilliseconds(200), |
202 base::TimeDelta::FromMilliseconds(1668), | 200 base::TimeDelta::FromMilliseconds(1668), |
203 0x1C896, 65536)); | 201 0x1C896, 65536)); |
204 } | 202 } |
205 | 203 |
206 } // namespace media | 204 } // namespace media |
OLD | NEW |