| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 TEST_F(NullVideoSinkTest, BasicFunctionality) { | 69 TEST_F(NullVideoSinkTest, BasicFunctionality) { |
| 70 const base::TimeDelta kInterval = base::TimeDelta::FromMilliseconds(25); | 70 const base::TimeDelta kInterval = base::TimeDelta::FromMilliseconds(25); |
| 71 | 71 |
| 72 std::unique_ptr<NullVideoSink> sink = ConstructSink(false, kInterval); | 72 std::unique_ptr<NullVideoSink> sink = ConstructSink(false, kInterval); |
| 73 scoped_refptr<VideoFrame> test_frame = CreateFrame(base::TimeDelta()); | 73 scoped_refptr<VideoFrame> test_frame = CreateFrame(base::TimeDelta()); |
| 74 | 74 |
| 75 // The sink shouldn't have to be started to use the paint method. | 75 // The sink shouldn't have to be started to use the paint method. |
| 76 EXPECT_CALL(*this, FrameReceived(test_frame)); | 76 EXPECT_CALL(*this, FrameReceived(test_frame)); |
| 77 sink->PaintFrameUsingOldRenderingPath(test_frame); | 77 sink->PaintSingleFrame(test_frame); |
| 78 | 78 |
| 79 { | 79 { |
| 80 SCOPED_TRACE("Waiting for sink startup."); | 80 SCOPED_TRACE("Waiting for sink startup."); |
| 81 sink->Start(this); | 81 sink->Start(this); |
| 82 const base::TimeTicks current_time = tick_clock_.NowTicks(); | 82 const base::TimeTicks current_time = tick_clock_.NowTicks(); |
| 83 const base::TimeTicks current_interval_end = current_time + kInterval; | 83 const base::TimeTicks current_interval_end = current_time + kInterval; |
| 84 EXPECT_CALL(*this, Render(current_time, current_interval_end, false)) | 84 EXPECT_CALL(*this, Render(current_time, current_interval_end, false)) |
| 85 .WillOnce(Return(test_frame)); | 85 .WillOnce(Return(test_frame)); |
| 86 WaitableMessageLoopEvent event; | 86 WaitableMessageLoopEvent event; |
| 87 EXPECT_CALL(*this, FrameReceived(test_frame)) | 87 EXPECT_CALL(*this, FrameReceived(test_frame)) |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 .WillOnce( | 146 .WillOnce( |
| 147 DoAll(RunClosure(event.GetClosure()), Return(test_frame_2))); | 147 DoAll(RunClosure(event.GetClosure()), Return(test_frame_2))); |
| 148 } | 148 } |
| 149 } | 149 } |
| 150 event.RunAndWait(); | 150 event.RunAndWait(); |
| 151 ASSERT_LT(base::TimeTicks::Now() - now, kTestRuns * interval); | 151 ASSERT_LT(base::TimeTicks::Now() - now, kTestRuns * interval); |
| 152 sink->Stop(); | 152 sink->Stop(); |
| 153 } | 153 } |
| 154 | 154 |
| 155 } // namespace media | 155 } // namespace media |
| OLD | NEW |