| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/test/simple_test_tick_clock.h" | 8 #include "base/test/simple_test_tick_clock.h" |
| 9 #include "media/cast/cast_defines.h" | 9 #include "media/cast/cast_defines.h" |
| 10 #include "media/cast/cast_environment.h" | 10 #include "media/cast/cast_environment.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 fake_video_client_.SetNextExpectedResult(kFirstFrameId, | 137 fake_video_client_.SetNextExpectedResult(kFirstFrameId, |
| 138 testing_clock_->NowTicks()); | 138 testing_clock_->NowTicks()); |
| 139 FeedOneFrameIntoReceiver(); | 139 FeedOneFrameIntoReceiver(); |
| 140 task_runner_->RunTasks(); | 140 task_runner_->RunTasks(); |
| 141 EXPECT_EQ(1, fake_video_client_.number_times_called()); | 141 EXPECT_EQ(1, fake_video_client_.number_times_called()); |
| 142 | 142 |
| 143 std::vector<FrameEvent> frame_events; | 143 std::vector<FrameEvent> frame_events; |
| 144 event_subscriber.GetFrameEventsAndReset(&frame_events); | 144 event_subscriber.GetFrameEventsAndReset(&frame_events); |
| 145 | 145 |
| 146 ASSERT_TRUE(!frame_events.empty()); | 146 ASSERT_TRUE(!frame_events.empty()); |
| 147 EXPECT_EQ(kVideoAckSent, frame_events.begin()->type); | 147 EXPECT_EQ(FRAME_ACK_SENT, frame_events.begin()->type); |
| 148 EXPECT_EQ(rtp_header_.frame_id, frame_events.begin()->frame_id); | 148 EXPECT_EQ(rtp_header_.frame_id, frame_events.begin()->frame_id); |
| 149 EXPECT_EQ(rtp_header_.rtp_timestamp, frame_events.begin()->rtp_timestamp); | 149 EXPECT_EQ(rtp_header_.rtp_timestamp, frame_events.begin()->rtp_timestamp); |
| 150 | 150 |
| 151 cast_environment_->Logging()->RemoveRawEventSubscriber(&event_subscriber); | 151 cast_environment_->Logging()->RemoveRawEventSubscriber(&event_subscriber); |
| 152 } | 152 } |
| 153 | 153 |
| 154 TEST_F(VideoReceiverTest, MultiplePendingGetCalls) { | 154 TEST_F(VideoReceiverTest, MultiplePendingGetCalls) { |
| 155 EXPECT_CALL(mock_transport_, SendRtcpPacket(_, _)) | 155 EXPECT_CALL(mock_transport_, SendRtcpPacket(_, _)) |
| 156 .WillRepeatedly(testing::Return(true)); | 156 .WillRepeatedly(testing::Return(true)); |
| 157 | 157 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 // Move forward another |rtp_max_delay_ms| and run any pending tasks (there | 223 // Move forward another |rtp_max_delay_ms| and run any pending tasks (there |
| 224 // should be none). Expect no additional frames where emitted. | 224 // should be none). Expect no additional frames where emitted. |
| 225 testing_clock_->Advance( | 225 testing_clock_->Advance( |
| 226 base::TimeDelta::FromMilliseconds(config_.rtp_max_delay_ms)); | 226 base::TimeDelta::FromMilliseconds(config_.rtp_max_delay_ms)); |
| 227 task_runner_->RunTasks(); | 227 task_runner_->RunTasks(); |
| 228 EXPECT_EQ(3, fake_video_client_.number_times_called()); | 228 EXPECT_EQ(3, fake_video_client_.number_times_called()); |
| 229 } | 229 } |
| 230 | 230 |
| 231 } // namespace cast | 231 } // namespace cast |
| 232 } // namespace media | 232 } // namespace media |
| OLD | NEW |