NetworkChangeNotifierTest.java 文件源码

java
阅读 35 收藏 0 点赞 0 评论 0

项目:chromium-net-for-android 作者:
@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());
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号