Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
sdk/src/androidTest/java/com/bugsnag/android/BreadcrumbLifecycleCrashTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.bugsnag.android; | ||
|
||
import android.content.Context; | ||
import android.support.test.InstrumentationRegistry; | ||
import android.support.test.filters.SmallTest; | ||
import android.support.test.runner.AndroidJUnit4; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
@RunWith(AndroidJUnit4.class) | ||
@SmallTest | ||
public class BreadcrumbLifecycleCrashTest { | ||
|
||
private SessionTracker sessionTracker; | ||
|
||
/** | ||
* Creates a SessionTracker with a null client | ||
* | ||
* @throws Exception if the SessionTracker couldn't be created | ||
*/ | ||
@Before | ||
public void setUp() throws Exception { | ||
Configuration configuration = new Configuration("api-key"); | ||
Context context = InstrumentationRegistry.getContext(); | ||
SessionStore sessionStore = new SessionStore(configuration, context); | ||
SessionTrackingApiClient apiClient = BugsnagTestUtils.generateSessionTrackingApiClient(); | ||
sessionTracker = new SessionTracker(configuration, null, sessionStore, apiClient); | ||
} | ||
|
||
@Test | ||
public void testLifecycleBreadcrumbCrash() { | ||
// should not crash with a null client | ||
sessionTracker.leaveLifecycleBreadcrumb("FooActivity", "onCreate"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters