This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed
io/flutter/embedding/engine/loader
test/io/flutter/embedding/engine/loader Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -207,8 +207,11 @@ public InitResult call() {
207
207
+ cpuArch
208
208
+ ", and the native libraries directory (with path "
209
209
+ nativeLibsDir .getAbsolutePath ()
210
- + ") contains the following files: "
211
- + Arrays .toString (nativeLibsContents ),
210
+ + ") "
211
+ + (nativeLibsDir .exists ()
212
+ ? "contains the following files: "
213
+ + Arrays .toString (nativeLibsContents )
214
+ : "does not exist." ),
212
215
unsatisfiedLinkError );
213
216
}
214
217
Original file line number Diff line number Diff line change 34
34
import org .junit .Test ;
35
35
import org .junit .runner .RunWith ;
36
36
import org .mockito .ArgumentCaptor ;
37
+ import org .mockito .Mockito ;
37
38
import org .robolectric .annotation .Config ;
38
39
39
40
@ Config (manifest = Config .NONE )
@@ -61,6 +62,25 @@ public void itReportsInitializedAfterInitializing() {
61
62
verify (mockFlutterJNI , times (1 )).updateRefreshRate ();
62
63
}
63
64
65
+ @ Test
66
+ public void unsatisfiedLinkErrorPathDoesNotExist () {
67
+ FlutterJNI mockFlutterJNI = mock (FlutterJNI .class );
68
+ ctx .getApplicationInfo ().nativeLibraryDir = "/path/that/doesnt/exist" ;
69
+ FlutterLoader flutterLoader = new FlutterLoader (mockFlutterJNI );
70
+
71
+ Mockito .doThrow (new UnsatisfiedLinkError ("couldn't find \" libflutter.so\" " ))
72
+ .when (mockFlutterJNI )
73
+ .loadLibrary ();
74
+ try {
75
+ flutterLoader .startInitialization (ctx );
76
+ } catch (UnsupportedOperationException e ) {
77
+ assertTrue (
78
+ e .getMessage ()
79
+ .contains (
80
+ "and the native libraries directory (with path /path/that/doesnt/exist) does not exist." ));
81
+ }
82
+ }
83
+
64
84
@ Test
65
85
public void itDefaultsTheOldGenHeapSizeAppropriately () {
66
86
FlutterJNI mockFlutterJNI = mock (FlutterJNI .class );
You can’t perform that action at this time.
0 commit comments