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

Side by Side Diff: media/cast/sender/congestion_control_unittest.cc

Issue 1905763002: Convert //media/cast from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/congestion_control.h ('k') | media/cast/sender/external_video_encoder.h » ('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 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 task_runner_->PostDelayedTask(FROM_HERE, 56 task_runner_->PostDelayedTask(FROM_HERE,
57 base::Bind(&CongestionControlTest::AckFrame, 57 base::Bind(&CongestionControlTest::AckFrame,
58 base::Unretained(this), 58 base::Unretained(this),
59 frame_id_), 59 frame_id_),
60 ack_time); 60 ack_time);
61 task_runner_->Sleep(frame_delay); 61 task_runner_->Sleep(frame_delay);
62 } 62 }
63 } 63 }
64 64
65 base::SimpleTestTickClock testing_clock_; 65 base::SimpleTestTickClock testing_clock_;
66 scoped_ptr<CongestionControl> congestion_control_; 66 std::unique_ptr<CongestionControl> congestion_control_;
67 scoped_refptr<FakeSingleThreadTaskRunner> task_runner_; 67 scoped_refptr<FakeSingleThreadTaskRunner> task_runner_;
68 uint32_t frame_id_; 68 uint32_t frame_id_;
69 69
70 DISALLOW_COPY_AND_ASSIGN(CongestionControlTest); 70 DISALLOW_COPY_AND_ASSIGN(CongestionControlTest);
71 }; 71 };
72 72
73 // Tests that AdaptiveCongestionControl returns reasonable bitrates based on 73 // Tests that AdaptiveCongestionControl returns reasonable bitrates based on
74 // estimations of network bandwidth and how much is in-flight (i.e, using the 74 // estimations of network bandwidth and how much is in-flight (i.e, using the
75 // "target buffer fill" model). 75 // "target buffer fill" model).
76 TEST_F(CongestionControlTest, SimpleRun) { 76 TEST_F(CongestionControlTest, SimpleRun) {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 // Results should show that we have ~200ms to send. 137 // Results should show that we have ~200ms to send.
138 bitrate = congestion_control_->GetBitrate( 138 bitrate = congestion_control_->GetBitrate(
139 testing_clock_.NowTicks() + base::TimeDelta::FromMilliseconds(300), 139 testing_clock_.NowTicks() + base::TimeDelta::FromMilliseconds(300),
140 base::TimeDelta::FromMilliseconds(300)); 140 base::TimeDelta::FromMilliseconds(300));
141 EXPECT_NEAR(safe_bitrate / kTargetEmptyBufferFraction * 2 / 3, bitrate, 141 EXPECT_NEAR(safe_bitrate / kTargetEmptyBufferFraction * 2 / 3, bitrate,
142 safe_bitrate * 0.05); 142 safe_bitrate * 0.05);
143 } 143 }
144 144
145 } // namespace cast 145 } // namespace cast
146 } // namespace media 146 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/sender/congestion_control.h ('k') | media/cast/sender/external_video_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698