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 <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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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()), |
147 task_runner_(new test::FakeSingleThreadTaskRunner(testing_clock_)), | 147 task_runner_(new test::FakeSingleThreadTaskRunner(testing_clock_)), |
148 cast_environment_(new CastEnvironment( | 148 cast_environment_( |
149 scoped_ptr<base::TickClock>(testing_clock_).Pass(), | 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()); | 155 testing_clock_->Advance(base::TimeTicks::Now() - base::TimeTicks()); |
156 vea_factory_.SetAutoRespond(true); | 156 vea_factory_.SetAutoRespond(true); |
157 last_pixel_value_ = kPixelValue; | 157 last_pixel_value_ = kPixelValue; |
158 net::IPEndPoint dummy_endpoint; | 158 net::IPEndPoint dummy_endpoint; |
159 transport_sender_.reset(new CastTransportSenderImpl( | 159 transport_sender_.reset(new CastTransportSenderImpl( |
160 NULL, | 160 NULL, |
161 testing_clock_, | 161 testing_clock_, |
162 dummy_endpoint, | 162 dummy_endpoint, |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 << ", hfr=" << kTestCases[i].high_frame_rate); | 656 << ", hfr=" << kTestCases[i].high_frame_rate); |
657 const scoped_refptr<VideoFrame> frame = | 657 const scoped_refptr<VideoFrame> frame = |
658 CreateFakeFrame(resolution, kTestCases[i].high_frame_rate); | 658 CreateFakeFrame(resolution, kTestCases[i].high_frame_rate); |
659 EXPECT_EQ(kTestCases[i].expected_bitrate, | 659 EXPECT_EQ(kTestCases[i].expected_bitrate, |
660 PeerVideoSender::GetMaximumTargetBitrateForFrame(*frame)); | 660 PeerVideoSender::GetMaximumTargetBitrateForFrame(*frame)); |
661 } | 661 } |
662 } | 662 } |
663 | 663 |
664 } // namespace cast | 664 } // namespace cast |
665 } // namespace media | 665 } // namespace media |
OLD | NEW |