Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Anastasia Kubova committed Jul 30, 2019
1 parent 9f9e1ce commit bfd31aa
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -1674,6 +1674,7 @@ public Object answer(InvocationOnMock invocation) throws Throwable {
/* Instance crash module. */
Crashes crashes = Crashes.getInstance();
crashes.onStarted(mockContext, mock(Channel.class), "", null, true);
crashes.applyEnabledState(true);
componentCallbacks2Captor.getValue().onConfigurationChanged(mock(Configuration.class));

/* Invoke callback onTrimMemory. */
Expand Down Expand Up @@ -1704,7 +1705,10 @@ public void registerAndUnregisterComponentCallbacks() {
/* Instance crash module. */
Crashes crashes = Crashes.getInstance();
crashes.onStarting(mAppCenterHandler);
crashes.setInstanceEnabled(true);
crashes.onStarted(mockContext, mock(Channel.class), "", null, true);
verifyStatic();
SharedPreferencesManager.remove(eq(PREF_KEY_MEMORY_RUNNING_LEVEL));

/* Verify register callback. */
verify(mockContext).registerComponentCallbacks(any(ComponentCallbacks2.class));
Expand All @@ -1716,7 +1720,7 @@ public void registerAndUnregisterComponentCallbacks() {
verify(mockContext).unregisterComponentCallbacks(any(ComponentCallbacks2.class));

/* Verify clear preferences. */
verifyStatic();
verifyStatic(times(2));
SharedPreferencesManager.remove(eq(PREF_KEY_MEMORY_RUNNING_LEVEL));
}

Expand Down

0 comments on commit bfd31aa

Please sign in to comment.