Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(819)

Side by Side Diff: media/cast/audio_receiver/audio_receiver_unittest.cc

Issue 270493003: Cast: Deduplicate event types in cast library. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/cast/audio_receiver/audio_receiver.cc ('k') | media/cast/audio_sender/audio_encoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « media/cast/audio_receiver/audio_receiver.cc ('k') | media/cast/audio_sender/audio_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698