| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="editor-test.js"></script> | 4 <script src="editor-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 function test() | 6 function test() |
| 7 { | 7 { |
| 8 function testFunction(foo, bar) | 8 function testFunction(foo, bar) |
| 9 { | 9 { |
| 10 someFunctionCall(bar); | 10 someFunctionCall(bar); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 var line = textEditor.line(selection.startLine); | 37 var line = textEditor.line(selection.startLine); |
| 38 InspectorTest.addResult(line.substring(0, selection.startColumn) + "
|" + line.substring(selection.startColumn)); | 38 InspectorTest.addResult(line.substring(0, selection.startColumn) + "
|" + line.substring(selection.startColumn)); |
| 39 } else { | 39 } else { |
| 40 InspectorTest.addResult(">>" + textEditor.text(selection.normalize()
) + "<<"); | 40 InspectorTest.addResult(">>" + textEditor.text(selection.normalize()
) + "<<"); |
| 41 } | 41 } |
| 42 return selection; | 42 return selection; |
| 43 } | 43 } |
| 44 | 44 |
| 45 function setCursorAtBeginning() | 45 function setCursorAtBeginning() |
| 46 { | 46 { |
| 47 textEditor.setSelection(Common.TextRange.createFromLocation(0, 0)); | 47 textEditor.setSelection(TextUtils.TextRange.createFromLocation(0, 0)); |
| 48 } | 48 } |
| 49 | 49 |
| 50 function setCursorAtEnd() | 50 function setCursorAtEnd() |
| 51 { | 51 { |
| 52 var lastLine = textEditor.linesCount - 1; | 52 var lastLine = textEditor.linesCount - 1; |
| 53 var lastColumn = textEditor.line(lastLine).length; | 53 var lastColumn = textEditor.line(lastLine).length; |
| 54 textEditor.setSelection(Common.TextRange.createFromLocation(lastLine, la
stColumn)); | 54 textEditor.setSelection(TextUtils.TextRange.createFromLocation(lastLine,
lastColumn)); |
| 55 } | 55 } |
| 56 | 56 |
| 57 function fireEventWhileSelectionChanges(eventType, modifiers, callback) | 57 function fireEventWhileSelectionChanges(eventType, modifiers, callback) |
| 58 { | 58 { |
| 59 var oldSelection = textEditor.selection(); | 59 var oldSelection = textEditor.selection(); |
| 60 | 60 |
| 61 function eventCallback() | 61 function eventCallback() |
| 62 { | 62 { |
| 63 var selection = dumpEditorSelection(); | 63 var selection = dumpEditorSelection(); |
| 64 if (selection.collapseToEnd().compareTo(oldSelection.collapseToEnd()
) !== 0) { | 64 if (selection.collapseToEnd().compareTo(oldSelection.collapseToEnd()
) !== 0) { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 </script> | 153 </script> |
| 154 </head> | 154 </head> |
| 155 | 155 |
| 156 <body onload="runTest();"> | 156 <body onload="runTest();"> |
| 157 <p> | 157 <p> |
| 158 This test checks how text editor handles different movements: ctrl-left, ctrl-ri
ght, ctrl-shift-left, ctrl-backspace, alt-left, alt-right, alt-shift-left, alt-s
hift-right. | 158 This test checks how text editor handles different movements: ctrl-left, ctrl-ri
ght, ctrl-shift-left, ctrl-backspace, alt-left, alt-right, alt-shift-left, alt-s
hift-right. |
| 159 </p> | 159 </p> |
| 160 | 160 |
| 161 </body> | 161 </body> |
| 162 </html> | 162 </html> |
| OLD | NEW |