Merge "Guard against a NPE when disconnecting suggestion service."
This commit is contained in:
committed by
Android (Google) Code Review
commit
5f6c80a288
@@ -97,4 +97,14 @@ public class SuggestionControllerMixinTest {
|
||||
|
||||
verify(mHost).getLoaderManager();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onServiceDisconnected_hostNotAttached_shouldDoNothing() {
|
||||
when(mHost.getLoaderManager()).thenReturn(null);
|
||||
|
||||
mMixin = new SuggestionControllerMixin(mContext, mHost, mLifecycle);
|
||||
mMixin.onServiceDisconnected();
|
||||
|
||||
verify(mHost).getLoaderManager();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user