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

Side by Side Diff: net/android/network_change_notifier_android_unittest.cc

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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
OLDNEW
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
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
OLDNEW
« 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