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

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

Issue 1178423008: Provision to start base::SimpleTestTickClock at initial ticks Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 11 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 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/big_endian.h" 8 #include "base/big_endian.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/test/simple_test_tick_clock.h" 10 #include "base/test/simple_test_tick_clock.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 public: 53 public:
54 std::list<int> expected_packet_size_; 54 std::list<int> expected_packet_size_;
55 int64_t bytes_sent_; 55 int64_t bytes_sent_;
56 56
57 DISALLOW_COPY_AND_ASSIGN(TestPacketSender); 57 DISALLOW_COPY_AND_ASSIGN(TestPacketSender);
58 }; 58 };
59 59
60 class PacedSenderTest : public ::testing::Test { 60 class PacedSenderTest : public ::testing::Test {
61 protected: 61 protected:
62 PacedSenderTest() : frame_id_(0) { 62 PacedSenderTest()
63 testing_clock_.Advance( 63 : testing_clock_(base::TimeTicks() +
64 base::TimeDelta::FromMilliseconds(kStartMillisecond)); 64 base::TimeDelta::FromMilliseconds(kStartMillisecond)),
65 frame_id_(0) {
65 task_runner_ = new test::FakeSingleThreadTaskRunner(&testing_clock_); 66 task_runner_ = new test::FakeSingleThreadTaskRunner(&testing_clock_);
66 paced_sender_.reset(new PacedSender(kTargetBurstSize, kMaxBurstSize, 67 paced_sender_.reset(new PacedSender(kTargetBurstSize, kMaxBurstSize,
67 &testing_clock_, &packet_events_, 68 &testing_clock_, &packet_events_,
68 &mock_transport_, task_runner_)); 69 &mock_transport_, task_runner_));
69 paced_sender_->RegisterAudioSsrc(kAudioSsrc); 70 paced_sender_->RegisterAudioSsrc(kAudioSsrc);
70 paced_sender_->RegisterVideoSsrc(kVideoSsrc); 71 paced_sender_->RegisterVideoSsrc(kVideoSsrc);
71 } 72 }
72 73
73 static void UpdateCastTransportStatus(CastTransportStatus status) { 74 static void UpdateCastTransportStatus(CastTransportStatus status) {
74 NOTREACHED(); 75 NOTREACHED();
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 EXPECT_TRUE(paced_sender_->ResendPackets(packets, dedup_info)); 455 EXPECT_TRUE(paced_sender_->ResendPackets(packets, dedup_info));
455 EXPECT_EQ(static_cast<int64_t>(kSize1), mock_transport_.GetBytesSent()); 456 EXPECT_EQ(static_cast<int64_t>(kSize1), mock_transport_.GetBytesSent());
456 457
457 dedup_info.resend_interval = base::TimeDelta::FromMilliseconds(5); 458 dedup_info.resend_interval = base::TimeDelta::FromMilliseconds(5);
458 EXPECT_TRUE(paced_sender_->ResendPackets(packets, dedup_info)); 459 EXPECT_TRUE(paced_sender_->ResendPackets(packets, dedup_info));
459 EXPECT_EQ(static_cast<int64_t>(2 * kSize1), mock_transport_.GetBytesSent()); 460 EXPECT_EQ(static_cast<int64_t>(2 * kSize1), mock_transport_.GetBytesSent());
460 } 461 }
461 462
462 } // namespace cast 463 } // namespace cast
463 } // namespace media 464 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/net/cast_transport_sender_impl_unittest.cc ('k') | media/cast/net/rtcp/receiver_rtcp_event_subscriber_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698