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/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 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1359 base::RunLoop().Run(); | 1359 base::RunLoop().Run(); |
1360 | 1360 |
1361 EXPECT_EQ(test.allow_small_localhost_requests, | 1361 EXPECT_EQ(test.allow_small_localhost_requests, |
1362 estimator.GetRecentHttpRTT(base::TimeTicks(), &rtt)); | 1362 estimator.GetRecentHttpRTT(base::TimeTicks(), &rtt)); |
1363 EXPECT_EQ( | 1363 EXPECT_EQ( |
1364 test.allow_small_localhost_requests, | 1364 test.allow_small_localhost_requests, |
1365 estimator.GetRecentDownlinkThroughputKbps(base::TimeTicks(), &kbps)); | 1365 estimator.GetRecentDownlinkThroughputKbps(base::TimeTicks(), &kbps)); |
1366 } | 1366 } |
1367 } | 1367 } |
1368 | 1368 |
| 1369 #if defined(OS_IOS) |
| 1370 // Flaky on iOS: crbug.com/672917. |
| 1371 #define MAYBE_TestEffectiveConnectionTypeObserver \ |
| 1372 DISABLED_TestEffectiveConnectionTypeObserver |
| 1373 #else |
| 1374 #define MAYBE_TestEffectiveConnectionTypeObserver \ |
| 1375 TestEffectiveConnectionTypeObserver |
| 1376 #endif |
| 1377 |
1369 // Tests that the effective connection type is computed at the specified | 1378 // Tests that the effective connection type is computed at the specified |
1370 // interval, and that the observers are notified of any change. | 1379 // interval, and that the observers are notified of any change. |
1371 TEST(NetworkQualityEstimatorTest, TestEffectiveConnectionTypeObserver) { | 1380 TEST(NetworkQualityEstimatorTest, MAYBE_TestEffectiveConnectionTypeObserver) { |
1372 base::HistogramTester histogram_tester; | 1381 base::HistogramTester histogram_tester; |
1373 std::unique_ptr<base::SimpleTestTickClock> tick_clock( | 1382 std::unique_ptr<base::SimpleTestTickClock> tick_clock( |
1374 new base::SimpleTestTickClock()); | 1383 new base::SimpleTestTickClock()); |
1375 base::SimpleTestTickClock* tick_clock_ptr = tick_clock.get(); | 1384 base::SimpleTestTickClock* tick_clock_ptr = tick_clock.get(); |
1376 | 1385 |
1377 TestEffectiveConnectionTypeObserver observer; | 1386 TestEffectiveConnectionTypeObserver observer; |
1378 std::map<std::string, std::string> variation_params; | 1387 std::map<std::string, std::string> variation_params; |
1379 TestNetworkQualityEstimator estimator(variation_params); | 1388 TestNetworkQualityEstimator estimator(variation_params); |
1380 estimator.AddEffectiveConnectionTypeObserver(&observer); | 1389 estimator.AddEffectiveConnectionTypeObserver(&observer); |
1381 estimator.SetTickClockForTesting(std::move(tick_clock)); | 1390 estimator.SetTickClockForTesting(std::move(tick_clock)); |
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2466 request->Start(); | 2475 request->Start(); |
2467 base::RunLoop().Run(); | 2476 base::RunLoop().Run(); |
2468 | 2477 |
2469 EXPECT_EQ(effective_connection_type, | 2478 EXPECT_EQ(effective_connection_type, |
2470 estimator.GetEffectiveConnectionType()); | 2479 estimator.GetEffectiveConnectionType()); |
2471 } | 2480 } |
2472 } | 2481 } |
2473 } | 2482 } |
2474 | 2483 |
2475 } // namespace net | 2484 } // namespace net |
OLD | NEW |