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

Unified Diff: net/android/network_change_notifier_android_unittest.cc

Issue 1306653003: Add connection type to NCN::MaxBandwidthChanged (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove extra space in comment Created 5 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 side-by-side diff with in-line comments
Download patch
Index: net/android/network_change_notifier_android_unittest.cc
diff --git a/net/android/network_change_notifier_android_unittest.cc b/net/android/network_change_notifier_android_unittest.cc
index 933e0a3524740d5de7a5e3038a40b3ece85f581a..d3fe04d5786396d25a43e71259bceca8e690eeeb 100644
--- a/net/android/network_change_notifier_android_unittest.cc
+++ b/net/android/network_change_notifier_android_unittest.cc
@@ -28,7 +28,9 @@ class NetworkChangeNotifierDelegateAndroidObserver
// NetworkChangeNotifierDelegateAndroid::Observer:
void OnConnectionTypeChanged() override { type_notifications_count_++; }
- void OnMaxBandwidthChanged(double max_bandwidth_mbps) override {
+ void OnMaxBandwidthChanged(
+ double max_bandwidth_mbps,
+ net::NetworkChangeNotifier::ConnectionType type) override {
max_bandwidth_notifications_count_++;
}
@@ -248,14 +250,18 @@ TEST_F(NetworkChangeNotifierAndroidTest,
TEST_F(NetworkChangeNotifierAndroidTest, MaxBandwidth) {
SetOnline();
- EXPECT_EQ(NetworkChangeNotifier::CONNECTION_UNKNOWN,
- notifier_->GetConnectionType());
- EXPECT_EQ(std::numeric_limits<double>::infinity(),
- notifier_->GetMaxBandwidth());
+ double max_bandwidth_mbps = 0.0;
+ NetworkChangeNotifier::ConnectionType connection_type =
+ NetworkChangeNotifier::CONNECTION_NONE;
+ notifier_->GetMaxBandwidthAndConnectionType(&max_bandwidth_mbps,
+ &connection_type);
+ EXPECT_EQ(NetworkChangeNotifier::CONNECTION_UNKNOWN, connection_type);
+ EXPECT_EQ(std::numeric_limits<double>::infinity(), max_bandwidth_mbps);
SetOffline();
- EXPECT_EQ(NetworkChangeNotifier::CONNECTION_NONE,
- notifier_->GetConnectionType());
- EXPECT_EQ(0.0, notifier_->GetMaxBandwidth());
+ notifier_->GetMaxBandwidthAndConnectionType(&max_bandwidth_mbps,
+ &connection_type);
+ EXPECT_EQ(NetworkChangeNotifier::CONNECTION_NONE, connection_type);
+ EXPECT_EQ(0.0, max_bandwidth_mbps);
}
TEST_F(NetworkChangeNotifierDelegateAndroidTest,
« no previous file with comments | « net/android/network_change_notifier_android.cc ('k') | net/android/network_change_notifier_delegate_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698