OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromecast/media/cma/test/mock_frame_consumer.h" | 5 #include "chromecast/media/cma/test/mock_frame_consumer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 pattern_idx_(0), | 24 pattern_idx_(0), |
25 last_read_aborted_by_flush_(false) { | 25 last_read_aborted_by_flush_(false) { |
26 } | 26 } |
27 | 27 |
28 MockFrameConsumer::~MockFrameConsumer() { | 28 MockFrameConsumer::~MockFrameConsumer() { |
29 } | 29 } |
30 | 30 |
31 void MockFrameConsumer::Configure( | 31 void MockFrameConsumer::Configure( |
32 const std::vector<bool>& delayed_task_pattern, | 32 const std::vector<bool>& delayed_task_pattern, |
33 bool last_read_aborted_by_flush, | 33 bool last_read_aborted_by_flush, |
34 scoped_ptr<FrameGeneratorForTest> frame_generator) { | 34 std::unique_ptr<FrameGeneratorForTest> frame_generator) { |
35 delayed_task_pattern_ = delayed_task_pattern; | 35 delayed_task_pattern_ = delayed_task_pattern; |
36 last_read_aborted_by_flush_ = last_read_aborted_by_flush; | 36 last_read_aborted_by_flush_ = last_read_aborted_by_flush; |
37 frame_generator_.reset(frame_generator.release()); | 37 frame_generator_.reset(frame_generator.release()); |
38 } | 38 } |
39 | 39 |
40 void MockFrameConsumer::Start(const base::Closure& done_cb) { | 40 void MockFrameConsumer::Start(const base::Closure& done_cb) { |
41 done_cb_ = done_cb; | 41 done_cb_ = done_cb; |
42 | 42 |
43 pattern_idx_ = 0; | 43 pattern_idx_ = 0; |
44 | 44 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 } | 106 } |
107 } | 107 } |
108 | 108 |
109 void MockFrameConsumer::OnFlushCompleted() { | 109 void MockFrameConsumer::OnFlushCompleted() { |
110 EXPECT_EQ(frame_generator_->RemainingFrameCount(), 0u); | 110 EXPECT_EQ(frame_generator_->RemainingFrameCount(), 0u); |
111 done_cb_.Run(); | 111 done_cb_.Run(); |
112 } | 112 } |
113 | 113 |
114 } // namespace media | 114 } // namespace media |
115 } // namespace chromecast | 115 } // namespace chromecast |
OLD | NEW |