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

Unified Diff: media/cast/net/pacing/paced_sender_unittest.cc

Issue 1487223002: Change PacketKey to be unique for each frame packet by including (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/cast/net/pacing/paced_sender.cc ('k') | media/cast/net/rtp/packet_storage_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/net/pacing/paced_sender_unittest.cc
diff --git a/media/cast/net/pacing/paced_sender_unittest.cc b/media/cast/net/pacing/paced_sender_unittest.cc
index 13d5afdbae444f421d3bb4a469ab839119ac589c..1df741584cfcf289be824415df29c79773ad9d5a 100644
--- a/media/cast/net/pacing/paced_sender_unittest.cc
+++ b/media/cast/net/pacing/paced_sender_unittest.cc
@@ -57,7 +57,7 @@ class TestPacketSender : public PacketSender {
class PacedSenderTest : public ::testing::Test {
protected:
- PacedSenderTest() {
+ PacedSenderTest() : frame_id_(0) {
testing_clock_.Advance(
base::TimeDelta::FromMilliseconds(kStartMillisecond));
task_runner_ = new test::FakeSingleThreadTaskRunner(&testing_clock_);
@@ -77,14 +77,10 @@ class PacedSenderTest : public ::testing::Test {
bool audio) {
DCHECK_GE(packet_size, 12u);
SendPacketVector packets;
- base::TimeTicks frame_tick = testing_clock_.NowTicks();
- // Advance the clock so that we don't get the same frame_tick
- // next time this function is called.
- testing_clock_.Advance(base::TimeDelta::FromMilliseconds(1));
for (int i = 0; i < num_of_packets_in_frame; ++i) {
PacketKey key = PacedPacketSender::MakePacketKey(
- frame_tick,
- audio ? kAudioSsrc : kVideoSsrc, // ssrc
+ PacketKey::RTP, frame_id_,
+ audio ? kAudioSsrc : kVideoSsrc, // ssrc
i);
PacketRef packet(new base::RefCountedData<Packet>);
@@ -102,6 +98,9 @@ class PacedSenderTest : public ::testing::Test {
CHECK(success);
packets.push_back(std::make_pair(key, packet));
}
+ // Increase |frame_id_| so that we don't get the same key next time this
+ // function is called.
+ ++frame_id_;
return packets;
}
@@ -124,6 +123,7 @@ class PacedSenderTest : public ::testing::Test {
TestPacketSender mock_transport_;
scoped_refptr<test::FakeSingleThreadTaskRunner> task_runner_;
scoped_ptr<PacedSender> paced_sender_;
+ uint32 frame_id_;
DISALLOW_COPY_AND_ASSIGN(PacedSenderTest);
};
« no previous file with comments | « media/cast/net/pacing/paced_sender.cc ('k') | media/cast/net/rtp/packet_storage_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698