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

Side by Side Diff: media/cast/net/pacing/paced_sender_unittest.cc

Issue 567853002: Cast: Make pacing controllable by the extension (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: forgot to fix test files Created 6 years, 3 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/net/pacing/paced_sender.cc ('k') | media/cast/net/rtp/rtp_packetizer_unittest.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 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/big_endian.h" 7 #include "base/big_endian.h"
8 #include "base/test/simple_test_tick_clock.h" 8 #include "base/test/simple_test_tick_clock.h"
9 #include "media/cast/logging/logging_impl.h" 9 #include "media/cast/logging/logging_impl.h"
10 #include "media/cast/logging/simple_event_subscriber.h" 10 #include "media/cast/logging/simple_event_subscriber.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 DISALLOW_COPY_AND_ASSIGN(TestPacketSender); 58 DISALLOW_COPY_AND_ASSIGN(TestPacketSender);
59 }; 59 };
60 60
61 class PacedSenderTest : public ::testing::Test { 61 class PacedSenderTest : public ::testing::Test {
62 protected: 62 protected:
63 PacedSenderTest() { 63 PacedSenderTest() {
64 logging_.AddRawEventSubscriber(&subscriber_); 64 logging_.AddRawEventSubscriber(&subscriber_);
65 testing_clock_.Advance( 65 testing_clock_.Advance(
66 base::TimeDelta::FromMilliseconds(kStartMillisecond)); 66 base::TimeDelta::FromMilliseconds(kStartMillisecond));
67 task_runner_ = new test::FakeSingleThreadTaskRunner(&testing_clock_); 67 task_runner_ = new test::FakeSingleThreadTaskRunner(&testing_clock_);
68 paced_sender_.reset(new PacedSender( 68 paced_sender_.reset(new PacedSender(kTargetBurstSize,
69 &testing_clock_, &logging_, &mock_transport_, task_runner_)); 69 kMaxBurstSize,
70 &testing_clock_,
71 &logging_,
72 &mock_transport_,
73 task_runner_));
70 paced_sender_->RegisterAudioSsrc(kAudioSsrc); 74 paced_sender_->RegisterAudioSsrc(kAudioSsrc);
71 paced_sender_->RegisterVideoSsrc(kVideoSsrc); 75 paced_sender_->RegisterVideoSsrc(kVideoSsrc);
72 } 76 }
73 77
74 virtual ~PacedSenderTest() { 78 virtual ~PacedSenderTest() {
75 logging_.RemoveRawEventSubscriber(&subscriber_); 79 logging_.RemoveRawEventSubscriber(&subscriber_);
76 } 80 }
77 81
78 static void UpdateCastTransportStatus(CastTransportStatus status) { 82 static void UpdateCastTransportStatus(CastTransportStatus status) {
79 NOTREACHED(); 83 NOTREACHED();
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 EXPECT_TRUE(paced_sender_->ResendPackets(packets, dedup_info)); 461 EXPECT_TRUE(paced_sender_->ResendPackets(packets, dedup_info));
458 EXPECT_EQ(static_cast<int64>(kSize1), mock_transport_.GetBytesSent()); 462 EXPECT_EQ(static_cast<int64>(kSize1), mock_transport_.GetBytesSent());
459 463
460 dedup_info.resend_interval = base::TimeDelta::FromMilliseconds(5); 464 dedup_info.resend_interval = base::TimeDelta::FromMilliseconds(5);
461 EXPECT_TRUE(paced_sender_->ResendPackets(packets, dedup_info)); 465 EXPECT_TRUE(paced_sender_->ResendPackets(packets, dedup_info));
462 EXPECT_EQ(static_cast<int64>(2 * kSize1), mock_transport_.GetBytesSent()); 466 EXPECT_EQ(static_cast<int64>(2 * kSize1), mock_transport_.GetBytesSent());
463 } 467 }
464 468
465 } // namespace cast 469 } // namespace cast
466 } // namespace media 470 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/net/pacing/paced_sender.cc ('k') | media/cast/net/rtp/rtp_packetizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698