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

Side by Side Diff: net/quic/congestion_control/inter_arrival_overuse_detector_test.cc

Issue 125403006: Various QUIC cleanups to sync with internal code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comments Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 <stdlib.h> 5 #include <stdlib.h>
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/rand_util.h" 10 #include "base/rand_util.h"
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 262
263 TEST_F(InterArrivalOveruseDetectorTest, DISABLED_TestNoise) { 263 TEST_F(InterArrivalOveruseDetectorTest, DISABLED_TestNoise) {
264 int count[100]; 264 int count[100];
265 memset(count, 0, sizeof(count)); 265 memset(count, 0, sizeof(count));
266 for (int i = 0; i < 10000; ++i) { 266 for (int i = 0; i < 10000; ++i) {
267 QuicTime::Delta mean = QuicTime::Delta::FromMilliseconds(30); 267 QuicTime::Delta mean = QuicTime::Delta::FromMilliseconds(30);
268 QuicTime::Delta standard_deviation = QuicTime::Delta::FromMilliseconds(10); 268 QuicTime::Delta standard_deviation = QuicTime::Delta::FromMilliseconds(10);
269 count[GaussianRandom(mean, standard_deviation).ToMilliseconds()]++; 269 count[GaussianRandom(mean, standard_deviation).ToMilliseconds()]++;
270 } 270 }
271 for (int j = 0; j < 100; ++j) { 271 for (int j = 0; j < 100; ++j) {
272 DLOG(INFO) << j << ":" << count[j]; 272 DVLOG(1) << j << ":" << count[j];
273 } 273 }
274 } 274 }
275 275
276 TEST_F(InterArrivalOveruseDetectorTest, DISABLED_SimpleNonOveruse) { 276 TEST_F(InterArrivalOveruseDetectorTest, DISABLED_SimpleNonOveruse) {
277 QuicPacketSequenceNumber sequence_number = 1; 277 QuicPacketSequenceNumber sequence_number = 1;
278 QuicTime::Delta delta = QuicTime::Delta::FromMilliseconds(10); 278 QuicTime::Delta delta = QuicTime::Delta::FromMilliseconds(10);
279 279
280 for (int i = 0; i < 1000; ++i) { 280 for (int i = 0; i < 1000; ++i) {
281 QuicTime send_time = send_clock_.ApproximateNow(); 281 QuicTime send_time = send_clock_.ApproximateNow();
282 QuicTime receive_time = receive_clock_.ApproximateNow(); 282 QuicTime receive_time = receive_clock_.ApproximateNow();
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 drift_per_burst = QuicTime::Delta::FromMilliseconds(0); 1105 drift_per_burst = QuicTime::Delta::FromMilliseconds(0);
1106 int bursts_until_steady = RunUntilSteady(packets_per_burst, 1106 int bursts_until_steady = RunUntilSteady(packets_per_burst,
1107 mean, 1107 mean,
1108 standard_deviation, 1108 standard_deviation,
1109 drift_per_burst); 1109 drift_per_burst);
1110 EXPECT_GE(41, bursts_until_steady); 1110 EXPECT_GE(41, bursts_until_steady);
1111 } 1111 }
1112 1112
1113 } // namespace test 1113 } // namespace test
1114 } // namespace net 1114 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/inter_arrival_bitrate_ramp_up_test.cc ('k') | net/quic/congestion_control/inter_arrival_probe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698