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/audio_receiver/audio_receiver.h" | 9 #include "media/cast/audio_receiver/audio_receiver.h" |
10 #include "media/cast/cast_defines.h" | 10 #include "media/cast/cast_defines.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 fake_audio_client_.SetNextExpectedResult(kFirstFrameId, | 134 fake_audio_client_.SetNextExpectedResult(kFirstFrameId, |
135 testing_clock_->NowTicks()); | 135 testing_clock_->NowTicks()); |
136 FeedOneFrameIntoReceiver(); | 136 FeedOneFrameIntoReceiver(); |
137 task_runner_->RunTasks(); | 137 task_runner_->RunTasks(); |
138 EXPECT_EQ(1, fake_audio_client_.number_times_called()); | 138 EXPECT_EQ(1, fake_audio_client_.number_times_called()); |
139 | 139 |
140 std::vector<FrameEvent> frame_events; | 140 std::vector<FrameEvent> frame_events; |
141 event_subscriber.GetFrameEventsAndReset(&frame_events); | 141 event_subscriber.GetFrameEventsAndReset(&frame_events); |
142 | 142 |
143 ASSERT_TRUE(!frame_events.empty()); | 143 ASSERT_TRUE(!frame_events.empty()); |
144 EXPECT_EQ(kAudioAckSent, frame_events.begin()->type); | 144 EXPECT_EQ(FRAME_ACK_SENT, frame_events.begin()->type); |
| 145 EXPECT_EQ(AUDIO_EVENT, frame_events.begin()->media_type); |
145 EXPECT_EQ(rtp_header_.frame_id, frame_events.begin()->frame_id); | 146 EXPECT_EQ(rtp_header_.frame_id, frame_events.begin()->frame_id); |
146 EXPECT_EQ(rtp_header_.rtp_timestamp, frame_events.begin()->rtp_timestamp); | 147 EXPECT_EQ(rtp_header_.rtp_timestamp, frame_events.begin()->rtp_timestamp); |
147 | 148 |
148 cast_environment_->Logging()->RemoveRawEventSubscriber(&event_subscriber); | 149 cast_environment_->Logging()->RemoveRawEventSubscriber(&event_subscriber); |
149 } | 150 } |
150 | 151 |
151 TEST_F(AudioReceiverTest, MultiplePendingGetCalls) { | 152 TEST_F(AudioReceiverTest, MultiplePendingGetCalls) { |
152 EXPECT_CALL(mock_transport_, SendRtcpPacket(_, _)) | 153 EXPECT_CALL(mock_transport_, SendRtcpPacket(_, _)) |
153 .WillRepeatedly(testing::Return(true)); | 154 .WillRepeatedly(testing::Return(true)); |
154 | 155 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 224 |
224 // Move forward another 100 ms and run any pending tasks (there should be | 225 // Move forward another 100 ms and run any pending tasks (there should be |
225 // none). Expect no additional frames where emitted. | 226 // none). Expect no additional frames where emitted. |
226 testing_clock_->Advance(base::TimeDelta::FromMilliseconds(100)); | 227 testing_clock_->Advance(base::TimeDelta::FromMilliseconds(100)); |
227 task_runner_->RunTasks(); | 228 task_runner_->RunTasks(); |
228 EXPECT_EQ(3, fake_audio_client_.number_times_called()); | 229 EXPECT_EQ(3, fake_audio_client_.number_times_called()); |
229 } | 230 } |
230 | 231 |
231 } // namespace cast | 232 } // namespace cast |
232 } // namespace media | 233 } // namespace media |
OLD | NEW |