Index: LayoutTests/editing/selection/select-by-char-and-word-in-readonly-texts-using-keys-with-caret-mode-off.html |
diff --git a/LayoutTests/editing/selection/select-by-char-and-word-in-readonly-texts-using-keys-with-caret-mode-off.html b/LayoutTests/editing/selection/select-by-char-and-word-in-readonly-texts-using-keys-with-caret-mode-off.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..413b67b8bb1624dcf2f53e38cbba2b77012c310f |
--- /dev/null |
+++ b/LayoutTests/editing/selection/select-by-char-and-word-in-readonly-texts-using-keys-with-caret-mode-off.html |
@@ -0,0 +1,46 @@ |
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
Yuta Kitamura
2014/06/04 08:19:38
Use HTML5 doctype instead of this legacy one.
b.rout
2014/06/04 12:53:04
Ok.
|
+<html> |
+<head> |
+<script src="../../resources/js-test.js"></script> |
+</head> |
+<body> |
+<p>This test selects readonly texts using left/right arrow keys in combination with shift and ctrl modifiers when caretbrowsing is disabled.</p> |
+<p id="target">Select using shift and left or right arrow key to see character by character selection. Select using shift and ctrl and left or right arrow key to see word by word selection.</p> |
+<div id="console"></div> |
+<script> |
+ |
+if (window.testRunner && window.internals) { |
+ testRunner.overridePreference("WebKitEnableCaretBrowsing", false); |
+ testRunner.dumpAsText(); |
+ internals.settings.setEditingBehavior('mac'); |
+ |
+ var target = document.getElementById("target"); |
+ target.focus(); |
+ |
+ // check left/right arrows + Shift |
+ window.getSelection().setPosition(target.childNodes.item(0), 10); |
+ eventSender.keyDown("rightArrow", ["shiftKey"]); |
+ eventSender.keyDown("rightArrow", ["shiftKey"]); |
+ shouldBe("getSelection().baseOffset", "10"); |
+ shouldBe("getSelection().extentOffset", "12"); |
+ eventSender.keyDown("leftArrow", ["shiftKey"]); |
+ eventSender.keyDown("leftArrow", ["shiftKey"]); |
+ eventSender.keyDown("leftArrow", ["shiftKey"]); |
+ shouldBe("getSelection().baseOffset", "10"); |
+ shouldBe("getSelection().extentOffset", "9"); |
+ |
+ // check left/right arrows + Ctrl + Shift |
+ window.getSelection().setPosition(target.childNodes.item(0), 10); |
+ var modifierForWordGranularity = navigator.platform == "MacIntel" ? "altKey" : "ctrlKey"; |
+ eventSender.keyDown("rightArrow", [modifierForWordGranularity, "shiftKey"]); |
+ eventSender.keyDown("rightArrow", [modifierForWordGranularity, "shiftKey"]); |
+ shouldBe("getSelection().baseOffset", "10"); |
+ shouldBe("getSelection().extentOffset", "18"); |
+ eventSender.keyDown("leftArrow", [modifierForWordGranularity, "shiftKey"]); |
+ shouldBe("getSelection().baseOffset", "10"); |
+ shouldBe("getSelection().extentOffset", "13"); |
+} |
+ |
+</script> |
+</body> |
+</html> |