| 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 codeSnippet() { | 6 function codeSnippet() { |
| 7 return document.getElementById("codeSnippet").textContent; | 7 return document.getElementById("codeSnippet").textContent; |
| 8 } | 8 } |
| 9 | 9 |
| 10 function test() | 10 function test() |
| 11 { | 11 { |
| 12 var textEditor = InspectorTest.createTestEditor(); | 12 var textEditor = InspectorTest.createTestEditor(); |
| 13 textEditor.setMimeType("text/javascript"); | 13 textEditor.setMimeType("text/javascript"); |
| 14 textEditor.setReadOnly(false); | 14 textEditor.setReadOnly(false); |
| 15 textEditor.element.focus(); | 15 textEditor.element.focus(); |
| 16 InspectorTest.evaluateInPage("codeSnippet();", onCodeSnippet); | 16 InspectorTest.evaluateInPage("codeSnippet();", onCodeSnippet); |
| 17 | 17 |
| 18 function onCodeSnippet(result) | 18 function onCodeSnippet(result) |
| 19 { | 19 { |
| 20 var codeLines = result.value; | 20 var codeLines = result.value; |
| 21 textEditor.setText(codeLines); | 21 textEditor.setText(codeLines); |
| 22 InspectorTest.runTestSuite(testSuite); | 22 InspectorTest.runTestSuite(testSuite); |
| 23 } | 23 } |
| 24 | 24 |
| 25 function nextOccurrence(times) | 25 function nextOccurrence(times) |
| 26 { | 26 { |
| 27 for (var i = 0; i < times; ++i) | 27 for (var i = 0; i < times; ++i) |
| 28 textEditor._selectNextOccurrenceController.selectNextOccurrence(); | 28 InspectorTest.fakeKeyEvent(textEditor, "D", ["ctrlKey"]); |
| 29 } | |
| 30 | |
| 31 function undoLastSelection() | |
| 32 { | |
| 33 textEditor._selectNextOccurrenceController.undoLastSelection(); | |
| 34 } | 29 } |
| 35 | 30 |
| 36 function lineSelection(line, from, to) | 31 function lineSelection(line, from, to) |
| 37 { | 32 { |
| 38 if (typeof to !== "number") | 33 if (typeof to !== "number") |
| 39 to = from; | 34 to = from; |
| 40 InspectorTest.setLineSelections(textEditor, [ | 35 InspectorTest.setLineSelections(textEditor, [ |
| 41 { line: line, from: from, to: to } | 36 { line: line, from: from, to: to } |
| 42 ]); | 37 ]); |
| 43 } | 38 } |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 } | 140 } |
| 146 }) | 141 }) |
| 147 .fail(function(obj, err, errDescr) { | 142 .fail(function(obj, err, errDescr) { |
| 148 stub.failure("Error: " + errDescr); | 143 stub.failure("Error: " + errDescr); |
| 149 }) | 144 }) |
| 150 } | 145 } |
| 151 </pre> | 146 </pre> |
| 152 | 147 |
| 153 </body> | 148 </body> |
| 154 </html> | 149 </html> |
| OLD | NEW |