Search in sources :

Example 16 with FlutterDevice

use of io.flutter.run.FlutterDevice in project flutter-intellij by flutter.

the class LaunchCommandsTest method producesCorrectCommandLineInProfileMode.

@Test
public void producesCorrectCommandLineInProfileMode() throws ExecutionException {
    final BazelFields fields = setupBazelFields();
    final FlutterDevice device = FlutterDevice.getTester();
    final GeneralCommandLine launchCommand = fields.getLaunchCommand(projectFixture.getProject(), device, RunMode.PROFILE);
    final List<String> expectedCommandLine = new ArrayList<>();
    expectedCommandLine.add(platformize("/workspace/scripts/flutter-run.sh"));
    expectedCommandLine.add("--profile");
    expectedCommandLine.add("--machine");
    expectedCommandLine.add("-d");
    expectedCommandLine.add("flutter-tester");
    expectedCommandLine.add("--devtools-server-address=http://http://localhost:1234");
    expectedCommandLine.add("bazel_target");
    assertThat(launchCommand.getCommandLineList(null), equalTo(expectedCommandLine));
}
Also used : FlutterDevice(io.flutter.run.FlutterDevice) GeneralCommandLine(com.intellij.execution.configurations.GeneralCommandLine) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 17 with FlutterDevice

use of io.flutter.run.FlutterDevice in project flutter-intellij by flutter.

the class LaunchCommandsTest method producesCorrectCommandLineWithIosDevice.

@Test
public void producesCorrectCommandLineWithIosDevice() throws ExecutionException {
    final BazelFields fields = setupBazelFields();
    final FlutterDevice device = new FlutterDevice("ios-tester", "ios device", "ios", false);
    final GeneralCommandLine launchCommand = fields.getLaunchCommand(projectFixture.getProject(), device, RunMode.RUN);
    final List<String> expectedCommandLine = new ArrayList<>();
    expectedCommandLine.add(platformize("/workspace/scripts/flutter-run.sh"));
    expectedCommandLine.add("--machine");
    expectedCommandLine.add("-d");
    expectedCommandLine.add("ios-tester");
    expectedCommandLine.add("--devtools-server-address=http://http://localhost:1234");
    expectedCommandLine.add("bazel_target");
    assertThat(launchCommand.getCommandLineList(null), equalTo(expectedCommandLine));
}
Also used : FlutterDevice(io.flutter.run.FlutterDevice) GeneralCommandLine(com.intellij.execution.configurations.GeneralCommandLine) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 18 with FlutterDevice

use of io.flutter.run.FlutterDevice in project flutter-intellij by flutter.

the class LaunchCommandsTest method producesCorrectCommandLineWithBazelArgs.

@Test
public void producesCorrectCommandLineWithBazelArgs() throws ExecutionException {
    final BazelFields fields = setupBazelFields("bazel_target", "--define=bazel_args", null, false);
    final FlutterDevice device = FlutterDevice.getTester();
    final GeneralCommandLine launchCommand = fields.getLaunchCommand(projectFixture.getProject(), device, RunMode.RUN);
    final List<String> expectedCommandLine = new ArrayList<>();
    expectedCommandLine.add(platformize("/workspace/scripts/flutter-run.sh"));
    expectedCommandLine.add("--bazel-options=--define=bazel_args");
    expectedCommandLine.add("--machine");
    expectedCommandLine.add("-d");
    expectedCommandLine.add("flutter-tester");
    expectedCommandLine.add("--devtools-server-address=http://http://localhost:1234");
    expectedCommandLine.add("bazel_target");
    assertThat(launchCommand.getCommandLineList(null), equalTo(expectedCommandLine));
}
Also used : FlutterDevice(io.flutter.run.FlutterDevice) GeneralCommandLine(com.intellij.execution.configurations.GeneralCommandLine) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 19 with FlutterDevice

use of io.flutter.run.FlutterDevice in project flutter-intellij by flutter.

the class LaunchCommandsTest method producesCorrectCommandLineInDebugMode.

@Test
public void producesCorrectCommandLineInDebugMode() throws ExecutionException {
    final BazelFields fields = setupBazelFields();
    final FlutterDevice device = FlutterDevice.getTester();
    final GeneralCommandLine launchCommand = fields.getLaunchCommand(projectFixture.getProject(), device, RunMode.DEBUG);
    final List<String> expectedCommandLine = new ArrayList<>();
    expectedCommandLine.add(platformize("/workspace/scripts/flutter-run.sh"));
    expectedCommandLine.add("--machine");
    expectedCommandLine.add("--start-paused");
    expectedCommandLine.add("-d");
    expectedCommandLine.add("flutter-tester");
    expectedCommandLine.add("--devtools-server-address=http://http://localhost:1234");
    expectedCommandLine.add("bazel_target");
    assertThat(launchCommand.getCommandLineList(null), equalTo(expectedCommandLine));
}
Also used : FlutterDevice(io.flutter.run.FlutterDevice) GeneralCommandLine(com.intellij.execution.configurations.GeneralCommandLine) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 20 with FlutterDevice

use of io.flutter.run.FlutterDevice in project flutter-intellij by flutter.

the class LaunchCommandsTest method producesCorrectCommandLineWithIosSimulator.

@Test
public void producesCorrectCommandLineWithIosSimulator() throws ExecutionException {
    final BazelFields fields = setupBazelFields();
    final FlutterDevice device = new FlutterDevice("ios-tester", "ios device", "ios", true);
    final GeneralCommandLine launchCommand = fields.getLaunchCommand(projectFixture.getProject(), device, RunMode.RUN);
    final List<String> expectedCommandLine = new ArrayList<>();
    expectedCommandLine.add(platformize("/workspace/scripts/flutter-run.sh"));
    expectedCommandLine.add("--machine");
    expectedCommandLine.add("-d");
    expectedCommandLine.add("ios-tester");
    expectedCommandLine.add("--devtools-server-address=http://http://localhost:1234");
    expectedCommandLine.add("bazel_target");
    assertThat(launchCommand.getCommandLineList(null), equalTo(expectedCommandLine));
}
Also used : FlutterDevice(io.flutter.run.FlutterDevice) GeneralCommandLine(com.intellij.execution.configurations.GeneralCommandLine) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Aggregations

FlutterDevice (io.flutter.run.FlutterDevice)20 ArrayList (java.util.ArrayList)13 GeneralCommandLine (com.intellij.execution.configurations.GeneralCommandLine)12 Test (org.junit.Test)12 SimpleToolWindowPanel (com.intellij.openapi.ui.SimpleToolWindowPanel)3 JBLabel (com.intellij.ui.components.JBLabel)3 Content (com.intellij.ui.content.Content)3 ContentManager (com.intellij.ui.content.ContentManager)3 FlutterApp (io.flutter.run.daemon.FlutterApp)3 JBRunnerTabs (com.intellij.execution.ui.layout.impl.JBRunnerTabs)2 Project (com.intellij.openapi.project.Project)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 LinkLabel (com.intellij.ui.components.labels.LinkLabel)2 DevToolsUrl (io.flutter.devtools.DevToolsUrl)2 NotNull (org.jetbrains.annotations.NotNull)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 ExecutionException (com.intellij.execution.ExecutionException)1 ExecutionUtil (com.intellij.execution.runners.ExecutionUtil)1 AllIcons (com.intellij.icons.AllIcons)1 BrowserLauncher (com.intellij.ide.browsers.BrowserLauncher)1