--- old/functional/ControlsTests/test/javafx/scene/control/test/textinput/TextInputBase.java 2017-02-10 15:01:47.089292096 +0300 +++ new/functional/ControlsTests/test/javafx/scene/control/test/textinput/TextInputBase.java 2017-02-10 15:01:47.037291504 +0300 @@ -25,7 +25,7 @@ package javafx.scene.control.test.textinput; import client.test.ScreenshotCheck; -import com.sun.javafx.scene.control.skin.TextInputControlSkin; +import javafx.scene.control.skin.TextInputControlSkin; import java.lang.reflect.Field; import java.util.HashMap; import java.util.HashSet; @@ -82,7 +82,7 @@ } private Wrap taTesting = null; - static final KeyboardModifiers CTRL = Utils.isMacOS() ? KeyboardModifiers.META_DOWN_MASK : KeyboardModifiers.CTRL_DOWN_MASK; + static final KeyboardModifiers CTRL = Utils.isMacOS() ? KeyboardModifiers.ALT_DOWN_MASK : KeyboardModifiers.CTRL_DOWN_MASK; // /** // * Test for TextInput setMaximumLength API // */ @@ -523,6 +523,7 @@ } else { checkState("Copy", true); checkState("Cut", true); + getScene().keyboard().pushKey(KeyboardButtons.ESCAPE); } initContext(); @@ -611,12 +612,17 @@ String text = getTextFromControl(); final String initialText = text; - while (!"".equals(text)) { - text = deleteLastWord(text); + if (isPasswordField()) { taTesting.keyboard().pushKey(Keyboard.KeyboardButtons.BACK_SPACE, CTRL); - if (isPasswordField()) { - Assert.assertEquals(initialText, getTextFromControl()); + if (Utils.isMacOS()) { + Assert.assertEquals("", getTextFromControl()); } else { + Assert.assertEquals(initialText, getTextFromControl()); + } + } else { + while (!text.isEmpty()) { + text = deleteLastWord(text); + taTesting.keyboard().pushKey(Keyboard.KeyboardButtons.BACK_SPACE, CTRL); if (!text.equals(getTextFromControl())) { out(initialText, text); } @@ -633,7 +639,7 @@ String text = getTextFromControl(); final String initialText = text; while (!"".equals(text)) { - text = deleteFirstWord(text, true); + text = deleteFirstWord(text, Utils.isMacOS() ? false : true); taTesting.keyboard().pushKey(Keyboard.KeyboardButtons.DELETE, CTRL); if (isPasswordField()) { Assert.assertEquals(initialText, getTextFromControl()); @@ -674,14 +680,15 @@ * @return string without first word. */ private String deleteFirstWord(String text, boolean deleteFromBeginning) { - final String[] punctuation = new String[]{" ", "\n", "\t", "/", ",", ";", "!", "@", "#", "$", "%", "^", "*", "(", ")", "&", "."}; + final String[] punctuation = new String[] {" ", "\n", "\t", "/", ",", ";", "!", "@", "#", "$", "%", "^", "*", "(", ")", "&", "."}; + if (!deleteFromBeginning) { while (startsWithAnyOf(text, punctuation)) { text = text.substring(1); } text = removeLeadingChars(text, punctuation); } else { - if (!Utils.isWindows()) { + if (Utils.isLinux()) { if (' ' == text.charAt(0)) { int pos = 0; while(' ' == text.charAt(pos)) ++pos; @@ -691,12 +698,20 @@ } } + if ('\n' == text.charAt(0)) { + text = text.substring(1); + return text; + } + text = removeLeadingChars(text, punctuation); + if ('\n' == text.charAt(0)) { + return text; + } + if (Utils.isLinux()) { + return text; + } while (startsWithAnyOf(text, punctuation)) { - if (!Utils.isWindows()) { - break; - } text = text.substring(1); } } @@ -737,7 +752,7 @@ final Wrap wrap = getScene().as(Parent.class, Node.class).lookup(TextInputControl.class).wrap(); wrap.as(Text.class).clear(); wrap.as(Text.class).type(SAMPLE_STRING); - wrap.keyboard().pushKey(KeyboardButtons.A, Utils.isMacOS() ? KeyboardModifiers.META_DOWN_MASK : CTRL); + wrap.keyboard().pushKey(KeyboardButtons.A, Utils.isMacOS() ? KeyboardModifiers.META_DOWN_MASK : KeyboardModifiers.CTRL_DOWN_MASK); new GetAction() { @Override public void run(Object... os) throws Exception {