| 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 | 6 |
| 7 function test() | 7 function test() |
| 8 { | 8 { |
| 9 function foo() | 9 function foo() |
| 10 { | 10 { |
| 11 return 42; | 11 return 42; |
| 12 } | 12 } |
| 13 var textEditor = InspectorTest.createTestEditor(); | 13 var textEditor = InspectorTest.createTestEditor(); |
| 14 textEditor.setMimeType("text/javascript"); | 14 textEditor.setMimeType("text/javascript"); |
| 15 textEditor.setReadOnly(false); | 15 textEditor.setReadOnly(false); |
| 16 textEditor.element.focus(); | 16 textEditor.element.focus(); |
| 17 | 17 |
| 18 textEditor.setText(foo.toString()); | 18 textEditor.setText(foo.toString()); |
| 19 | 19 |
| 20 InspectorTest.addResult(textEditor.text()); | 20 InspectorTest.addResult(textEditor.text()); |
| 21 | 21 |
| 22 function homeButton(shift, callback) | 22 function homeButton(shift, callback) |
| 23 { | 23 { |
| 24 var key = WebInspector.isMac() ? "leftArrow" : "home"; | 24 var key = WebInspector.isMac() ? "ArrowLeft" : "Home"; |
| 25 var modifiers = WebInspector.isMac() ? ["metaKey"] : []; | 25 var modifiers = WebInspector.isMac() ? ["metaKey"] : []; |
| 26 if (shift) | 26 if (shift) |
| 27 modifiers.push("shiftKey"); | 27 modifiers.push("shiftKey"); |
| 28 InspectorTest.fakeKeyEvent(textEditor, key, modifiers, callback); | 28 InspectorTest.fakeKeyEvent(textEditor, key, modifiers, callback); |
| 29 } | 29 } |
| 30 | 30 |
| 31 function hitHomeButton(shift, times, callback) | 31 function hitHomeButton(shift, times, callback) |
| 32 { | 32 { |
| 33 function hitButtonCallback() | 33 function hitButtonCallback() |
| 34 { | 34 { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 </head> | 98 </head> |
| 99 | 99 |
| 100 <body onload="runTest();"> | 100 <body onload="runTest();"> |
| 101 <p> | 101 <p> |
| 102 This test verifies that home button triggers selection between first symbol of t
he line | 102 This test verifies that home button triggers selection between first symbol of t
he line |
| 103 and first non-blank symbol of the line. | 103 and first non-blank symbol of the line. |
| 104 </p> | 104 </p> |
| 105 | 105 |
| 106 </body> | 106 </body> |
| 107 </html> | 107 </html> |
| OLD | NEW |