| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "media/base/mock_filters.h" | 13 #include "media/base/mock_filters.h" |
| 14 #include "media/base/pipeline.h" | 14 #include "media/base/pipeline.h" |
| 15 #include "media/base/pipeline_client.h" |
| 15 #include "media/filters/pipeline_controller.h" | 16 #include "media/filters/pipeline_controller.h" |
| 16 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 18 | 19 |
| 19 using ::testing::_; | 20 using ::testing::_; |
| 20 using ::testing::DoAll; | 21 using ::testing::DoAll; |
| 21 using ::testing::Mock; | 22 using ::testing::Mock; |
| 22 using ::testing::NiceMock; | 23 using ::testing::NiceMock; |
| 23 using ::testing::Return; | 24 using ::testing::Return; |
| 24 using ::testing::SaveArg; | 25 using ::testing::SaveArg; |
| 25 using ::testing::StrictMock; | 26 using ::testing::StrictMock; |
| 26 | 27 |
| 27 namespace media { | 28 namespace media { |
| 28 | 29 |
| 29 class PipelineControllerTest : public ::testing::Test { | 30 class PipelineControllerTest : public ::testing::Test, public PipelineClient { |
| 30 public: | 31 public: |
| 31 PipelineControllerTest() | 32 PipelineControllerTest() |
| 32 : pipeline_controller_(&pipeline_, | 33 : pipeline_(this), |
| 34 pipeline_controller_(&pipeline_, |
| 33 base::Bind(&PipelineControllerTest::CreateRenderer, | 35 base::Bind(&PipelineControllerTest::CreateRenderer, |
| 34 base::Unretained(this)), | 36 base::Unretained(this)), |
| 35 base::Bind(&PipelineControllerTest::OnSeeked, | 37 base::Bind(&PipelineControllerTest::OnSeeked, |
| 36 base::Unretained(this)), | 38 base::Unretained(this)), |
| 37 base::Bind(&PipelineControllerTest::OnSuspended, | 39 base::Bind(&PipelineControllerTest::OnSuspended, |
| 38 base::Unretained(this)), | 40 base::Unretained(this)), |
| 39 base::Bind(&PipelineControllerTest::OnError, | 41 base::Bind(&PipelineControllerTest::OnError, |
| 40 base::Unretained(this))) {} | 42 base::Unretained(this))) {} |
| 41 | 43 |
| 42 ~PipelineControllerTest() override {} | 44 ~PipelineControllerTest() override {} |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 // Request a seek to the same time again. | 308 // Request a seek to the same time again. |
| 307 pipeline_controller_.Seek(seek_time, true); | 309 pipeline_controller_.Seek(seek_time, true); |
| 308 message_loop_.RunUntilIdle(); | 310 message_loop_.RunUntilIdle(); |
| 309 | 311 |
| 310 // Expect the second seek to trigger when the first seek completes. | 312 // Expect the second seek to trigger when the first seek completes. |
| 311 EXPECT_CALL(pipeline_, Seek(seek_time, _)); | 313 EXPECT_CALL(pipeline_, Seek(seek_time, _)); |
| 312 Complete(seek_cb_1); | 314 Complete(seek_cb_1); |
| 313 } | 315 } |
| 314 | 316 |
| 315 } // namespace media | 317 } // namespace media |
| OLD | NEW |