Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/base/network_quality_estimator.h" | 5 #include "net/base/network_quality_estimator.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 243 // Network quality should be unavailable when no observations are available. | 243 // Network quality should be unavailable when no observations are available. |
| 244 base::TimeDelta rtt; | 244 base::TimeDelta rtt; |
| 245 EXPECT_FALSE(estimator.GetRTTEstimate(&rtt)); | 245 EXPECT_FALSE(estimator.GetRTTEstimate(&rtt)); |
| 246 int32_t kbps; | 246 int32_t kbps; |
| 247 EXPECT_FALSE(estimator.GetDownlinkThroughputKbpsEstimate(&kbps)); | 247 EXPECT_FALSE(estimator.GetDownlinkThroughputKbpsEstimate(&kbps)); |
| 248 | 248 |
| 249 // Insert samples from {1,2,3,..., 100}. First insert odd samples, then even | 249 // Insert samples from {1,2,3,..., 100}. First insert odd samples, then even |
| 250 // samples. This helps in verifying that the order of samples does not matter. | 250 // samples. This helps in verifying that the order of samples does not matter. |
| 251 for (int i = 1; i <= 99; i += 2) { | 251 for (int i = 1; i <= 99; i += 2) { |
| 252 estimator.downstream_throughput_kbps_observations_.AddObservation( | 252 estimator.downstream_throughput_kbps_observations_.AddObservation( |
| 253 NetworkQualityEstimator::Observation(i, now)); | 253 NetworkQualityEstimator::Observation( |
| 254 i, now, NetworkQualityEstimator::URL_REQUEST)); | |
| 254 estimator.rtt_msec_observations_.AddObservation( | 255 estimator.rtt_msec_observations_.AddObservation( |
| 255 NetworkQualityEstimator::Observation(i, now)); | 256 NetworkQualityEstimator::Observation( |
| 257 i, now, NetworkQualityEstimator::URL_REQUEST)); | |
| 256 EXPECT_TRUE(estimator.GetRTTEstimate(&rtt)); | 258 EXPECT_TRUE(estimator.GetRTTEstimate(&rtt)); |
| 257 EXPECT_TRUE(estimator.GetDownlinkThroughputKbpsEstimate(&kbps)); | 259 EXPECT_TRUE(estimator.GetDownlinkThroughputKbpsEstimate(&kbps)); |
| 258 } | 260 } |
| 259 | 261 |
| 260 for (int i = 2; i <= 100; i += 2) { | 262 for (int i = 2; i <= 100; i += 2) { |
| 261 estimator.downstream_throughput_kbps_observations_.AddObservation( | 263 estimator.downstream_throughput_kbps_observations_.AddObservation( |
| 262 NetworkQualityEstimator::Observation(i, now)); | 264 NetworkQualityEstimator::Observation( |
| 265 i, now, NetworkQualityEstimator::URL_REQUEST)); | |
| 263 estimator.rtt_msec_observations_.AddObservation( | 266 estimator.rtt_msec_observations_.AddObservation( |
| 264 NetworkQualityEstimator::Observation(i, now)); | 267 NetworkQualityEstimator::Observation( |
| 268 i, now, NetworkQualityEstimator::URL_REQUEST)); | |
| 265 EXPECT_TRUE(estimator.GetRTTEstimate(&rtt)); | 269 EXPECT_TRUE(estimator.GetRTTEstimate(&rtt)); |
| 266 EXPECT_TRUE(estimator.GetDownlinkThroughputKbpsEstimate(&kbps)); | 270 EXPECT_TRUE(estimator.GetDownlinkThroughputKbpsEstimate(&kbps)); |
| 267 } | 271 } |
| 268 | 272 |
| 269 for (int i = 0; i <= 100; ++i) { | 273 for (int i = 0; i <= 100; ++i) { |
| 270 // Checks if the difference between the two integers is less than 1. This is | 274 // Checks if the difference between the two integers is less than 1. This is |
| 271 // required because computed percentiles may be slightly different from | 275 // required because computed percentiles may be slightly different from |
| 272 // what is expected due to floating point computation errors and integer | 276 // what is expected due to floating point computation errors and integer |
| 273 // rounding off errors. | 277 // rounding off errors. |
| 274 EXPECT_NEAR(estimator.GetDownlinkThroughputKbpsEstimateInternal( | 278 EXPECT_NEAR(estimator.GetDownlinkThroughputKbpsEstimateInternal( |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 295 // order. RTT percentiles must be in increasing order. | 299 // order. RTT percentiles must be in increasing order. |
| 296 TEST(NetworkQualityEstimatorTest, PercentileDifferentTimestamps) { | 300 TEST(NetworkQualityEstimatorTest, PercentileDifferentTimestamps) { |
| 297 std::map<std::string, std::string> variation_params; | 301 std::map<std::string, std::string> variation_params; |
| 298 TestNetworkQualityEstimator estimator(variation_params); | 302 TestNetworkQualityEstimator estimator(variation_params); |
| 299 base::TimeTicks now = base::TimeTicks::Now(); | 303 base::TimeTicks now = base::TimeTicks::Now(); |
| 300 base::TimeTicks very_old = base::TimeTicks::UnixEpoch(); | 304 base::TimeTicks very_old = base::TimeTicks::UnixEpoch(); |
| 301 | 305 |
| 302 // First 50 samples have very old timestamp. | 306 // First 50 samples have very old timestamp. |
| 303 for (int i = 1; i <= 50; ++i) { | 307 for (int i = 1; i <= 50; ++i) { |
| 304 estimator.downstream_throughput_kbps_observations_.AddObservation( | 308 estimator.downstream_throughput_kbps_observations_.AddObservation( |
| 305 NetworkQualityEstimator::Observation(i, very_old)); | 309 NetworkQualityEstimator::Observation( |
| 310 i, very_old, NetworkQualityEstimator::URL_REQUEST)); | |
| 306 estimator.rtt_msec_observations_.AddObservation( | 311 estimator.rtt_msec_observations_.AddObservation( |
| 307 NetworkQualityEstimator::Observation(i, very_old)); | 312 NetworkQualityEstimator::Observation( |
| 313 i, very_old, NetworkQualityEstimator::URL_REQUEST)); | |
| 308 } | 314 } |
| 309 | 315 |
| 310 // Next 50 (i.e., from 51 to 100) have recent timestamp. | 316 // Next 50 (i.e., from 51 to 100) have recent timestamp. |
| 311 for (int i = 51; i <= 100; ++i) { | 317 for (int i = 51; i <= 100; ++i) { |
| 312 estimator.downstream_throughput_kbps_observations_.AddObservation( | 318 estimator.downstream_throughput_kbps_observations_.AddObservation( |
| 313 NetworkQualityEstimator::Observation(i, now)); | 319 NetworkQualityEstimator::Observation( |
| 320 i, now, NetworkQualityEstimator::URL_REQUEST)); | |
| 314 estimator.rtt_msec_observations_.AddObservation( | 321 estimator.rtt_msec_observations_.AddObservation( |
| 315 NetworkQualityEstimator::Observation(i, now)); | 322 NetworkQualityEstimator::Observation( |
| 323 i, now, NetworkQualityEstimator::URL_REQUEST)); | |
| 316 } | 324 } |
| 317 | 325 |
| 318 // Older samples have very little weight. So, all percentiles are >= 51 | 326 // Older samples have very little weight. So, all percentiles are >= 51 |
| 319 // (lowest value among recent observations). | 327 // (lowest value among recent observations). |
| 320 for (int i = 1; i < 100; ++i) { | 328 for (int i = 1; i < 100; ++i) { |
| 321 // Checks if the difference between the two integers is less than 1. This is | 329 // Checks if the difference between the two integers is less than 1. This is |
| 322 // required because computed percentiles may be slightly different from | 330 // required because computed percentiles may be slightly different from |
| 323 // what is expected due to floating point computation errors and integer | 331 // what is expected due to floating point computation errors and integer |
| 324 // rounding off errors. | 332 // rounding off errors. |
| 325 EXPECT_NEAR(estimator.GetDownlinkThroughputKbpsEstimateInternal( | 333 EXPECT_NEAR(estimator.GetDownlinkThroughputKbpsEstimateInternal( |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 506 // Test if the network estimates are cached when network change notification | 514 // Test if the network estimates are cached when network change notification |
| 507 // is invoked. | 515 // is invoked. |
| 508 TEST(NetworkQualityEstimatorTest, TestCaching) { | 516 TEST(NetworkQualityEstimatorTest, TestCaching) { |
| 509 std::map<std::string, std::string> variation_params; | 517 std::map<std::string, std::string> variation_params; |
| 510 TestNetworkQualityEstimator estimator(variation_params); | 518 TestNetworkQualityEstimator estimator(variation_params); |
| 511 size_t expected_cache_size = 0; | 519 size_t expected_cache_size = 0; |
| 512 EXPECT_EQ(expected_cache_size, estimator.cached_network_qualities_.size()); | 520 EXPECT_EQ(expected_cache_size, estimator.cached_network_qualities_.size()); |
| 513 | 521 |
| 514 // Cache entry will not be added for (NONE, ""). | 522 // Cache entry will not be added for (NONE, ""). |
| 515 estimator.downstream_throughput_kbps_observations_.AddObservation( | 523 estimator.downstream_throughput_kbps_observations_.AddObservation( |
| 516 NetworkQualityEstimator::Observation(1, base::TimeTicks::Now())); | 524 NetworkQualityEstimator::Observation( |
| 525 1, base::TimeTicks::Now(), NetworkQualityEstimator::URL_REQUEST)); | |
| 517 estimator.rtt_msec_observations_.AddObservation( | 526 estimator.rtt_msec_observations_.AddObservation( |
| 518 NetworkQualityEstimator::Observation(1000, base::TimeTicks::Now())); | 527 NetworkQualityEstimator::Observation( |
| 528 1000, base::TimeTicks::Now(), NetworkQualityEstimator::URL_REQUEST)); | |
| 519 estimator.SimulateNetworkChangeTo( | 529 estimator.SimulateNetworkChangeTo( |
| 520 NetworkChangeNotifier::ConnectionType::CONNECTION_2G, "test-1"); | 530 NetworkChangeNotifier::ConnectionType::CONNECTION_2G, "test-1"); |
| 521 EXPECT_EQ(expected_cache_size, estimator.cached_network_qualities_.size()); | 531 EXPECT_EQ(expected_cache_size, estimator.cached_network_qualities_.size()); |
| 522 | 532 |
| 523 // Entry will be added for (2G, "test1"). | 533 // Entry will be added for (2G, "test1"). |
| 524 // Also, set the network quality for (2G, "test1") so that it is stored in | 534 // Also, set the network quality for (2G, "test1") so that it is stored in |
| 525 // the cache. | 535 // the cache. |
| 526 estimator.downstream_throughput_kbps_observations_.AddObservation( | 536 estimator.downstream_throughput_kbps_observations_.AddObservation( |
| 527 NetworkQualityEstimator::Observation(1, base::TimeTicks::Now())); | 537 NetworkQualityEstimator::Observation( |
| 538 1, base::TimeTicks::Now(), NetworkQualityEstimator::URL_REQUEST)); | |
| 528 estimator.rtt_msec_observations_.AddObservation( | 539 estimator.rtt_msec_observations_.AddObservation( |
| 529 NetworkQualityEstimator::Observation(1000, base::TimeTicks::Now())); | 540 NetworkQualityEstimator::Observation( |
| 541 1000, base::TimeTicks::Now(), NetworkQualityEstimator::URL_REQUEST)); | |
| 530 | 542 |
| 531 estimator.SimulateNetworkChangeTo( | 543 estimator.SimulateNetworkChangeTo( |
| 532 NetworkChangeNotifier::ConnectionType::CONNECTION_3G, "test-1"); | 544 NetworkChangeNotifier::ConnectionType::CONNECTION_3G, "test-1"); |
| 533 ++expected_cache_size; | 545 ++expected_cache_size; |
| 534 EXPECT_EQ(expected_cache_size, estimator.cached_network_qualities_.size()); | 546 EXPECT_EQ(expected_cache_size, estimator.cached_network_qualities_.size()); |
| 535 | 547 |
| 536 // Entry will be added for (3G, "test1"). | 548 // Entry will be added for (3G, "test1"). |
| 537 // Also, set the network quality for (3G, "test1") so that it is stored in | 549 // Also, set the network quality for (3G, "test1") so that it is stored in |
| 538 // the cache. | 550 // the cache. |
| 539 estimator.downstream_throughput_kbps_observations_.AddObservation( | 551 estimator.downstream_throughput_kbps_observations_.AddObservation( |
| 540 NetworkQualityEstimator::Observation(2, base::TimeTicks::Now())); | 552 NetworkQualityEstimator::Observation( |
| 553 2, base::TimeTicks::Now(), NetworkQualityEstimator::URL_REQUEST)); | |
| 541 estimator.rtt_msec_observations_.AddObservation( | 554 estimator.rtt_msec_observations_.AddObservation( |
| 542 NetworkQualityEstimator::Observation(500, base::TimeTicks::Now())); | 555 NetworkQualityEstimator::Observation( |
| 556 500, base::TimeTicks::Now(), NetworkQualityEstimator::URL_REQUEST)); | |
| 543 estimator.SimulateNetworkChangeTo( | 557 estimator.SimulateNetworkChangeTo( |
| 544 NetworkChangeNotifier::ConnectionType::CONNECTION_3G, "test-2"); | 558 NetworkChangeNotifier::ConnectionType::CONNECTION_3G, "test-2"); |
| 545 ++expected_cache_size; | 559 ++expected_cache_size; |
| 546 EXPECT_EQ(expected_cache_size, estimator.cached_network_qualities_.size()); | 560 EXPECT_EQ(expected_cache_size, estimator.cached_network_qualities_.size()); |
| 547 | 561 |
| 548 // Entry will not be added for (3G, "test2"). | 562 // Entry will not be added for (3G, "test2"). |
| 549 estimator.SimulateNetworkChangeTo( | 563 estimator.SimulateNetworkChangeTo( |
| 550 NetworkChangeNotifier::ConnectionType::CONNECTION_2G, "test-1"); | 564 NetworkChangeNotifier::ConnectionType::CONNECTION_2G, "test-1"); |
| 551 EXPECT_EQ(expected_cache_size, estimator.cached_network_qualities_.size()); | 565 EXPECT_EQ(expected_cache_size, estimator.cached_network_qualities_.size()); |
| 552 | 566 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 596 std::string()); | 610 std::string()); |
| 597 EXPECT_EQ(0U, estimator.cached_network_qualities_.size()); | 611 EXPECT_EQ(0U, estimator.cached_network_qualities_.size()); |
| 598 | 612 |
| 599 // Add 100 more networks than the maximum size of the cache. | 613 // Add 100 more networks than the maximum size of the cache. |
| 600 size_t network_count = | 614 size_t network_count = |
| 601 NetworkQualityEstimator::kMaximumNetworkQualityCacheSize + 100; | 615 NetworkQualityEstimator::kMaximumNetworkQualityCacheSize + 100; |
| 602 | 616 |
| 603 base::TimeTicks update_time_of_network_100; | 617 base::TimeTicks update_time_of_network_100; |
| 604 for (size_t i = 0; i < network_count; ++i) { | 618 for (size_t i = 0; i < network_count; ++i) { |
| 605 estimator.downstream_throughput_kbps_observations_.AddObservation( | 619 estimator.downstream_throughput_kbps_observations_.AddObservation( |
| 606 NetworkQualityEstimator::Observation(2, base::TimeTicks::Now())); | 620 NetworkQualityEstimator::Observation( |
| 621 2, base::TimeTicks::Now(), NetworkQualityEstimator::URL_REQUEST)); | |
| 607 estimator.rtt_msec_observations_.AddObservation( | 622 estimator.rtt_msec_observations_.AddObservation( |
| 608 NetworkQualityEstimator::Observation(500, base::TimeTicks::Now())); | 623 NetworkQualityEstimator::Observation( |
| 624 500, base::TimeTicks::Now(), NetworkQualityEstimator::URL_REQUEST)); | |
| 609 | 625 |
| 610 if (i == 100) | 626 if (i == 100) |
| 611 update_time_of_network_100 = base::TimeTicks::Now(); | 627 update_time_of_network_100 = base::TimeTicks::Now(); |
| 612 | 628 |
| 613 estimator.SimulateNetworkChangeTo( | 629 estimator.SimulateNetworkChangeTo( |
| 614 net::NetworkChangeNotifier::ConnectionType::CONNECTION_WIFI, | 630 net::NetworkChangeNotifier::ConnectionType::CONNECTION_WIFI, |
| 615 base::SizeTToString(i)); | 631 base::SizeTToString(i)); |
| 616 if (i < NetworkQualityEstimator::kMaximumNetworkQualityCacheSize) | 632 if (i < NetworkQualityEstimator::kMaximumNetworkQualityCacheSize) |
| 617 EXPECT_EQ(i, estimator.cached_network_qualities_.size()); | 633 EXPECT_EQ(i, estimator.cached_network_qualities_.size()); |
| 618 EXPECT_LE(estimator.cached_network_qualities_.size(), | 634 EXPECT_LE(estimator.cached_network_qualities_.size(), |
| 619 static_cast<size_t>( | 635 static_cast<size_t>( |
| 620 NetworkQualityEstimator::kMaximumNetworkQualityCacheSize)); | 636 NetworkQualityEstimator::kMaximumNetworkQualityCacheSize)); |
| 621 } | 637 } |
| 622 // One more call so that the last network is also written to cache. | 638 // One more call so that the last network is also written to cache. |
| 623 estimator.downstream_throughput_kbps_observations_.AddObservation( | 639 estimator.downstream_throughput_kbps_observations_.AddObservation( |
| 624 NetworkQualityEstimator::Observation(2, base::TimeTicks::Now())); | 640 NetworkQualityEstimator::Observation( |
| 641 2, base::TimeTicks::Now(), NetworkQualityEstimator::URL_REQUEST)); | |
| 625 estimator.rtt_msec_observations_.AddObservation( | 642 estimator.rtt_msec_observations_.AddObservation( |
| 626 NetworkQualityEstimator::Observation(500, base::TimeTicks::Now())); | 643 NetworkQualityEstimator::Observation( |
| 644 500, base::TimeTicks::Now(), NetworkQualityEstimator::URL_REQUEST)); | |
| 627 estimator.SimulateNetworkChangeTo( | 645 estimator.SimulateNetworkChangeTo( |
| 628 net::NetworkChangeNotifier::ConnectionType::CONNECTION_WIFI, | 646 net::NetworkChangeNotifier::ConnectionType::CONNECTION_WIFI, |
| 629 base::SizeTToString(network_count - 1)); | 647 base::SizeTToString(network_count - 1)); |
| 630 EXPECT_EQ(static_cast<size_t>( | 648 EXPECT_EQ(static_cast<size_t>( |
| 631 NetworkQualityEstimator::kMaximumNetworkQualityCacheSize), | 649 NetworkQualityEstimator::kMaximumNetworkQualityCacheSize), |
| 632 estimator.cached_network_qualities_.size()); | 650 estimator.cached_network_qualities_.size()); |
| 633 | 651 |
| 634 // Test that the cache is LRU by examining its contents. Networks in cache | 652 // Test that the cache is LRU by examining its contents. Networks in cache |
| 635 // must all be newer than the 100th network. | 653 // must all be newer than the 100th network. |
| 636 for (NetworkQualityEstimator::CachedNetworkQualities::iterator it = | 654 for (NetworkQualityEstimator::CachedNetworkQualities::iterator it = |
| 637 estimator.cached_network_qualities_.begin(); | 655 estimator.cached_network_qualities_.begin(); |
| 638 it != estimator.cached_network_qualities_.end(); ++it) { | 656 it != estimator.cached_network_qualities_.end(); ++it) { |
| 639 EXPECT_GE((it->second).last_update_time_, update_time_of_network_100); | 657 EXPECT_GE((it->second).last_update_time_, update_time_of_network_100); |
| 640 } | 658 } |
| 641 } | 659 } |
| 642 | 660 |
| 643 TEST(NetworkQualityEstimatorTest, TestGetMedianRTTSince) { | 661 TEST(NetworkQualityEstimatorTest, TestGetMedianRTTSince) { |
| 644 std::map<std::string, std::string> variation_params; | 662 std::map<std::string, std::string> variation_params; |
| 645 TestNetworkQualityEstimator estimator(variation_params); | 663 TestNetworkQualityEstimator estimator(variation_params); |
| 646 base::TimeTicks now = base::TimeTicks::Now(); | 664 base::TimeTicks now = base::TimeTicks::Now(); |
| 647 base::TimeTicks old = | 665 base::TimeTicks old = |
| 648 base::TimeTicks::Now() - base::TimeDelta::FromMilliseconds(1); | 666 base::TimeTicks::Now() - base::TimeDelta::FromMilliseconds(1); |
| 649 | 667 |
| 650 // First sample has very old timestamp. | 668 // First sample has very old timestamp. |
| 651 estimator.downstream_throughput_kbps_observations_.AddObservation( | 669 estimator.downstream_throughput_kbps_observations_.AddObservation( |
| 652 NetworkQualityEstimator::Observation(1, old)); | 670 NetworkQualityEstimator::Observation( |
| 671 1, old, NetworkQualityEstimator::URL_REQUEST)); | |
| 653 estimator.rtt_msec_observations_.AddObservation( | 672 estimator.rtt_msec_observations_.AddObservation( |
| 654 NetworkQualityEstimator::Observation(1, old)); | 673 NetworkQualityEstimator::Observation( |
| 674 1, old, NetworkQualityEstimator::URL_REQUEST)); | |
| 655 | 675 |
| 656 estimator.downstream_throughput_kbps_observations_.AddObservation( | 676 estimator.downstream_throughput_kbps_observations_.AddObservation( |
| 657 NetworkQualityEstimator::Observation(100, now)); | 677 NetworkQualityEstimator::Observation( |
| 678 100, now, NetworkQualityEstimator::URL_REQUEST)); | |
| 658 estimator.rtt_msec_observations_.AddObservation( | 679 estimator.rtt_msec_observations_.AddObservation( |
| 659 NetworkQualityEstimator::Observation(100, now)); | 680 NetworkQualityEstimator::Observation( |
| 681 100, now, NetworkQualityEstimator::URL_REQUEST)); | |
| 660 | 682 |
| 661 base::TimeDelta rtt; | 683 base::TimeDelta rtt; |
| 662 EXPECT_FALSE(estimator.GetRecentMedianRTT( | 684 EXPECT_FALSE(estimator.GetRecentMedianRTT( |
| 663 now + base::TimeDelta::FromSeconds(10), &rtt)); | 685 now + base::TimeDelta::FromSeconds(10), &rtt)); |
| 664 EXPECT_TRUE(estimator.GetRecentMedianRTT(now, &rtt)); | 686 EXPECT_TRUE(estimator.GetRecentMedianRTT(now, &rtt)); |
| 665 EXPECT_EQ(100, rtt.InMilliseconds()); | 687 EXPECT_EQ(100, rtt.InMilliseconds()); |
| 666 | 688 |
| 667 int32_t downstream_throughput_kbps; | 689 int32_t downstream_throughput_kbps; |
| 668 EXPECT_FALSE(estimator.GetRecentMedianDownlinkThroughputKbps( | 690 EXPECT_FALSE(estimator.GetRecentMedianDownlinkThroughputKbps( |
| 669 now + base::TimeDelta::FromSeconds(10), &downstream_throughput_kbps)); | 691 now + base::TimeDelta::FromSeconds(10), &downstream_throughput_kbps)); |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 927 | 949 |
| 928 scoped_ptr<URLRequest> request(context.CreateRequest( | 950 scoped_ptr<URLRequest> request(context.CreateRequest( |
| 929 estimator.GetEchoURL(), DEFAULT_PRIORITY, &test_delegate)); | 951 estimator.GetEchoURL(), DEFAULT_PRIORITY, &test_delegate)); |
| 930 request->Start(); | 952 request->Start(); |
| 931 base::RunLoop().Run(); | 953 base::RunLoop().Run(); |
| 932 | 954 |
| 933 EXPECT_EQ(2U, estimator.rtt_msec_observations_.Size()); | 955 EXPECT_EQ(2U, estimator.rtt_msec_observations_.Size()); |
| 934 EXPECT_EQ(2U, estimator.downstream_throughput_kbps_observations_.Size()); | 956 EXPECT_EQ(2U, estimator.downstream_throughput_kbps_observations_.Size()); |
| 935 } | 957 } |
| 936 | 958 |
| 937 } // namespace net | 959 } // namespace net |
|
pauljensen
2015/10/05 14:49:40
Please add tests for the new NQE APIs.
bengr
2015/10/06 16:16:50
Done.
| |
| OLD | NEW |