OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/threading/simple_thread.h" | 10 #include "base/threading/simple_thread.h" |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 | 279 |
280 private: | 280 private: |
281 DISALLOW_COPY_AND_ASSIGN(PipelineImplTest); | 281 DISALLOW_COPY_AND_ASSIGN(PipelineImplTest); |
282 }; | 282 }; |
283 | 283 |
284 // Test that playback controls methods no-op when the pipeline hasn't been | 284 // Test that playback controls methods no-op when the pipeline hasn't been |
285 // started. | 285 // started. |
286 TEST_F(PipelineImplTest, NotStarted) { | 286 TEST_F(PipelineImplTest, NotStarted) { |
287 const base::TimeDelta kZero; | 287 const base::TimeDelta kZero; |
288 | 288 |
289 // StrictMock<> will ensure these never get called, and valgrind/purify will | 289 // StrictMock<> will ensure these never get called, and valgrind will |
290 // make sure the callbacks are instantly deleted. | 290 // make sure the callbacks are instantly deleted. |
291 pipeline_->Stop(base::Bind(&CallbackHelper::OnStop, | 291 pipeline_->Stop(base::Bind(&CallbackHelper::OnStop, |
292 base::Unretained(&callbacks_))); | 292 base::Unretained(&callbacks_))); |
293 pipeline_->Seek(kZero, | 293 pipeline_->Seek(kZero, |
294 base::Bind(&CallbackHelper::OnSeek, | 294 base::Bind(&CallbackHelper::OnSeek, |
295 base::Unretained(&callbacks_))); | 295 base::Unretained(&callbacks_))); |
296 | 296 |
297 EXPECT_FALSE(pipeline_->IsRunning()); | 297 EXPECT_FALSE(pipeline_->IsRunning()); |
298 EXPECT_FALSE(pipeline_->IsInitialized()); | 298 EXPECT_FALSE(pipeline_->IsInitialized()); |
299 EXPECT_FALSE(pipeline_->HasAudio()); | 299 EXPECT_FALSE(pipeline_->HasAudio()); |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 TestPipelineStatusNotification(0); | 892 TestPipelineStatusNotification(0); |
893 } | 893 } |
894 | 894 |
895 // Test that different-thread, some-delay callback (the expected common case) | 895 // Test that different-thread, some-delay callback (the expected common case) |
896 // works correctly. | 896 // works correctly. |
897 TEST(PipelineStatusNotificationTest, DelayedCallback) { | 897 TEST(PipelineStatusNotificationTest, DelayedCallback) { |
898 TestPipelineStatusNotification(20); | 898 TestPipelineStatusNotification(20); |
899 } | 899 } |
900 | 900 |
901 } // namespace media | 901 } // namespace media |
OLD | NEW |