| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 } | 69 } |
| 70 } | 70 } |
| 71 InspectorTest.fakeKeyEvent(textEditor, eventType, modifiers, eventCallba
ck); | 71 InspectorTest.fakeKeyEvent(textEditor, eventType, modifiers, eventCallba
ck); |
| 72 } | 72 } |
| 73 | 73 |
| 74 InspectorTest.runTestSuite([ | 74 InspectorTest.runTestSuite([ |
| 75 function testCtrlRightArrow(next) | 75 function testCtrlRightArrow(next) |
| 76 { | 76 { |
| 77 setCursorAtBeginning(); | 77 setCursorAtBeginning(); |
| 78 dumpEditorSelection(); | 78 dumpEditorSelection(); |
| 79 fireEventWhileSelectionChanges("rightArrow", [wordJumpModifier], nex
t); | 79 fireEventWhileSelectionChanges("ArrowRight", [wordJumpModifier], nex
t); |
| 80 }, | 80 }, |
| 81 | 81 |
| 82 function testCtrlLeftArrow(next) | 82 function testCtrlLeftArrow(next) |
| 83 { | 83 { |
| 84 setCursorAtEnd(); | 84 setCursorAtEnd(); |
| 85 dumpEditorSelection(); | 85 dumpEditorSelection(); |
| 86 fireEventWhileSelectionChanges("leftArrow", [wordJumpModifier], next
); | 86 fireEventWhileSelectionChanges("ArrowLeft", [wordJumpModifier], next
); |
| 87 }, | 87 }, |
| 88 | 88 |
| 89 function testCtrlShiftRightArrow(next) | 89 function testCtrlShiftRightArrow(next) |
| 90 { | 90 { |
| 91 setCursorAtBeginning(); | 91 setCursorAtBeginning(); |
| 92 dumpEditorSelection(); | 92 dumpEditorSelection(); |
| 93 fireEventWhileSelectionChanges("rightArrow", [wordJumpModifier, "shi
ftKey"], next); | 93 fireEventWhileSelectionChanges("ArrowRight", [wordJumpModifier, "shi
ftKey"], next); |
| 94 }, | 94 }, |
| 95 | 95 |
| 96 function testCtrlShiftLeftArrow(next) | 96 function testCtrlShiftLeftArrow(next) |
| 97 { | 97 { |
| 98 setCursorAtEnd(); | 98 setCursorAtEnd(); |
| 99 var selection = dumpEditorSelection(); | 99 var selection = dumpEditorSelection(); |
| 100 fireEventWhileSelectionChanges("leftArrow", [wordJumpModifier, "shif
tKey"], next); | 100 fireEventWhileSelectionChanges("ArrowLeft", [wordJumpModifier, "shif
tKey"], next); |
| 101 }, | 101 }, |
| 102 | 102 |
| 103 function testCtrlBackspace(next) | 103 function testCtrlBackspace(next) |
| 104 { | 104 { |
| 105 setCursorAtEnd(); | 105 setCursorAtEnd(); |
| 106 InspectorTest.addResult("==============="); | 106 InspectorTest.addResult("==============="); |
| 107 InspectorTest.addResult(textEditor.text()); | 107 InspectorTest.addResult(textEditor.text()); |
| 108 function eventCallback() | 108 function eventCallback() |
| 109 { | 109 { |
| 110 InspectorTest.addResult("==============="); | 110 InspectorTest.addResult("==============="); |
| 111 InspectorTest.addResult(textEditor.text() + "<<"); | 111 InspectorTest.addResult(textEditor.text() + "<<"); |
| 112 if (textEditor.text() !== "") | 112 if (textEditor.text() !== "") |
| 113 InspectorTest.fakeKeyEvent(textEditor, "\b", [wordJumpModifi
er], eventCallback); | 113 InspectorTest.fakeKeyEvent(textEditor, "\b", [wordJumpModifi
er], eventCallback); |
| 114 else | 114 else |
| 115 next(); | 115 next(); |
| 116 } | 116 } |
| 117 InspectorTest.fakeKeyEvent(textEditor, "\b", [wordJumpModifier], eve
ntCallback); | 117 InspectorTest.fakeKeyEvent(textEditor, "\b", [wordJumpModifier], eve
ntCallback); |
| 118 }, | 118 }, |
| 119 | 119 |
| 120 function testAltRight(next) | 120 function testAltRight(next) |
| 121 { | 121 { |
| 122 InspectorTest.addResult("====== CAMEL CASE MOVEMENTS ======"); | 122 InspectorTest.addResult("====== CAMEL CASE MOVEMENTS ======"); |
| 123 textEditor.setText(testMyCamelMove.toString()); | 123 textEditor.setText(testMyCamelMove.toString()); |
| 124 setCursorAtBeginning(); | 124 setCursorAtBeginning(); |
| 125 dumpEditorSelection(); | 125 dumpEditorSelection(); |
| 126 fireEventWhileSelectionChanges("rightArrow", [camelJumpModifier], ne
xt); | 126 fireEventWhileSelectionChanges("ArrowRight", [camelJumpModifier], ne
xt); |
| 127 }, | 127 }, |
| 128 | 128 |
| 129 function testAltLeft(next) | 129 function testAltLeft(next) |
| 130 { | 130 { |
| 131 setCursorAtEnd(); | 131 setCursorAtEnd(); |
| 132 dumpEditorSelection(); | 132 dumpEditorSelection(); |
| 133 fireEventWhileSelectionChanges("leftArrow", [camelJumpModifier], nex
t); | 133 fireEventWhileSelectionChanges("ArrowLeft", [camelJumpModifier], nex
t); |
| 134 }, | 134 }, |
| 135 | 135 |
| 136 function testAltShiftRight(next) | 136 function testAltShiftRight(next) |
| 137 { | 137 { |
| 138 setCursorAtBeginning(); | 138 setCursorAtBeginning(); |
| 139 dumpEditorSelection(); | 139 dumpEditorSelection(); |
| 140 fireEventWhileSelectionChanges("rightArrow", [camelJumpModifier, "sh
iftKey"], next); | 140 fireEventWhileSelectionChanges("ArrowRight", [camelJumpModifier, "sh
iftKey"], next); |
| 141 }, | 141 }, |
| 142 | 142 |
| 143 function testAltShiftLeft(next) | 143 function testAltShiftLeft(next) |
| 144 { | 144 { |
| 145 setCursorAtEnd(); | 145 setCursorAtEnd(); |
| 146 dumpEditorSelection(); | 146 dumpEditorSelection(); |
| 147 fireEventWhileSelectionChanges("leftArrow", [camelJumpModifier, "shi
ftKey"], next); | 147 fireEventWhileSelectionChanges("ArrowLeft", [camelJumpModifier, "shi
ftKey"], next); |
| 148 } | 148 } |
| 149 ]); | 149 ]); |
| 150 | 150 |
| 151 } | 151 } |
| 152 | 152 |
| 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 |