| Index: LayoutTests/editing/selection/select-down-or-up-the-lines-in-readonly-texts-using-keys-with-caret-mode-off.html
|
| diff --git a/LayoutTests/editing/selection/select-down-or-up-the-lines-in-readonly-texts-using-keys-with-caret-mode-off.html b/LayoutTests/editing/selection/select-down-or-up-the-lines-in-readonly-texts-using-keys-with-caret-mode-off.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..1210f306847542ffa7fb6ffbfc61d561868c9ef9
|
| --- /dev/null
|
| +++ b/LayoutTests/editing/selection/select-down-or-up-the-lines-in-readonly-texts-using-keys-with-caret-mode-off.html
|
| @@ -0,0 +1,47 @@
|
| +<html>
|
| +<head>
|
| +<script src="../../resources/js-test.js"></script>
|
| +</head>
|
| +<body>
|
| +<div id="target" contenteditable="false"><p>This is the first paragraph.</p><p>This is the second paragraph.</p>
|
| +</div>
|
| +<p id="description"></p>
|
| +<div id="console"></div>
|
| +<script>
|
| +description("This tests selection in readonly texts using shift+Up/Down. With this key combination you can select up or down the line. When no further up/down movement is possible, the selection either moves to the start (for up) or end (for down) of the line.")
|
| + if (window.testRunner) {
|
| + testRunner.overridePreference("WebKitEnableCaretBrowsing", false);
|
| + testRunner.dumpAsText();
|
| + }
|
| +
|
| + var onMacPlatform = navigator.userAgent.search(/\bMac OS X\b/) != -1;
|
| +
|
| + var target = document.getElementById('target');
|
| + var selection = window.getSelection();
|
| + var range = document.createRange();
|
| + range.setStart(target.firstChild.firstChild, 3);
|
| + selection.addRange(range);
|
| + target.focus();
|
| + var paragraph1 = target.firstChild.firstChild;
|
| + var paragraph2 = target.childNodes[1].firstChild;
|
| +
|
| + // check up/down arrows + Shift
|
| + if (window.eventSender) {
|
| + eventSender.keyDown("upArrow", ["shiftKey"]);
|
| + shouldBeEqualToString("selection.type", "Range");
|
| + shouldBe("selection.anchorNode", "paragraph1");
|
| + shouldBe("selection.anchorOffset", "3");
|
| + shouldBe("selection.focusNode", "paragraph1");
|
| + shouldBe("selection.focusOffset", "0");
|
| + eventSender.keyDown("downArrow", ["shiftKey"]);
|
| + if (onMacPlatform)
|
| + eventSender.keyDown("downArrow", ["shiftKey"]);
|
| + shouldBeEqualToString("selection.type", "Range");
|
| + shouldBe("selection.anchorNode", "paragraph1");
|
| + shouldBe("selection.anchorOffset", "3");
|
| + shouldBe("selection.focusNode", "paragraph2");
|
| + shouldBe("selection.focusOffset", "3");
|
| + }
|
| +</script>
|
| +<body>
|
| +</html>
|
|
|