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

Side by Side Diff: media/cast/sender/h264_vt_encoder_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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include <queue> 7 #include <queue>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 216
217 private: 217 private:
218 bool IsOnBatteryPowerImpl() final { return false; } 218 bool IsOnBatteryPowerImpl() final { return false; }
219 }; 219 };
220 220
221 class H264VideoToolboxEncoderTest : public ::testing::Test { 221 class H264VideoToolboxEncoderTest : public ::testing::Test {
222 protected: 222 protected:
223 H264VideoToolboxEncoderTest() = default; 223 H264VideoToolboxEncoderTest() = default;
224 224
225 void SetUp() final { 225 void SetUp() final {
226 clock_ = new base::SimpleTestTickClock(); 226 clock_ = new base::SimpleTestTickClock(base::TimeTicks::Now());
227 clock_->Advance(base::TimeTicks::Now() - base::TimeTicks());
228 227
229 power_source_ = new TestPowerSource(); 228 power_source_ = new TestPowerSource();
230 power_monitor_.reset( 229 power_monitor_.reset(
231 new base::PowerMonitor(scoped_ptr<TestPowerSource>(power_source_))); 230 new base::PowerMonitor(scoped_ptr<TestPowerSource>(power_source_)));
232 231
233 cast_environment_ = new CastEnvironment( 232 cast_environment_ = new CastEnvironment(
234 scoped_ptr<base::TickClock>(clock_).Pass(), 233 scoped_ptr<base::TickClock>(clock_).Pass(),
235 message_loop_.task_runner(), message_loop_.task_runner(), 234 message_loop_.task_runner(), message_loop_.task_runner(),
236 message_loop_.task_runner()); 235 message_loop_.task_runner());
237 encoder_.reset(new H264VideoToolboxEncoder( 236 encoder_.reset(new H264VideoToolboxEncoder(
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 gfx::Size(kVideoWidth, kVideoHeight), base::TimeDelta())); 411 gfx::Size(kVideoWidth, kVideoHeight), base::TimeDelta()));
413 412
414 // After a power resume event, the factory should produce frames right away 413 // After a power resume event, the factory should produce frames right away
415 // because the encoder re-initializes on its own. 414 // because the encoder re-initializes on its own.
416 power_source_->GenerateResumeEvent(); 415 power_source_->GenerateResumeEvent();
417 CreateFrameAndMemsetPlane(video_frame_factory.get()); 416 CreateFrameAndMemsetPlane(video_frame_factory.get());
418 } 417 }
419 418
420 } // namespace cast 419 } // namespace cast
421 } // namespace media 420 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/sender/congestion_control_unittest.cc ('k') | media/cast/sender/video_encoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698