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

Side by Side Diff: media/cast/net/rtcp/receiver_rtcp_event_subscriber_unittest.cc

Issue 1534273002: Switch to standard integer types in media/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more Created 5 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/memory/ref_counted.h" 5 #include "base/memory/ref_counted.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/test/simple_test_tick_clock.h" 7 #include "base/test/simple_test_tick_clock.h"
8 #include "base/time/tick_clock.h" 8 #include "base/time/tick_clock.h"
9 #include "media/cast/cast_environment.h" 9 #include "media/cast/cast_environment.h"
10 #include "media/cast/logging/logging_defines.h" 10 #include "media/cast/logging/logging_defines.h"
11 #include "media/cast/net/rtcp/receiver_rtcp_event_subscriber.h" 11 #include "media/cast/net/rtcp/receiver_rtcp_event_subscriber.h"
12 #include "media/cast/test/fake_single_thread_task_runner.h" 12 #include "media/cast/test/fake_single_thread_task_runner.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 14
15 namespace media { 15 namespace media {
16 namespace cast { 16 namespace cast {
17 17
18 namespace { 18 namespace {
19 19
20 const size_t kMaxEventEntries = 10u; 20 const size_t kMaxEventEntries = 10u;
21 const int64 kDelayMs = 20L; 21 const int64_t kDelayMs = 20L;
22 22
23 } // namespace 23 } // namespace
24 24
25 class ReceiverRtcpEventSubscriberTest : public ::testing::Test { 25 class ReceiverRtcpEventSubscriberTest : public ::testing::Test {
26 protected: 26 protected:
27 ReceiverRtcpEventSubscriberTest() 27 ReceiverRtcpEventSubscriberTest()
28 : testing_clock_(new base::SimpleTestTickClock()), 28 : testing_clock_(new base::SimpleTestTickClock()),
29 task_runner_(new test::FakeSingleThreadTaskRunner(testing_clock_)), 29 task_runner_(new test::FakeSingleThreadTaskRunner(testing_clock_)),
30 cast_environment_(new CastEnvironment( 30 cast_environment_(new CastEnvironment(
31 scoped_ptr<base::TickClock>(testing_clock_).Pass(), 31 scoped_ptr<base::TickClock>(testing_clock_).Pass(),
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 InsertEvents(); 146 InsertEvents();
147 ReceiverRtcpEventSubscriber::RtcpEvents rtcp_events; 147 ReceiverRtcpEventSubscriber::RtcpEvents rtcp_events;
148 event_subscriber_->GetRtcpEventsWithRedundancy(&rtcp_events); 148 event_subscriber_->GetRtcpEventsWithRedundancy(&rtcp_events);
149 EXPECT_EQ(3u, rtcp_events.size()); 149 EXPECT_EQ(3u, rtcp_events.size());
150 } 150 }
151 151
152 TEST_F(ReceiverRtcpEventSubscriberTest, DropEventsWhenSizeExceeded) { 152 TEST_F(ReceiverRtcpEventSubscriberTest, DropEventsWhenSizeExceeded) {
153 Init(VIDEO_EVENT); 153 Init(VIDEO_EVENT);
154 154
155 for (uint32 i = 1u; i <= 10u; ++i) { 155 for (uint32_t i = 1u; i <= 10u; ++i) {
156 scoped_ptr<FrameEvent> decode_event(new FrameEvent()); 156 scoped_ptr<FrameEvent> decode_event(new FrameEvent());
157 decode_event->timestamp = testing_clock_->NowTicks(); 157 decode_event->timestamp = testing_clock_->NowTicks();
158 decode_event->type = FRAME_DECODED; 158 decode_event->type = FRAME_DECODED;
159 decode_event->media_type = VIDEO_EVENT; 159 decode_event->media_type = VIDEO_EVENT;
160 decode_event->rtp_timestamp = i * 10; 160 decode_event->rtp_timestamp = i * 10;
161 decode_event->frame_id = i; 161 decode_event->frame_id = i;
162 cast_environment_->logger()->DispatchFrameEvent(decode_event.Pass()); 162 cast_environment_->logger()->DispatchFrameEvent(decode_event.Pass());
163 } 163 }
164 164
165 ReceiverRtcpEventSubscriber::RtcpEvents rtcp_events; 165 ReceiverRtcpEventSubscriber::RtcpEvents rtcp_events;
166 event_subscriber_->GetRtcpEventsWithRedundancy(&rtcp_events); 166 event_subscriber_->GetRtcpEventsWithRedundancy(&rtcp_events);
167 EXPECT_EQ(10u, rtcp_events.size()); 167 EXPECT_EQ(10u, rtcp_events.size());
168 } 168 }
169 169
170 } // namespace cast 170 } // namespace cast
171 } // namespace media 171 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698