Editing tests should use testRunner instead of layoutTestController
[WebKit-https.git] / LayoutTests / editing / selection / shrink-selection-after-shift-pagedown.html
1 <html> 
2 <head>
3 <script>
4     function runTest()
5     {
6         if (window.testRunner)
7             testRunner.dumpAsText();
8         
9         var ta = document.getElementById('ta');
10         ta.setSelectionRange(4, 16);
11
12         var lastSelectedLine;
13         if (window.eventSender) {
14             eventSender.keyDown("pageDown",["shiftKey"]);
15             lastSelectedLine = (ta.value).substring(ta.selectionEnd - 4, ta.selectionEnd);
16             eventSender.keyDown("upArrow",["shiftKey"]);
17         }
18         
19         var result;
20         var selectedText = (ta.value).substring(ta.selectionStart, ta.selectionEnd);
21         if ((selectedText.indexOf(lastSelectedLine) == -1) && (selectedText.indexOf('L01') == -1))
22             result = "SUCCESS: The selection shrunk correctly";
23         else
24             result = "SUCCESS: The selected text is \"" + selectedText + "\".";
25         document.getElementById("result").firstChild.data = result; 
26     }
27 </script>
28 </head>
29 <body onload="runTest()">
30 <p>This tests shrinking a selection with shift-up after extending it with shift-PageDown.</p>
31 <p style="color:green">
32     This test does not run interactively.
33     It uses the event sender to do mouse clicks.
34     To run it manually, press shift-PagDown.  Then press shift-up.
35     The selection should shrink by one line from the bottom after shift-up.
36 </p>
37 <textarea rows=10 id="ta">
38 L01
39 L02
40 L03
41 L04
42 L05
43 L06
44 L07
45 L08
46 L09
47 L10
48 L11
49 L12
50 L13
51 L14
52 L15
53 L16
54 </textarea>
55 <p id="result">TEST HAS NOT RUN</p>
56 </body>