Fix one of the breakages of ConnectivityServiceTest in master.

Change-Id: I31c7a019383fa589beb1572486700e54edfb97e8
This commit is contained in:
Lorenzo Colitti
2015-11-27 10:52:10 +09:00
parent 3999ca3d84
commit 35e18d0049

View File

@@ -591,6 +591,12 @@ public class ConnectivityServiceTest extends AndroidTestCase {
public void setUp() throws Exception {
super.setUp();
// InstrumentationTestRunner prepares a looper, but AndroidJUnitRunner does not.
// http://b/25897652 .
if (Looper.myLooper() == null) {
Looper.prepare();
}
mServiceContext = new MockContext(getContext());
mService = new WrappedConnectivityService(mServiceContext,
mock(INetworkManagementService.class),