OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 package org.webrtc; | 10 package org.webrtc; |
11 | 11 |
12 import static org.webrtc.NetworkMonitorAutoDetect.ConnectionType; | 12 import static org.webrtc.NetworkMonitorAutoDetect.ConnectionType; |
13 import static org.webrtc.NetworkMonitorAutoDetect.ConnectivityManagerDelegate; | 13 import static org.webrtc.NetworkMonitorAutoDetect.ConnectivityManagerDelegate; |
14 import static org.webrtc.NetworkMonitorAutoDetect.INVALID_NET_ID; | 14 import static org.webrtc.NetworkMonitorAutoDetect.INVALID_NET_ID; |
15 import static org.webrtc.NetworkMonitorAutoDetect.NetworkInformation; | 15 import static org.webrtc.NetworkMonitorAutoDetect.NetworkInformation; |
16 import static org.webrtc.NetworkMonitorAutoDetect.NetworkState; | 16 import static org.webrtc.NetworkMonitorAutoDetect.NetworkState; |
17 | 17 |
18 import android.annotation.SuppressLint; | 18 import android.annotation.SuppressLint; |
19 import android.content.Context; | 19 import android.content.Context; |
20 import android.content.Intent; | 20 import android.content.Intent; |
21 import android.net.ConnectivityManager; | 21 import android.net.ConnectivityManager; |
22 import android.net.Network; | 22 import android.net.Network; |
23 import android.net.wifi.WifiManager; | 23 import android.net.wifi.WifiManager; |
24 import android.os.Build; | 24 import android.os.Build; |
25 import android.os.Handler; | 25 import android.os.Handler; |
26 import android.os.Looper; | 26 import android.os.Looper; |
27 import android.telephony.TelephonyManager; | |
28 import android.test.ActivityTestCase; | 27 import android.test.ActivityTestCase; |
29 import android.test.UiThreadTest; | 28 import android.test.UiThreadTest; |
30 import android.test.suitebuilder.annotation.MediumTest; | 29 import android.test.suitebuilder.annotation.MediumTest; |
31 import android.test.suitebuilder.annotation.SmallTest; | 30 import android.test.suitebuilder.annotation.SmallTest; |
32 | 31 |
33 /** | 32 /** |
34 * Tests for org.webrtc.NetworkMonitor. | 33 * Tests for org.webrtc.NetworkMonitor. |
35 */ | 34 */ |
36 @SuppressLint("NewApi") | 35 @SuppressLint("NewApi") |
37 public class NetworkMonitorTest extends ActivityTestCase { | 36 public class NetworkMonitorTest extends ActivityTestCase { |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 */ | 268 */ |
270 @UiThreadTest | 269 @UiThreadTest |
271 @SmallTest | 270 @SmallTest |
272 public void testQueryableAPIsDoNotCrash() { | 271 public void testQueryableAPIsDoNotCrash() { |
273 NetworkMonitorAutoDetect.Observer observer = new TestNetworkMonitorAutoDetec
tObserver(); | 272 NetworkMonitorAutoDetect.Observer observer = new TestNetworkMonitorAutoDetec
tObserver(); |
274 NetworkMonitorAutoDetect ncn = | 273 NetworkMonitorAutoDetect ncn = |
275 new NetworkMonitorAutoDetect(observer, getInstrumentation().getTargetCon
text()); | 274 new NetworkMonitorAutoDetect(observer, getInstrumentation().getTargetCon
text()); |
276 ncn.getDefaultNetId(); | 275 ncn.getDefaultNetId(); |
277 } | 276 } |
278 } | 277 } |
OLD | NEW |