changeset 5196:5137e3d135ee

RT-33015: Unit test failures in controls *test_rt21375_scenario* Reviewed-by: jgiles
author rbair
date Thu, 26 Sep 2013 16:52:17 -0700
parents 145c3b420819
children 0f199384c1d6
files modules/controls/src/test/java/javafx/scene/control/ListViewKeyInputTest.java modules/controls/src/test/java/javafx/scene/control/TableViewKeyInputTest.java modules/controls/src/test/java/javafx/scene/control/TreeTableViewKeyInputTest.java modules/controls/src/test/java/javafx/scene/control/TreeViewKeyInputTest.java
diffstat 4 files changed, 43 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/test/java/javafx/scene/control/ListViewKeyInputTest.java	Thu Sep 26 17:57:10 2013 -0400
+++ b/modules/controls/src/test/java/javafx/scene/control/ListViewKeyInputTest.java	Thu Sep 26 16:52:17 2013 -0700
@@ -25,24 +25,28 @@
 
 package javafx.scene.control;
 
-import com.sun.javafx.tk.Toolkit;
 import javafx.beans.InvalidationListener;
 import javafx.beans.Observable;
 import javafx.event.EventHandler;
 import javafx.scene.input.KeyCode;
 import java.util.List;
+import com.sun.javafx.PlatformUtil;
 import com.sun.javafx.Utils;
 import com.sun.javafx.scene.control.behavior.ListViewAnchorRetriever;
 import com.sun.javafx.scene.control.infrastructure.KeyEventFirer;
 import com.sun.javafx.scene.control.infrastructure.KeyModifier;
 import com.sun.javafx.scene.control.infrastructure.StageLoader;
 import com.sun.javafx.scene.control.infrastructure.VirtualFlowTestUtils;
+import com.sun.javafx.tk.Toolkit;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
-
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
 public class ListViewKeyInputTest {
     private ListView<String> listView;
@@ -1417,7 +1421,7 @@
 
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey());
-        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey());
+        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey(), PlatformUtil.isMac() ? KeyModifier.CTRL : null);
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.SHIFT);
         Toolkit.getToolkit().firePulse();
@@ -1438,7 +1442,7 @@
 
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey());
-        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey());
+        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey(), PlatformUtil.isMac() ? KeyModifier.CTRL : null);
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey(), KeyModifier.SHIFT);
         Toolkit.getToolkit().firePulse();
@@ -1497,7 +1501,7 @@
 
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey());
-        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey());
+        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey(), PlatformUtil.isMac() ? KeyModifier.CTRL : null);
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.SHIFT);
         Toolkit.getToolkit().firePulse();
@@ -1518,7 +1522,7 @@
 
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey());
-        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey());
+        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey(), PlatformUtil.isMac() ? KeyModifier.CTRL : null);
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey(), KeyModifier.SHIFT);
         Toolkit.getToolkit().firePulse();
--- a/modules/controls/src/test/java/javafx/scene/control/TableViewKeyInputTest.java	Thu Sep 26 17:57:10 2013 -0400
+++ b/modules/controls/src/test/java/javafx/scene/control/TableViewKeyInputTest.java	Thu Sep 26 16:52:17 2013 -0700
@@ -25,7 +25,6 @@
 
 package javafx.scene.control;
 
-import com.sun.javafx.tk.Toolkit;
 import javafx.beans.InvalidationListener;
 import javafx.beans.Observable;
 import javafx.beans.property.ReadOnlyStringWrapper;
@@ -34,19 +33,23 @@
 import javafx.scene.input.KeyCode;
 import javafx.util.Callback;
 import java.util.List;
+import com.sun.javafx.PlatformUtil;
 import com.sun.javafx.Utils;
 import com.sun.javafx.scene.control.behavior.TableViewAnchorRetriever;
 import com.sun.javafx.scene.control.infrastructure.KeyEventFirer;
 import com.sun.javafx.scene.control.infrastructure.KeyModifier;
 import com.sun.javafx.scene.control.infrastructure.StageLoader;
 import com.sun.javafx.scene.control.infrastructure.VirtualFlowTestUtils;
+import com.sun.javafx.tk.Toolkit;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
-
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
 //@Ignore("Disabling tests as they fail with OOM in continuous builds")
 public class TableViewKeyInputTest {
@@ -68,7 +71,7 @@
         tableView = new TableView<String>();
         sm = tableView.getSelectionModel();
         fm = tableView.getFocusModel();
-        
+
         sm.setSelectionMode(SelectionMode.MULTIPLE);
         sm.setCellSelectionEnabled(false);
         
@@ -2203,7 +2206,7 @@
 
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey());
-        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey());
+        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey(), PlatformUtil.isMac() ? KeyModifier.CTRL : null);
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.SHIFT);
         Toolkit.getToolkit().firePulse();
@@ -2224,7 +2227,7 @@
 
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey());
-        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey());
+        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey(), PlatformUtil.isMac() ? KeyModifier.CTRL : null);
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey(), KeyModifier.SHIFT);
         Toolkit.getToolkit().firePulse();
@@ -2283,7 +2286,7 @@
 
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey());
-        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey());
+        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey(), PlatformUtil.isMac() ? KeyModifier.CTRL : null);
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.SHIFT);
         Toolkit.getToolkit().firePulse();
@@ -2304,7 +2307,7 @@
 
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey());
-        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey());
+        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey(), PlatformUtil.isMac() ? KeyModifier.CTRL : null);
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey(), KeyModifier.SHIFT);
         Toolkit.getToolkit().firePulse();
--- a/modules/controls/src/test/java/javafx/scene/control/TreeTableViewKeyInputTest.java	Thu Sep 26 17:57:10 2013 -0400
+++ b/modules/controls/src/test/java/javafx/scene/control/TreeTableViewKeyInputTest.java	Thu Sep 26 16:52:17 2013 -0700
@@ -25,29 +25,31 @@
 
 package javafx.scene.control;
 
-import com.sun.javafx.tk.Toolkit;
 import javafx.beans.InvalidationListener;
 import javafx.beans.Observable;
 import javafx.beans.property.ReadOnlyStringWrapper;
 import javafx.beans.value.ObservableValue;
-import javafx.collections.FXCollections;
 import javafx.event.EventHandler;
 import javafx.scene.input.KeyCode;
 import javafx.util.Callback;
 import java.util.List;
+import com.sun.javafx.PlatformUtil;
 import com.sun.javafx.Utils;
 import com.sun.javafx.scene.control.behavior.TreeTableViewAnchorRetriever;
 import com.sun.javafx.scene.control.infrastructure.KeyEventFirer;
 import com.sun.javafx.scene.control.infrastructure.KeyModifier;
 import com.sun.javafx.scene.control.infrastructure.StageLoader;
 import com.sun.javafx.scene.control.infrastructure.VirtualFlowTestUtils;
+import com.sun.javafx.tk.Toolkit;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
-
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
 //@Ignore("Disabling tests as they fail with OOM in continuous builds")
 public class TreeTableViewKeyInputTest {
@@ -2675,7 +2677,7 @@
 
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey());
-        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey());
+        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey(), PlatformUtil.isMac() ? KeyModifier.CTRL : null);
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.SHIFT);
         Toolkit.getToolkit().firePulse();
@@ -2696,7 +2698,7 @@
 
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey());
-        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey());
+        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey(), PlatformUtil.isMac() ? KeyModifier.CTRL : null);
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey(), KeyModifier.SHIFT);
         Toolkit.getToolkit().firePulse();
@@ -2759,7 +2761,7 @@
 
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey());
-        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey());
+        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey(), PlatformUtil.isMac() ? KeyModifier.CTRL : null);
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.SHIFT);
         Toolkit.getToolkit().firePulse();
@@ -2780,7 +2782,7 @@
 
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey());
-        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey());
+        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey(), PlatformUtil.isMac() ? KeyModifier.CTRL : null);
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey(), KeyModifier.SHIFT);
         Toolkit.getToolkit().firePulse();
--- a/modules/controls/src/test/java/javafx/scene/control/TreeViewKeyInputTest.java	Thu Sep 26 17:57:10 2013 -0400
+++ b/modules/controls/src/test/java/javafx/scene/control/TreeViewKeyInputTest.java	Thu Sep 26 16:52:17 2013 -0700
@@ -25,27 +25,30 @@
 
 package javafx.scene.control;
 
-import com.sun.javafx.tk.Toolkit;
 import javafx.beans.InvalidationListener;
 import javafx.beans.Observable;
-import javafx.collections.FXCollections;
 import javafx.event.Event;
 import javafx.event.EventHandler;
 import javafx.scene.input.KeyCode;
 import java.util.List;
+import com.sun.javafx.PlatformUtil;
 import com.sun.javafx.Utils;
 import com.sun.javafx.scene.control.behavior.TreeViewAnchorRetriever;
 import com.sun.javafx.scene.control.infrastructure.KeyEventFirer;
 import com.sun.javafx.scene.control.infrastructure.KeyModifier;
 import com.sun.javafx.scene.control.infrastructure.StageLoader;
 import com.sun.javafx.scene.control.infrastructure.VirtualFlowTestUtils;
+import com.sun.javafx.tk.Toolkit;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
-
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
 //@Ignore("Disabling tests as they fail with OOM in continuous builds")
 public class TreeViewKeyInputTest {
@@ -1611,7 +1614,7 @@
 
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey());
-        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey());
+        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey(), PlatformUtil.isMac() ? KeyModifier.CTRL : null);
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.SHIFT);
         Toolkit.getToolkit().firePulse();
@@ -1632,7 +1635,7 @@
 
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey());
-        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey());
+        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey(), PlatformUtil.isMac() ? KeyModifier.CTRL : null);
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.DOWN,  KeyModifier.getShortcutKey(), KeyModifier.SHIFT);
         Toolkit.getToolkit().firePulse();
@@ -1691,7 +1694,7 @@
 
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey());
-        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey());
+        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey(), PlatformUtil.isMac() ? KeyModifier.CTRL : null);
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.SHIFT);
         Toolkit.getToolkit().firePulse();
@@ -1712,7 +1715,7 @@
 
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey());
-        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey());
+        keyboard.doKeyPress(KeyCode.SPACE, KeyModifier.getShortcutKey(), PlatformUtil.isMac() ? KeyModifier.CTRL : null);
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey());
         keyboard.doKeyPress(KeyCode.UP,  KeyModifier.getShortcutKey(), KeyModifier.SHIFT);
         Toolkit.getToolkit().firePulse();