76 {
77 FlutterFragment fragment =
78 FlutterFragment.withNewEngine()
79 .dartEntrypoint("custom_entrypoint")
80 .dartLibraryUri("package:foo/bar.dart")
81 .dartEntrypointArgs(new ArrayList<String>(Arrays.asList("foo", "bar")))
82 .initialRoute("/custom/route")
83 .shouldAttachEngineToActivity(false)
84 .handleDeeplinking(true)
85 .renderMode(RenderMode.texture)
86 .transparencyMode(TransparencyMode.opaque)
87 .build();
88 TestDelegateFactory delegateFactory =
89 new TestDelegateFactory(new FlutterActivityAndFragmentDelegate(fragment));
90 fragment.setDelegateFactory(delegateFactory);
91
92 assertEquals("custom_entrypoint", fragment.getDartEntrypointFunctionName());
93 assertEquals("package:foo/bar.dart", fragment.getDartEntrypointLibraryUri());
94 assertEquals("/custom/route", fragment.getInitialRoute());
95 assertArrayEquals(new String[] {"foo", "bar"}, fragment.getDartEntrypointArgs().toArray());
96 assertArrayEquals(new String[] {}, fragment.getFlutterShellArgs().toArray());
97 assertFalse(fragment.shouldAttachEngineToActivity());
98 assertTrue(fragment.shouldHandleDeeplinking());
99 assertNull(fragment.getCachedEngineId());
100 assertTrue(fragment.shouldDestroyEngineWithHost());
101 assertEquals(RenderMode.texture, fragment.getRenderMode());
102 assertEquals(TransparencyMode.opaque, fragment.getTransparencyMode());
103 }