From 56333d2303dfe25b6ee43557da1b219cfdbe7a25 Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Fri, 6 Nov 2015 13:15:28 +0100 Subject: [PATCH] tests: allow scroll to source together with track running test as scroll should be done for manual selection only --- .../testframework/actions/ScrollToTestSourceAction.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/platform/testRunner/src/com/intellij/execution/testframework/actions/ScrollToTestSourceAction.java b/platform/testRunner/src/com/intellij/execution/testframework/actions/ScrollToTestSourceAction.java index dd2a417a5a2f..3254e58a98c0 100644 --- a/platform/testRunner/src/com/intellij/execution/testframework/actions/ScrollToTestSourceAction.java +++ b/platform/testRunner/src/com/intellij/execution/testframework/actions/ScrollToTestSourceAction.java @@ -32,7 +32,7 @@ public class ScrollToTestSourceAction extends ToggleBooleanProperty.Disablable { protected boolean isEnabled() { final AbstractProperty.AbstractPropertyContainer properties = getProperties(); final TestFrameworkRunningModel model = myModel; - return isEnabled(properties, model); + return isEnabled(model); } @Override @@ -40,14 +40,13 @@ public class ScrollToTestSourceAction extends ToggleBooleanProperty.Disablable { return true; } - private static boolean isEnabled(final AbstractProperty.AbstractPropertyContainer properties, final TestFrameworkRunningModel model) { - if (!TestConsoleProperties.TRACK_RUNNING_TEST.value(properties)) return true; + private static boolean isEnabled(final TestFrameworkRunningModel model) { return model != null && !model.isRunning(); } public static boolean isScrollEnabled(final TestFrameworkRunningModel model) { final TestConsoleProperties properties = model.getProperties(); - return isEnabled(properties, model) && TestConsoleProperties.SCROLL_TO_SOURCE.value(properties); + return isEnabled(model) && TestConsoleProperties.SCROLL_TO_SOURCE.value(properties); } public void setModel(final TestFrameworkRunningModel model) {