Merge "Fix NPE when logging start intent."

This commit is contained in:
TreeHugger Robot
2017-02-24 03:59:22 +00:00
committed by Android (Google) Code Review
2 changed files with 14 additions and 0 deletions

View File

@@ -80,6 +80,19 @@ public class MetricsFeatureProviderTest {
verifyNoMoreInteractions(mLogWriter);
}
@Test
public void logDashboardStartIntent_intentHasNoComponent_shouldLog() {
final Intent intent = new Intent(Intent.ACTION_ASSIST);
mProvider.logDashboardStartIntent(mContext, intent, MetricsEvent.SETTINGS_GESTURES);
verify(mLogWriter).action(
eq(mContext),
eq(MetricsEvent.ACTION_SETTINGS_TILE_CLICK),
anyString(),
eq(Pair.create(MetricsEvent.FIELD_CONTEXT, MetricsEvent.SETTINGS_GESTURES)));
}
@Test
public void logDashboardStartIntent_intentIsExternal_shouldLog() {
final Intent intent = new Intent().setComponent(new ComponentName("pkg", "cls"));