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

Side by Side Diff: media/cast/sender/video_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
« no previous file with comments | « media/cast/sender/video_encoder_unittest.cc ('k') | media/cast/test/cast_benchmarks.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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 VideoFrameMetadata::FRAME_DURATION, 136 VideoFrameMetadata::FRAME_DURATION,
137 base::TimeDelta::FromSecondsD(1.0 / frame_rate)); 137 base::TimeDelta::FromSecondsD(1.0 / frame_rate));
138 return frame; 138 return frame;
139 } 139 }
140 140
141 } // namespace 141 } // namespace
142 142
143 class VideoSenderTest : public ::testing::Test { 143 class VideoSenderTest : public ::testing::Test {
144 protected: 144 protected:
145 VideoSenderTest() 145 VideoSenderTest()
146 : testing_clock_(new base::SimpleTestTickClock()), 146 : testing_clock_(new base::SimpleTestTickClock(base::TimeTicks::Now())),
147 task_runner_(new test::FakeSingleThreadTaskRunner(testing_clock_)), 147 task_runner_(new test::FakeSingleThreadTaskRunner(testing_clock_)),
148 cast_environment_( 148 cast_environment_(
149 new CastEnvironment(scoped_ptr<base::TickClock>(testing_clock_), 149 new CastEnvironment(scoped_ptr<base::TickClock>(testing_clock_),
150 task_runner_, 150 task_runner_,
151 task_runner_, 151 task_runner_,
152 task_runner_)), 152 task_runner_)),
153 operational_status_(STATUS_UNINITIALIZED), 153 operational_status_(STATUS_UNINITIALIZED),
154 vea_factory_(task_runner_) { 154 vea_factory_(task_runner_) {
155 testing_clock_->Advance(base::TimeTicks::Now() - base::TimeTicks());
156 vea_factory_.SetAutoRespond(true); 155 vea_factory_.SetAutoRespond(true);
157 last_pixel_value_ = kPixelValue; 156 last_pixel_value_ = kPixelValue;
158 net::IPEndPoint dummy_endpoint; 157 net::IPEndPoint dummy_endpoint;
159 transport_sender_.reset(new CastTransportSenderImpl( 158 transport_sender_.reset(new CastTransportSenderImpl(
160 NULL, 159 NULL,
161 testing_clock_, 160 testing_clock_,
162 dummy_endpoint, 161 dummy_endpoint,
163 dummy_endpoint, 162 dummy_endpoint,
164 make_scoped_ptr(new base::DictionaryValue), 163 make_scoped_ptr(new base::DictionaryValue),
165 base::Bind(&UpdateCastTransportStatus), 164 base::Bind(&UpdateCastTransportStatus),
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 << ", hfr=" << kTestCases[i].high_frame_rate); 655 << ", hfr=" << kTestCases[i].high_frame_rate);
657 const scoped_refptr<VideoFrame> frame = 656 const scoped_refptr<VideoFrame> frame =
658 CreateFakeFrame(resolution, kTestCases[i].high_frame_rate); 657 CreateFakeFrame(resolution, kTestCases[i].high_frame_rate);
659 EXPECT_EQ(kTestCases[i].expected_bitrate, 658 EXPECT_EQ(kTestCases[i].expected_bitrate,
660 PeerVideoSender::GetMaximumTargetBitrateForFrame(*frame)); 659 PeerVideoSender::GetMaximumTargetBitrateForFrame(*frame));
661 } 660 }
662 } 661 }
663 662
664 } // namespace cast 663 } // namespace cast
665 } // namespace media 664 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/sender/video_encoder_unittest.cc ('k') | media/cast/test/cast_benchmarks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698