| 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 "remoting/protocol/capture_scheduler.h" | 5 #include "remoting/protocol/capture_scheduler.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/test/simple_test_tick_clock.h" | 8 #include "base/test/simple_test_tick_clock.h" |
| 9 #include "base/timer/mock_timer.h" | 9 #include "base/timer/mock_timer.h" |
| 10 #include "remoting/proto/video.pb.h" | 10 #include "remoting/proto/video.pb.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 scheduler_->OnCaptureCompleted(); | 51 scheduler_->OnCaptureCompleted(); |
| 52 | 52 |
| 53 VideoPacket packet; | 53 VideoPacket packet; |
| 54 packet.set_encode_time_ms(encode_delay.InMilliseconds()); | 54 packet.set_encode_time_ms(encode_delay.InMilliseconds()); |
| 55 scheduler_->OnFrameEncoded(&packet); | 55 scheduler_->OnFrameEncoded(&packet); |
| 56 | 56 |
| 57 scheduler_->OnFrameSent(); | 57 scheduler_->OnFrameSent(); |
| 58 | 58 |
| 59 scoped_ptr<VideoAck> ack(new VideoAck()); | 59 scoped_ptr<VideoAck> ack(new VideoAck()); |
| 60 ack->set_frame_id(packet.frame_id()); | 60 ack->set_frame_id(packet.frame_id()); |
| 61 scheduler_->ProcessVideoAck(ack.Pass()); | 61 scheduler_->ProcessVideoAck(std::move(ack)); |
| 62 | 62 |
| 63 EXPECT_TRUE(capture_timer_->IsRunning()); | 63 EXPECT_TRUE(capture_timer_->IsRunning()); |
| 64 EXPECT_EQ(std::max(base::TimeDelta(), | 64 EXPECT_EQ(std::max(base::TimeDelta(), |
| 65 expected_delay_between_frames - capture_delay), | 65 expected_delay_between_frames - capture_delay), |
| 66 capture_timer_->GetCurrentDelay()); | 66 capture_timer_->GetCurrentDelay()); |
| 67 } | 67 } |
| 68 | 68 |
| 69 protected: | 69 protected: |
| 70 base::MessageLoop message_loop_; | 70 base::MessageLoop message_loop_; |
| 71 | 71 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 | 188 |
| 189 // Next frame should be scheduled, once one of the queued frames is | 189 // Next frame should be scheduled, once one of the queued frames is |
| 190 // acknowledged. | 190 // acknowledged. |
| 191 EXPECT_FALSE(capture_timer_->IsRunning()); | 191 EXPECT_FALSE(capture_timer_->IsRunning()); |
| 192 scheduler_->ProcessVideoAck(make_scoped_ptr(new VideoAck())); | 192 scheduler_->ProcessVideoAck(make_scoped_ptr(new VideoAck())); |
| 193 EXPECT_TRUE(capture_timer_->IsRunning()); | 193 EXPECT_TRUE(capture_timer_->IsRunning()); |
| 194 } | 194 } |
| 195 | 195 |
| 196 } // namespace protocol | 196 } // namespace protocol |
| 197 } // namespace remoting | 197 } // namespace remoting |
| OLD | NEW |