NsdManager: add unit tests
This prepares some refactoring and the addition of a timeout to resolveService. Test: new tests pass Bug: 37013369, 33298084 Change-Id: Ie8277bd5983278507bfa70495b4ce7d13895b24b
This commit is contained in:
@@ -31,6 +31,7 @@ import android.util.SparseArray;
|
|||||||
|
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
|
|
||||||
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
import com.android.internal.util.AsyncChannel;
|
import com.android.internal.util.AsyncChannel;
|
||||||
import com.android.internal.util.Protocol;
|
import com.android.internal.util.Protocol;
|
||||||
|
|
||||||
@@ -326,7 +327,8 @@ public final class NsdManager {
|
|||||||
public void onServiceResolved(NsdServiceInfo serviceInfo);
|
public void onServiceResolved(NsdServiceInfo serviceInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ServiceHandler extends Handler {
|
@VisibleForTesting
|
||||||
|
class ServiceHandler extends Handler {
|
||||||
ServiceHandler(Looper looper) {
|
ServiceHandler(Looper looper) {
|
||||||
super(looper);
|
super(looper);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user