Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,11 @@ public InitResult call() {
+ cpuArch
+ ", and the native libraries directory (with path "
+ nativeLibsDir.getAbsolutePath()
+ ") contains the following files: "
+ Arrays.toString(nativeLibsContents),
+ ") "
+ (nativeLibsDir.exists()
? "contains the following files: "
+ Arrays.toString(nativeLibsContents)
: "does not exist."),
unsatisfiedLinkError);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mockito;
import org.robolectric.annotation.Config;

@Config(manifest = Config.NONE)
Expand Down Expand Up @@ -61,6 +62,25 @@ public void itReportsInitializedAfterInitializing() {
verify(mockFlutterJNI, times(1)).updateRefreshRate();
}

@Test
public void unsatisfiedLinkErrorPathDoesNotExist() {
FlutterJNI mockFlutterJNI = mock(FlutterJNI.class);
ctx.getApplicationInfo().nativeLibraryDir = "/path/that/doesnt/exist";
FlutterLoader flutterLoader = new FlutterLoader(mockFlutterJNI);

Mockito.doThrow(new UnsatisfiedLinkError("couldn't find \"libflutter.so\""))
.when(mockFlutterJNI)
.loadLibrary();
try {
flutterLoader.startInitialization(ctx);
} catch (UnsupportedOperationException e) {
assertTrue(
e.getMessage()
.contains(
"and the native libraries directory (with path /path/that/doesnt/exist) does not exist."));
}
}

@Test
public void itDefaultsTheOldGenHeapSizeAppropriately() {
FlutterJNI mockFlutterJNI = mock(FlutterJNI.class);
Expand Down