use of io.flutter.jxbrowser.InstallationFailedReason in project flutter-intellij by flutter.
the class FlutterViewTest method testHandleJxBrowserInstallationFailed.
@Test
public void testHandleJxBrowserInstallationFailed() {
final JxBrowserUtils mockJxBrowserUtils = mock(JxBrowserUtils.class);
when(mockJxBrowserUtils.licenseIsSet()).thenReturn(true);
when(mockJxBrowserManager.getLatestFailureReason()).thenReturn(new InstallationFailedReason(FailureType.FILE_DOWNLOAD_FAILED));
// If JxBrowser failed to install, we should show a failure message that allows the user to manually retry.
final FlutterView flutterView = new FlutterView(mockProject, mockJxBrowserManager, mockJxBrowserUtils, mockInspectorGroupManagerService, mockBusConnection);
final FlutterView spy = spy(flutterView);
doNothing().when(spy).presentClickableLabel(eq(mockToolWindow), anyList());
spy.handleJxBrowserInstallationFailed(mockApp, mockInspectorService, mockToolWindow);
verify(spy, times(1)).presentClickableLabel(eq(mockToolWindow), anyList());
}
Aggregations