Merge "Guard against a NPE when disconnecting suggestion service."

This commit is contained in:
TreeHugger Robot
2017-11-06 20:29:56 +00:00
committed by Android (Google) Code Review
2 changed files with 14 additions and 1 deletions

View File

@@ -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();
}
}