@UiThreadTest
@MediumTest
@Feature({"Android-AppBase"})
public void testCreateNetworkChangeNotifierAlwaysWatchForChanges() throws InterruptedException {
createTestNotifier(WatchForChanges.ALWAYS);
assertTrue(mReceiver.isReceiverRegisteredForTesting());
// Make sure notifications can be received.
NetworkChangeNotifierTestObserver observer = new NetworkChangeNotifierTestObserver();
NetworkChangeNotifier.addConnectionTypeObserver(observer);
Intent connectivityIntent = new Intent(ConnectivityManager.CONNECTIVITY_ACTION);
mReceiver.onReceive(getInstrumentation().getTargetContext(), connectivityIntent);
assertTrue(observer.hasReceivedNotification());
}
NetworkChangeNotifierTest.java 文件源码
java
阅读 35
收藏 0
点赞 0
评论 0
项目:chromium-net-for-android
作者:
评论列表
文章目录