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

Side by Side Diff: net/nqe/network_quality_estimator_unittest.cc

Issue 2340193003: NQE: Set RTT thresholds for effective connection type of 3G (Closed)
Patch Set: Created 4 years, 3 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 | « net/nqe/network_quality_estimator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "net/nqe/network_quality_estimator.h" 5 #include "net/nqe/network_quality_estimator.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <limits> 10 #include <limits>
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 int32_t transport_rtt_msec; 559 int32_t transport_rtt_msec;
560 EffectiveConnectionType expected_conn_type; 560 EffectiveConnectionType expected_conn_type;
561 } tests[] = { 561 } tests[] = {
562 // When the variation params do not override connection thresholds, 562 // When the variation params do not override connection thresholds,
563 // default values should be used. 563 // default values should be used.
564 {false, 5000, EFFECTIVE_CONNECTION_TYPE_SLOW_2G}, 564 {false, 5000, EFFECTIVE_CONNECTION_TYPE_SLOW_2G},
565 {false, 4000, EFFECTIVE_CONNECTION_TYPE_SLOW_2G}, 565 {false, 4000, EFFECTIVE_CONNECTION_TYPE_SLOW_2G},
566 {false, 3000, EFFECTIVE_CONNECTION_TYPE_SLOW_2G}, 566 {false, 3000, EFFECTIVE_CONNECTION_TYPE_SLOW_2G},
567 {false, 2000, EFFECTIVE_CONNECTION_TYPE_SLOW_2G}, 567 {false, 2000, EFFECTIVE_CONNECTION_TYPE_SLOW_2G},
568 {false, 1500, EFFECTIVE_CONNECTION_TYPE_2G}, 568 {false, 1500, EFFECTIVE_CONNECTION_TYPE_2G},
569 {false, 1000, EFFECTIVE_CONNECTION_TYPE_4G}, 569 {false, 1000, EFFECTIVE_CONNECTION_TYPE_3G},
570 {false, 100, EFFECTIVE_CONNECTION_TYPE_4G},
570 {false, 20, EFFECTIVE_CONNECTION_TYPE_4G}, 571 {false, 20, EFFECTIVE_CONNECTION_TYPE_4G},
571 // Override default thresholds using variation params. 572 // Override default thresholds using variation params.
572 {true, 5000, EFFECTIVE_CONNECTION_TYPE_OFFLINE}, 573 {true, 5000, EFFECTIVE_CONNECTION_TYPE_OFFLINE},
573 {true, 4000, EFFECTIVE_CONNECTION_TYPE_OFFLINE}, 574 {true, 4000, EFFECTIVE_CONNECTION_TYPE_OFFLINE},
574 {true, 3000, EFFECTIVE_CONNECTION_TYPE_SLOW_2G}, 575 {true, 3000, EFFECTIVE_CONNECTION_TYPE_SLOW_2G},
575 {true, 2000, EFFECTIVE_CONNECTION_TYPE_SLOW_2G}, 576 {true, 2000, EFFECTIVE_CONNECTION_TYPE_SLOW_2G},
576 {true, 1500, EFFECTIVE_CONNECTION_TYPE_2G}, 577 {true, 1500, EFFECTIVE_CONNECTION_TYPE_2G},
577 {true, 1000, EFFECTIVE_CONNECTION_TYPE_2G}, 578 {true, 1000, EFFECTIVE_CONNECTION_TYPE_2G},
578 {true, 20, EFFECTIVE_CONNECTION_TYPE_4G}, 579 {true, 20, EFFECTIVE_CONNECTION_TYPE_4G},
579 }; 580 };
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 int32_t http_rtt_msec; 617 int32_t http_rtt_msec;
617 EffectiveConnectionType expected_conn_type; 618 EffectiveConnectionType expected_conn_type;
618 } tests[] = { 619 } tests[] = {
619 // When the variation params do not override connection thresholds, 620 // When the variation params do not override connection thresholds,
620 // default values should be used. 621 // default values should be used.
621 {false, 5000, EFFECTIVE_CONNECTION_TYPE_SLOW_2G}, 622 {false, 5000, EFFECTIVE_CONNECTION_TYPE_SLOW_2G},
622 {false, 4000, EFFECTIVE_CONNECTION_TYPE_SLOW_2G}, 623 {false, 4000, EFFECTIVE_CONNECTION_TYPE_SLOW_2G},
623 {false, 3000, EFFECTIVE_CONNECTION_TYPE_SLOW_2G}, 624 {false, 3000, EFFECTIVE_CONNECTION_TYPE_SLOW_2G},
624 {false, 2000, EFFECTIVE_CONNECTION_TYPE_2G}, 625 {false, 2000, EFFECTIVE_CONNECTION_TYPE_2G},
625 {false, 1500, EFFECTIVE_CONNECTION_TYPE_2G}, 626 {false, 1500, EFFECTIVE_CONNECTION_TYPE_2G},
626 {false, 1000, EFFECTIVE_CONNECTION_TYPE_4G}, 627 {false, 1000, EFFECTIVE_CONNECTION_TYPE_3G},
628 {false, 100, EFFECTIVE_CONNECTION_TYPE_4G},
627 {false, 20, EFFECTIVE_CONNECTION_TYPE_4G}, 629 {false, 20, EFFECTIVE_CONNECTION_TYPE_4G},
628 // Override default thresholds using variation params. 630 // Override default thresholds using variation params.
629 {true, 5000, EFFECTIVE_CONNECTION_TYPE_OFFLINE}, 631 {true, 5000, EFFECTIVE_CONNECTION_TYPE_OFFLINE},
630 {true, 4000, EFFECTIVE_CONNECTION_TYPE_OFFLINE}, 632 {true, 4000, EFFECTIVE_CONNECTION_TYPE_OFFLINE},
631 {true, 3000, EFFECTIVE_CONNECTION_TYPE_SLOW_2G}, 633 {true, 3000, EFFECTIVE_CONNECTION_TYPE_SLOW_2G},
632 {true, 2000, EFFECTIVE_CONNECTION_TYPE_SLOW_2G}, 634 {true, 2000, EFFECTIVE_CONNECTION_TYPE_SLOW_2G},
633 {true, 1500, EFFECTIVE_CONNECTION_TYPE_2G}, 635 {true, 1500, EFFECTIVE_CONNECTION_TYPE_2G},
634 {true, 1000, EFFECTIVE_CONNECTION_TYPE_2G}, 636 {true, 1000, EFFECTIVE_CONNECTION_TYPE_2G},
635 {true, 20, EFFECTIVE_CONNECTION_TYPE_4G}, 637 {true, 20, EFFECTIVE_CONNECTION_TYPE_4G},
636 }; 638 };
(...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after
2084 if (expected_count == 1) { 2086 if (expected_count == 1) {
2085 EffectiveConnectionType last_notified_type = 2087 EffectiveConnectionType last_notified_type =
2086 observer.effective_connection_types().at( 2088 observer.effective_connection_types().at(
2087 observer.effective_connection_types().size() - 1); 2089 observer.effective_connection_types().size() - 1);
2088 EXPECT_EQ(i, last_notified_type); 2090 EXPECT_EQ(i, last_notified_type);
2089 } 2091 }
2090 } 2092 }
2091 } 2093 }
2092 2094
2093 } // namespace net 2095 } // namespace net
OLDNEW
« no previous file with comments | « net/nqe/network_quality_estimator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698