◆ createFlutterFragment_customDartEntrypointLibraryUri()
void io.flutter.embedding.android.FlutterFragmentActivityTest.createFlutterFragment_customDartEntrypointLibraryUri |
( |
| ) |
|
|
inline |
Definition at line 92 of file FlutterFragmentActivityTest.java.
92 {
93 final FlutterFragmentActivity activity =
94 new FakeFlutterFragmentActivity() {
95 @Override
96 public String getDartEntrypointLibraryUri() {
97 return "package:foo/bar.dart";
98 }
99 };
100 assertEquals(
101 activity.createFlutterFragment().getDartEntrypointLibraryUri(), "package:foo/bar.dart");
102 }
◆ createFlutterFragment_customRenderMode()
void io.flutter.embedding.android.FlutterFragmentActivityTest.createFlutterFragment_customRenderMode |
( |
| ) |
|
|
inline |
Definition at line 80 of file FlutterFragmentActivityTest.java.
80 {
81 final FlutterFragmentActivity activity =
82 new FakeFlutterFragmentActivity() {
83 @Override
84 protected RenderMode getRenderMode() {
85 return RenderMode.texture;
86 }
87 };
88 assertEquals(activity.createFlutterFragment().getRenderMode(), RenderMode.texture);
89 }
◆ createFlutterFragment_defaultRenderModeSurface()
void io.flutter.embedding.android.FlutterFragmentActivityTest.createFlutterFragment_defaultRenderModeSurface |
( |
| ) |
|
|
inline |
Definition at line 62 of file FlutterFragmentActivityTest.java.
62 {
63 final FlutterFragmentActivity activity = new FakeFlutterFragmentActivity();
64 assertEquals(activity.createFlutterFragment().getRenderMode(), RenderMode.surface);
65 }
◆ createFlutterFragment_defaultRenderModeTexture()
void io.flutter.embedding.android.FlutterFragmentActivityTest.createFlutterFragment_defaultRenderModeTexture |
( |
| ) |
|
|
inline |
Definition at line 68 of file FlutterFragmentActivityTest.java.
68 {
69 final FlutterFragmentActivity activity =
70 new FakeFlutterFragmentActivity() {
71 @Override
72 protected BackgroundMode getBackgroundMode() {
73 return BackgroundMode.transparent;
74 }
75 };
76 assertEquals(activity.createFlutterFragment().getRenderMode(), RenderMode.texture);
77 }
◆ hasRootLayoutId()
void io.flutter.embedding.android.FlutterFragmentActivityTest.hasRootLayoutId |
( |
| ) |
|
|
inline |
Definition at line 105 of file FlutterFragmentActivityTest.java.
105 {
106 FlutterFragmentActivityWithRootLayout activity =
107 Robolectric.buildActivity(FlutterFragmentActivityWithRootLayout.class).get();
108 activity.onCreate(null);
109 assertNotNull(activity.FRAGMENT_CONTAINER_ID);
110 assertTrue(activity.FRAGMENT_CONTAINER_ID != View.NO_ID);
111 }
◆ itAllowsRootLayoutOverride()
void io.flutter.embedding.android.FlutterFragmentActivityTest.itAllowsRootLayoutOverride |
( |
| ) |
|
|
inline |
Definition at line 188 of file FlutterFragmentActivityTest.java.
188 {
189 FlutterFragmentActivityWithRootLayout activity =
190 Robolectric.buildActivity(FlutterFragmentActivityWithRootLayout.class).get();
191
192 activity.onCreate(null);
193 ViewGroup contentView = (ViewGroup) activity.findViewById(
android.R.id.content);
194 boolean foundCustomView = false;
195 for (
int i = 0;
i < contentView.getChildCount();
i++) {
196 foundCustomView =
197 contentView.getChildAt(
i) instanceof FlutterFragmentActivityWithRootLayout.CustomLayout;
198 if (foundCustomView) {
199 break;
200 }
201 }
202 assertTrue(foundCustomView);
203 }
◆ itCreatesAValidFlutterFragment()
void io.flutter.embedding.android.FlutterFragmentActivityTest.itCreatesAValidFlutterFragment |
( |
| ) |
|
|
inline |
Definition at line 206 of file FlutterFragmentActivityTest.java.
206 {
207 try (ActivityScenario<FlutterFragmentActivityWithProvidedEngine> scenario =
208 ActivityScenario.launch(FlutterFragmentActivityWithProvidedEngine.class)) {
209 scenario.onActivity(
210 activity -> {
211 assertNotNull(activity.getFlutterEngine());
212 assertEquals(1, activity.numberOfEnginesCreated);
213 });
214 }
215 }
◆ itDoesNotRegisterPluginsTwiceWhenUsingACachedEngine()
void io.flutter.embedding.android.FlutterFragmentActivityTest.itDoesNotRegisterPluginsTwiceWhenUsingACachedEngine |
( |
| ) |
|
|
inline |
Definition at line 128 of file FlutterFragmentActivityTest.java.
128 {
129 try (ActivityScenario<FlutterFragmentActivity> scenario =
130 ActivityScenario.launch(FlutterFragmentActivity.class)) {
131 scenario.onActivity(
132 activity -> {
135 assertEquals(1, registeredEngines.size());
136 assertEquals(activity.getFlutterEngine(), registeredEngines.get(0));
137 });
138 }
139
141
142
143
144 assertEquals(1, registeredEngines.size());
145 }
◆ itHandlesNewFragmentRecreationDuringRestoreWhenActivityIsRecreated()
void io.flutter.embedding.android.FlutterFragmentActivityTest.itHandlesNewFragmentRecreationDuringRestoreWhenActivityIsRecreated |
( |
| ) |
|
|
inline |
Definition at line 234 of file FlutterFragmentActivityTest.java.
234 {
235 FlutterFragmentActivityWithProvidedEngine activity =
236 spy(Robolectric.buildActivity(FlutterFragmentActivityWithProvidedEngine.class).get());
237
238 FlutterFragment fragment = mock(FlutterFragment.class);
239
240
241
242 when(activity.retrieveExistingFlutterFragmentIfPossible()).thenReturn(null, fragment);
243
245 when(fragment.getFlutterEngine()).thenReturn(
engine);
246
247 activity.onCreate(null);
248
249
250 assertEquals(0, activity.numberOfEnginesCreated);
251 }
◆ itRegistersPluginsAtConfigurationTime()
void io.flutter.embedding.android.FlutterFragmentActivityTest.itRegistersPluginsAtConfigurationTime |
( |
| ) |
|
|
inline |
Definition at line 114 of file FlutterFragmentActivityTest.java.
114 {
115 try (ActivityScenario<FlutterFragmentActivity> scenario =
116 ActivityScenario.launch(FlutterFragmentActivity.class)) {
117 scenario.onActivity(
118 activity -> {
121 assertEquals(1, registeredEngines.size());
122 assertEquals(activity.getFlutterEngine(), registeredEngines.get(0));
123 });
124 }
125 }
◆ itRetrievesExistingFlutterFragmentWhenRecreated()
void io.flutter.embedding.android.FlutterFragmentActivityTest.itRetrievesExistingFlutterFragmentWhenRecreated |
( |
| ) |
|
|
inline |
Definition at line 218 of file FlutterFragmentActivityTest.java.
218 {
219 FlutterFragmentActivityWithProvidedEngine activity =
220 spy(Robolectric.buildActivity(FlutterFragmentActivityWithProvidedEngine.class).get());
221
222 FlutterFragment fragment = mock(FlutterFragment.class);
223 when(activity.retrieveExistingFlutterFragmentIfPossible()).thenReturn(fragment);
224
226 when(fragment.getFlutterEngine()).thenReturn(
engine);
227
228 activity.onCreate(null);
229 assertEquals(
engine, activity.getFlutterEngine());
230 assertEquals(0, activity.numberOfEnginesCreated);
231 }
◆ itReturnsValueFromMetaDataWhenCallsShouldHandleDeepLinkingCase1()
void io.flutter.embedding.android.FlutterFragmentActivityTest.itReturnsValueFromMetaDataWhenCallsShouldHandleDeepLinkingCase1 |
( |
| ) |
throws PackageManager.NameNotFoundException |
|
inline |
Definition at line 148 of file FlutterFragmentActivityTest.java.
149 {
150 FlutterFragmentActivity activity =
151 Robolectric.buildActivity(FlutterFragmentActivityWithProvidedEngine.class).get();
153 Bundle bundle = new Bundle();
154 bundle.putBoolean(HANDLE_DEEPLINKING_META_DATA_KEY, true);
155 FlutterFragmentActivity spyFlutterActivity = spy(activity);
156 when(spyFlutterActivity.getMetaData()).thenReturn(bundle);
157 assertTrue(spyFlutterActivity.shouldHandleDeeplinking());
158 }
◆ itReturnsValueFromMetaDataWhenCallsShouldHandleDeepLinkingCase2()
void io.flutter.embedding.android.FlutterFragmentActivityTest.itReturnsValueFromMetaDataWhenCallsShouldHandleDeepLinkingCase2 |
( |
| ) |
throws PackageManager.NameNotFoundException |
|
inline |
Definition at line 161 of file FlutterFragmentActivityTest.java.
162 {
163 FlutterFragmentActivity activity =
164 Robolectric.buildActivity(FlutterFragmentActivityWithProvidedEngine.class).get();
166 Bundle bundle = new Bundle();
167 bundle.putBoolean(HANDLE_DEEPLINKING_META_DATA_KEY, false);
168 FlutterFragmentActivity spyFlutterActivity = spy(activity);
169 when(spyFlutterActivity.getMetaData()).thenReturn(bundle);
170 assertFalse(spyFlutterActivity.shouldHandleDeeplinking());
171 }
◆ itReturnsValueFromMetaDataWhenCallsShouldHandleDeepLinkingCase3()
void io.flutter.embedding.android.FlutterFragmentActivityTest.itReturnsValueFromMetaDataWhenCallsShouldHandleDeepLinkingCase3 |
( |
| ) |
throws PackageManager.NameNotFoundException |
|
inline |
Definition at line 174 of file FlutterFragmentActivityTest.java.
175 {
176 FlutterFragmentActivity activity =
177 Robolectric.buildActivity(FlutterFragmentActivityWithProvidedEngine.class).get();
179
180 Bundle bundle = new Bundle();
181 FlutterFragmentActivity spyFlutterActivity = spy(activity);
182 when(spyFlutterActivity.getMetaData()).thenReturn(bundle);
183
184 assertFalse(spyFlutterActivity.shouldHandleDeeplinking());
185 }
◆ setUp()
void io.flutter.embedding.android.FlutterFragmentActivityTest.setUp |
( |
| ) |
|
|
inline |
Definition at line 44 of file FlutterFragmentActivityTest.java.
44 {
45 FlutterInjector.reset();
47 FlutterJNI mockFlutterJNI = mock(FlutterJNI.class);
48 when(mockFlutterJNI.isAttached()).thenReturn(true);
49 FlutterJNI.Factory mockFlutterJNIFactory = mock(FlutterJNI.Factory.class);
50 when(mockFlutterJNIFactory.provideFlutterJNI()).thenReturn(mockFlutterJNI);
51 FlutterInjector.setInstance(
52 new FlutterInjector.Builder().setFlutterJNIFactory(mockFlutterJNIFactory).build());
53 }
◆ tearDown()
void io.flutter.embedding.android.FlutterFragmentActivityTest.tearDown |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following file: