301 {
307 .runBundleAndSnapshotFromLibrary(
308 nullable(String.class),
309 nullable(String.class),
310 isNull(),
311 any(AssetManager.class),
312 nullable(
List.class));
313
316 FlutterJNI secondMockFlutterJNI = mock(FlutterJNI.class);
317 when(secondMockFlutterJNI.isAttached()).thenAnswer(invocation ->
jniAttached);
318 doAnswer(invocation ->
jniAttached =
true).when(secondMockFlutterJNI).attachToNative();
319 doReturn(secondMockFlutterJNI)
321 .spawn(
322 nullable(String.class),
323 nullable(String.class),
324 nullable(String.class),
325 nullable(
List.class));
326
327 PlatformViewsController controller = new PlatformViewsController();
328 boolean waitForRestorationData = false;
329 boolean automaticallyRegisterPlugins = false;
330
331 when(FlutterInjector.instance().flutterLoader().automaticallyRegisterPlugins())
332 .thenReturn(true);
333 assertTrue(FlutterInjector.instance().flutterLoader().automaticallyRegisterPlugins());
335
339 .setDartEntrypoint(mock(DartEntrypoint.class))
340 .setWaitForRestorationData(waitForRestorationData)
341 .setPlatformViewsController(controller)
342 .setAutomaticallyRegisterPlugins(automaticallyRegisterPlugins));
343
344 assertEquals(
345 waitForRestorationData, secondEngine.getRestorationChannel().waitForRestorationData);
346 assertEquals(controller, secondEngine.getPlatformViewsController());
348 }