| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |