use of com.google.jstestdriver.idea.execution.JstdRunConfiguration in project intellij-plugins by JetBrains.
the class JstdCoverageProgramRunner method start.
@Nullable
private static RunContentDescriptor start(@Nullable JstdServer server, @NotNull ExecutionEnvironment environment) throws ExecutionException {
FileDocumentManager.getInstance().saveAllDocuments();
JstdRunConfiguration runConfiguration = (JstdRunConfiguration) environment.getRunProfile();
CoverageEnabledConfiguration coverageEnabledConfiguration = CoverageEnabledConfiguration.getOrCreate(runConfiguration);
String coverageFilePath = coverageEnabledConfiguration.getCoverageFilePath();
JstdRunProfileState jstdState = new JstdRunProfileState(environment, runConfiguration.getRunSettings(), coverageFilePath);
ExecutionResult executionResult = jstdState.executeWithServer(server);
RunContentBuilder contentBuilder = new RunContentBuilder(executionResult, environment);
final RunContentDescriptor descriptor = contentBuilder.showRunContent(environment.getContentToReuse());
ProcessHandler processHandler = executionResult.getProcessHandler();
if (processHandler instanceof NopProcessHandler) {
if (server != null) {
server.addLifeCycleListener(new JstdServerLifeCycleAdapter() {
@Override
public void onBrowserCaptured(@NotNull JstdBrowserInfo info) {
ExecutionUtil.restartIfActive(descriptor);
server.removeLifeCycleListener(this);
}
}, contentBuilder);
}
} else {
CoverageHelper.attachToProcess(runConfiguration, processHandler, environment.getRunnerSettings());
}
return descriptor;
}
Aggregations