Skip to content

Commit d11959b

Browse files
authored
Fix more tests (#6072)
1 parent 93445d6 commit d11959b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/common/CrashlyticsCoreInitializationTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ public CoreBuilder setNativeComponent(CrashlyticsNativeComponent nativeComponent
128128
return this;
129129
}
130130

131+
public CoreBuilder setFileStore(FileStore fileStore) {
132+
this.fileStore = fileStore;
133+
return this;
134+
}
135+
131136
public CrashlyticsCore build() {
132137
return new CrashlyticsCore(
133138
app,
@@ -230,7 +235,8 @@ public void testOnPreExecute_buildIdNotRequiredAndDoesNotExist() {
230235
}
231236

232237
public void testOnPreExecute_didCrashOnPreviousExecution() throws Exception {
233-
final CrashlyticsCore crashlyticsCore = builder().build();
238+
// Use the same file store for core as the crash marker.
239+
CrashlyticsCore crashlyticsCore = builder().setFileStore(fileStore).build();
234240
setupBuildIdRequired(String.valueOf(false));
235241
setupAppData(BUILD_ID);
236242
setupCrashMarker();

firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/internal/common/NativeSessionFileGzipperTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import static java.util.Arrays.stream;
1818

1919
import android.content.Context;
20+
import androidx.test.filters.SdkSuppress;
2021
import com.google.firebase.crashlytics.internal.CrashlyticsTestCase;
2122
import java.io.ByteArrayOutputStream;
2223
import java.io.File;
@@ -59,6 +60,7 @@ protected void tearDown() throws Exception {
5960
}
6061

6162
@Test
63+
@SdkSuppress(minSdkVersion = 24) // streams
6264
public void testProcessNativeSessions_putsFilesInCorrectLocation() {
6365
String fileBackedSessionName = "file";
6466
String byteBackedSessionName = "byte";
@@ -78,6 +80,7 @@ public void testProcessNativeSessions_putsFilesInCorrectLocation() {
7880
}
7981

8082
@Test
83+
@SdkSuppress(minSdkVersion = 24) // streams
8184
public void testProcessNativeSessionsWhenDataIsNull_putsFilesInCorrectLocation() {
8285
String fileBackedSessionName = "file";
8386
String byteBackedSessionName = "byte";

0 commit comments

Comments
 (0)