OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // See network_change_notifier_android.h for design explanations. | 5 // See network_change_notifier_android.h for design explanations. |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 RunTest( | 206 RunTest( |
207 base::Bind( | 207 base::Bind( |
208 &NetworkChangeNotifierObserver::notifications_count, | 208 &NetworkChangeNotifierObserver::notifications_count, |
209 base::Unretained(&connection_type_observer_)), | 209 base::Unretained(&connection_type_observer_)), |
210 base::Bind(&NetworkChangeNotifier::GetConnectionType)); | 210 base::Bind(&NetworkChangeNotifier::GetConnectionType)); |
211 // Check that *all* the observers are notified. | 211 // Check that *all* the observers are notified. |
212 EXPECT_EQ(connection_type_observer_.notifications_count(), | 212 EXPECT_EQ(connection_type_observer_.notifications_count(), |
213 other_connection_type_observer_.notifications_count()); | 213 other_connection_type_observer_.notifications_count()); |
214 } | 214 } |
215 | 215 |
| 216 TEST_F(NetworkChangeNotifierAndroidTest, MaxBandwidth) { |
| 217 SetOnline(); |
| 218 EXPECT_EQ(NetworkChangeNotifier::CONNECTION_UNKNOWN, |
| 219 notifier_.GetConnectionType()); |
| 220 EXPECT_EQ(std::numeric_limits<double>::infinity(), |
| 221 notifier_.GetMaxBandwidth()); |
| 222 |
| 223 SetOffline(); |
| 224 EXPECT_EQ(NetworkChangeNotifier::CONNECTION_NONE, |
| 225 notifier_.GetConnectionType()); |
| 226 EXPECT_EQ(0.0, notifier_.GetMaxBandwidth()); |
| 227 } |
| 228 |
216 } // namespace net | 229 } // namespace net |
OLD | NEW |