OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <head> | 2 <head> |
3 <script src="../../resources/js-test.js"></script> | 3 <script src="../../resources/js-test.js"></script> |
4 <script src="resources/spatial-navigation-utils.js"></script> | 4 <script src="resources/spatial-navigation-utils.js"></script> |
5 </head> | 5 </head> |
6 <body id="some-content" xmlns="http://www.w3.org/1999/xhtml"> | 6 <body id="some-content" xmlns="http://www.w3.org/1999/xhtml"> |
7 <p id="description"></p> | 7 <p id="description"></p> |
8 <table style="text-align: left; width: 100%; margin-left: auto; margin-right
: auto;" border="1" cellpadding="2" cellspacing="1"> | 8 <table style="text-align: left; width: 100%; margin-left: auto; margin-right
: auto;" border="1" cellpadding="2" cellspacing="1"> |
9 <tbody> | 9 <tbody> |
10 <tr> | 10 <tr> |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 window.internals.settings.setSpatialNavigationEnabled(true); | 58 window.internals.settings.setSpatialNavigationEnabled(true); |
59 testRunner.waitUntilDone(); | 59 testRunner.waitUntilDone(); |
60 } | 60 } |
61 | 61 |
62 function runTest() | 62 function runTest() |
63 { | 63 { |
64 var textarea = document.getElementById("start"); | 64 var textarea = document.getElementById("start"); |
65 textarea.value = "abc\nd"; | 65 textarea.value = "abc\nd"; |
66 | 66 |
67 // starting the test itself: get to a known place. | 67 // starting the test itself: get to a known place. |
68 document.getElementById("start").focus(); | 68 textarea.focus(); |
| 69 textarea.setSelectionRange(0, 0); |
69 | 70 |
70 initTest(resultMap, testCompleted); | 71 initTest(resultMap, testCompleted); |
71 } | 72 } |
72 | 73 |
73 function testCompleted() | 74 function testCompleted() |
74 { | 75 { |
75 if (!window.testRunner) | 76 if (!window.testRunner) |
76 return; | 77 return; |
77 | 78 |
78 document.getElementById('start').value = ""; | 79 document.getElementById('start').value = ""; |
79 var text = 'A text containing a space\nand a new line'; | 80 var text = 'A text containing a space\nand a new line'; |
80 for (var i = 0; i < text.length; ++i) | 81 for (var i = 0; i < text.length; ++i) |
81 eventSender.keyDown(text.charAt(i)); | 82 eventSender.keyDown(text.charAt(i)); |
82 shouldBeEqualToString("document.getElementById('start').value", text); | 83 shouldBeEqualToString("document.getElementById('start').value", text); |
83 | 84 |
84 testRunner.notifyDone(); | 85 testRunner.notifyDone(); |
85 } | 86 } |
86 | 87 |
87 window.onload = runTest; | 88 window.onload = runTest; |
88 | 89 |
89 </script> | 90 </script> |
90 </body> | 91 </body> |
91 </html> | 92 </html> |
OLD | NEW |