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

Side by Side Diff: media/cast/video_receiver/video_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
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/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
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
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
OLDNEW
« no previous file with comments | « media/cast/video_receiver/video_receiver.cc ('k') | media/cast/video_sender/external_video_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698