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

Side by Side Diff: media/cast/sender/audio_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 "media/cast/sender/audio_sender.h" 5 #include "media/cast/sender/audio_sender.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 int number_of_rtp_packets_; 66 int number_of_rtp_packets_;
67 int number_of_rtcp_packets_; 67 int number_of_rtcp_packets_;
68 68
69 DISALLOW_COPY_AND_ASSIGN(TestPacketSender); 69 DISALLOW_COPY_AND_ASSIGN(TestPacketSender);
70 }; 70 };
71 71
72 class AudioSenderTest : public ::testing::Test { 72 class AudioSenderTest : public ::testing::Test {
73 protected: 73 protected:
74 AudioSenderTest() { 74 AudioSenderTest() {
75 InitializeMediaLibrary(); 75 InitializeMediaLibrary();
76 testing_clock_ = new base::SimpleTestTickClock(); 76 testing_clock_ = new base::SimpleTestTickClock(base::TimeTicks::Now());
77 testing_clock_->Advance(base::TimeTicks::Now() - base::TimeTicks());
78 task_runner_ = new test::FakeSingleThreadTaskRunner(testing_clock_); 77 task_runner_ = new test::FakeSingleThreadTaskRunner(testing_clock_);
79 cast_environment_ = 78 cast_environment_ =
80 new CastEnvironment(scoped_ptr<base::TickClock>(testing_clock_), 79 new CastEnvironment(scoped_ptr<base::TickClock>(testing_clock_),
81 task_runner_, task_runner_, task_runner_); 80 task_runner_, task_runner_, task_runner_);
82 audio_config_.codec = CODEC_AUDIO_OPUS; 81 audio_config_.codec = CODEC_AUDIO_OPUS;
83 audio_config_.use_external_encoder = false; 82 audio_config_.use_external_encoder = false;
84 audio_config_.frequency = kDefaultAudioSamplingRate; 83 audio_config_.frequency = kDefaultAudioSamplingRate;
85 audio_config_.channels = 2; 84 audio_config_.channels = 2;
86 audio_config_.bitrate = kDefaultAudioEncoderBitrate; 85 audio_config_.bitrate = kDefaultAudioEncoderBitrate;
87 audio_config_.rtp_payload_type = 127; 86 audio_config_.rtp_payload_type = 127;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 base::TimeDelta max_rtcp_timeout = 153 base::TimeDelta max_rtcp_timeout =
155 base::TimeDelta::FromMilliseconds(1 + kRtcpReportIntervalMs * 3 / 2); 154 base::TimeDelta::FromMilliseconds(1 + kRtcpReportIntervalMs * 3 / 2);
156 testing_clock_->Advance(max_rtcp_timeout); 155 testing_clock_->Advance(max_rtcp_timeout);
157 task_runner_->RunTasks(); 156 task_runner_->RunTasks();
158 EXPECT_LE(1, transport_.number_of_rtp_packets()); 157 EXPECT_LE(1, transport_.number_of_rtp_packets());
159 EXPECT_LE(1, transport_.number_of_rtcp_packets()); 158 EXPECT_LE(1, transport_.number_of_rtcp_packets());
160 } 159 }
161 160
162 } // namespace cast 161 } // namespace cast
163 } // namespace media 162 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/sender/audio_encoder_unittest.cc ('k') | media/cast/sender/congestion_control_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698