78 {
79 MethodChannel rawChannel = mock(MethodChannel.class);
80 FlutterJNI mockFlutterJNI = mock(FlutterJNI.class);
81 DartExecutor dartExecutor = new DartExecutor(mockFlutterJNI, mock(AssetManager.class));
82 TestDeferredComponentManager testDeferredComponentManager = new TestDeferredComponentManager();
83 DeferredComponentChannel fakeDeferredComponentChannel =
84 new DeferredComponentChannel(dartExecutor);
85 fakeDeferredComponentChannel.setDeferredComponentManager(testDeferredComponentManager);
86 testDeferredComponentManager.setDeferredComponentChannel(fakeDeferredComponentChannel);
87
88 Map<String, Object>
args =
new HashMap<>();
89 args.put(
"loadingUnitId", -1);
90 args.put(
"componentName",
"hello");
92 MethodChannel.Result mockResult1 = mock(MethodChannel.Result.class);
93 MethodChannel.Result mockResult2 = mock(MethodChannel.Result.class);
94 fakeDeferredComponentChannel.parsingMethodHandler.onMethodCall(methodCall, mockResult1);
95 fakeDeferredComponentChannel.parsingMethodHandler.onMethodCall(methodCall, mockResult2);
96
97 testDeferredComponentManager.completeInstall();
98 verify(mockResult1).success(null);
99 verify(mockResult2).success(null);
100 }