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 "media/filters/pipeline_controller.h" |
| 6 |
| 7 #include <memory> |
| 8 |
5 #include "base/bind.h" | 9 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
7 #include "base/logging.h" | 11 #include "base/logging.h" |
8 #include "base/macros.h" | 12 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
12 #include "base/time/time.h" | 15 #include "base/time/time.h" |
13 #include "media/base/mock_filters.h" | 16 #include "media/base/mock_filters.h" |
14 #include "media/base/pipeline.h" | 17 #include "media/base/pipeline.h" |
15 #include "media/filters/pipeline_controller.h" | |
16 #include "testing/gmock/include/gmock/gmock.h" | 18 #include "testing/gmock/include/gmock/gmock.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
18 | 20 |
19 using ::testing::_; | 21 using ::testing::_; |
20 using ::testing::DoAll; | 22 using ::testing::DoAll; |
21 using ::testing::Mock; | 23 using ::testing::Mock; |
22 using ::testing::NiceMock; | 24 using ::testing::NiceMock; |
23 using ::testing::Return; | 25 using ::testing::Return; |
24 using ::testing::SaveArg; | 26 using ::testing::SaveArg; |
25 using ::testing::StrictMock; | 27 using ::testing::StrictMock; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 EXPECT_FALSE(pipeline_controller_.IsPipelineSuspended()); | 102 EXPECT_FALSE(pipeline_controller_.IsPipelineSuspended()); |
101 return resume_cb; | 103 return resume_cb; |
102 } | 104 } |
103 | 105 |
104 void Complete(const PipelineStatusCB& cb) { | 106 void Complete(const PipelineStatusCB& cb) { |
105 cb.Run(PIPELINE_OK); | 107 cb.Run(PIPELINE_OK); |
106 message_loop_.RunUntilIdle(); | 108 message_loop_.RunUntilIdle(); |
107 } | 109 } |
108 | 110 |
109 protected: | 111 protected: |
110 scoped_ptr<Renderer> CreateRenderer() { return scoped_ptr<Renderer>(); } | 112 std::unique_ptr<Renderer> CreateRenderer() { |
| 113 return std::unique_ptr<Renderer>(); |
| 114 } |
111 | 115 |
112 void OnSeeked(bool time_updated) { | 116 void OnSeeked(bool time_updated) { |
113 was_seeked_ = true; | 117 was_seeked_ = true; |
114 last_seeked_time_updated_ = time_updated; | 118 last_seeked_time_updated_ = time_updated; |
115 } | 119 } |
116 | 120 |
117 void OnSuspended() { was_suspended_ = true; } | 121 void OnSuspended() { was_suspended_ = true; } |
118 | 122 |
119 void OnError(PipelineStatus status) { NOTREACHED(); } | 123 void OnError(PipelineStatus status) { NOTREACHED(); } |
120 | 124 |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 // Request a seek to the same time again. | 310 // Request a seek to the same time again. |
307 pipeline_controller_.Seek(seek_time, true); | 311 pipeline_controller_.Seek(seek_time, true); |
308 message_loop_.RunUntilIdle(); | 312 message_loop_.RunUntilIdle(); |
309 | 313 |
310 // Expect the second seek to trigger when the first seek completes. | 314 // Expect the second seek to trigger when the first seek completes. |
311 EXPECT_CALL(pipeline_, Seek(seek_time, _)); | 315 EXPECT_CALL(pipeline_, Seek(seek_time, _)); |
312 Complete(seek_cb_1); | 316 Complete(seek_cb_1); |
313 } | 317 } |
314 | 318 |
315 } // namespace media | 319 } // namespace media |
OLD | NEW |