@@ -95,7 +95,9 @@ public void onFlutterViewDetached() {
95
95
@ Test
96
96
@ Config (shadows = {ShadowFlutterJNI .class , ShadowPlatformTaskQueue .class })
97
97
public void itRemovesPlatformViewBeforeDiposeIsCalled () {
98
+ PlatformViewRegistryImpl registryImpl = new PlatformViewRegistryImpl ();
98
99
PlatformViewsController2 PlatformViewsController2 = new PlatformViewsController2 ();
100
+ PlatformViewsController2 .setRegistry (registryImpl );
99
101
FlutterJNI jni = new FlutterJNI ();
100
102
attach (jni , PlatformViewsController2 );
101
103
// Get the platform view registry.
@@ -127,7 +129,9 @@ public PlatformView create(Context context, int viewId, Object args) {
127
129
@ Test
128
130
@ Config (shadows = {ShadowFlutterJNI .class , ShadowPlatformTaskQueue .class })
129
131
public void itNotifiesPlatformViewsOfEngineAttachmentAndDetachment () {
132
+ PlatformViewRegistryImpl registryImpl = new PlatformViewRegistryImpl ();
130
133
PlatformViewsController2 PlatformViewsController2 = new PlatformViewsController2 ();
134
+ PlatformViewsController2 .setRegistry (registryImpl );
131
135
FlutterJNI jni = new FlutterJNI ();
132
136
attach (jni , PlatformViewsController2 );
133
137
// Get the platform view registry.
@@ -165,7 +169,9 @@ public PlatformView create(Context context, int viewId, Object args) {
165
169
@ Test
166
170
public void itUsesActionEventTypeFromFrameworkEventAsActionChanged () {
167
171
MotionEventTracker motionEventTracker = MotionEventTracker .getInstance ();
172
+ PlatformViewRegistryImpl registryImpl = new PlatformViewRegistryImpl ();
168
173
PlatformViewsController2 PlatformViewsController2 = new PlatformViewsController2 ();
174
+ PlatformViewsController2 .setRegistry (registryImpl );
169
175
170
176
MotionEvent original =
171
177
MotionEvent .obtain (
@@ -257,7 +263,9 @@ private MotionEvent makePlatformViewTouchAndInvokeToMotionEvent(
257
263
258
264
@ Config (shadows = {ShadowFlutterJNI .class , ShadowPlatformTaskQueue .class })
259
265
public void getPlatformViewById () {
266
+ PlatformViewRegistryImpl registryImpl = new PlatformViewRegistryImpl ();
260
267
PlatformViewsController2 PlatformViewsController2 = new PlatformViewsController2 ();
268
+ PlatformViewsController2 .setRegistry (registryImpl );
261
269
262
270
int platformViewId = 0 ;
263
271
assertNull (PlatformViewsController2 .getPlatformViewById (platformViewId ));
@@ -285,7 +293,9 @@ public void getPlatformViewById() {
285
293
@ Test
286
294
@ Config (shadows = {ShadowFlutterJNI .class , ShadowPlatformTaskQueue .class })
287
295
public void createPlatformViewMessage_initializesAndroidView () {
296
+ PlatformViewRegistryImpl registryImpl = new PlatformViewRegistryImpl ();
288
297
PlatformViewsController2 PlatformViewsController2 = new PlatformViewsController2 ();
298
+ PlatformViewsController2 .setRegistry (registryImpl );
289
299
290
300
int platformViewId = 0 ;
291
301
assertNull (PlatformViewsController2 .getPlatformViewById (platformViewId ));
@@ -307,7 +317,9 @@ public void createPlatformViewMessage_initializesAndroidView() {
307
317
@ Test
308
318
@ Config (shadows = {ShadowFlutterJNI .class , ShadowPlatformTaskQueue .class })
309
319
public void createPlatformViewMessage_setsAndroidViewLayoutDirection () {
320
+ PlatformViewRegistryImpl registryImpl = new PlatformViewRegistryImpl ();
310
321
PlatformViewsController2 PlatformViewsController2 = new PlatformViewsController2 ();
322
+ PlatformViewsController2 .setRegistry (registryImpl );
311
323
312
324
int platformViewId = 0 ;
313
325
assertNull (PlatformViewsController2 .getPlatformViewById (platformViewId ));
@@ -331,7 +343,9 @@ public void createPlatformViewMessage_setsAndroidViewLayoutDirection() {
331
343
@ Test
332
344
@ Config (shadows = {ShadowFlutterJNI .class , ShadowPlatformTaskQueue .class })
333
345
public void createPlatformViewMessage_throwsIfViewIsNull () {
346
+ PlatformViewRegistryImpl registryImpl = new PlatformViewRegistryImpl ();
334
347
PlatformViewsController2 PlatformViewsController2 = new PlatformViewsController2 ();
348
+ PlatformViewsController2 .setRegistry (registryImpl );
335
349
336
350
int platformViewId = 0 ;
337
351
assertNull (PlatformViewsController2 .getPlatformViewById (platformViewId ));
@@ -355,7 +369,9 @@ public void createPlatformViewMessage_throwsIfViewIsNull() {
355
369
@ Test
356
370
@ Config (shadows = {ShadowFlutterJNI .class , ShadowPlatformTaskQueue .class })
357
371
public void createHybridPlatformViewMessage_throwsIfViewIsNull () {
372
+ PlatformViewRegistryImpl registryImpl = new PlatformViewRegistryImpl ();
358
373
PlatformViewsController2 PlatformViewsController2 = new PlatformViewsController2 ();
374
+ PlatformViewsController2 .setRegistry (registryImpl );
359
375
360
376
int platformViewId = 0 ;
361
377
assertNull (PlatformViewsController2 .getPlatformViewById (platformViewId ));
@@ -379,7 +395,9 @@ public void createHybridPlatformViewMessage_throwsIfViewIsNull() {
379
395
@ Test
380
396
@ Config (shadows = {ShadowFlutterJNI .class , ShadowPlatformTaskQueue .class })
381
397
public void setPlatformViewDirection_throwIfPlatformViewNotFound () {
398
+ PlatformViewRegistryImpl registryImpl = new PlatformViewRegistryImpl ();
382
399
PlatformViewsController2 PlatformViewsController2 = new PlatformViewsController2 ();
400
+ PlatformViewsController2 .setRegistry (registryImpl );
383
401
384
402
int platformViewId = 0 ;
385
403
assertNull (PlatformViewsController2 .getPlatformViewById (platformViewId ));
@@ -413,7 +431,9 @@ public void setPlatformViewDirection_throwIfPlatformViewNotFound() {
413
431
@ Test
414
432
@ Config (shadows = {ShadowFlutterJNI .class , ShadowPlatformTaskQueue .class })
415
433
public void disposeAndroidView () {
434
+ PlatformViewRegistryImpl registryImpl = new PlatformViewRegistryImpl ();
416
435
PlatformViewsController2 PlatformViewsController2 = new PlatformViewsController2 ();
436
+ PlatformViewsController2 .setRegistry (registryImpl );
417
437
418
438
int platformViewId = 0 ;
419
439
assertNull (PlatformViewsController2 .getPlatformViewById (platformViewId ));
@@ -454,7 +474,9 @@ public void disposeAndroidView() {
454
474
@ Test
455
475
@ Config (shadows = {ShadowFlutterJNI .class , ShadowPlatformTaskQueue .class })
456
476
public void disposeNullAndroidView () {
477
+ PlatformViewRegistryImpl registryImpl = new PlatformViewRegistryImpl ();
457
478
PlatformViewsController2 PlatformViewsController2 = new PlatformViewsController2 ();
479
+ PlatformViewsController2 .setRegistry (registryImpl );
458
480
459
481
int platformViewId = 0 ;
460
482
assertNull (PlatformViewsController2 .getPlatformViewById (platformViewId ));
0 commit comments