| 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 var textEditor = InspectorTest.createTestEditor(); | 8 var textEditor = InspectorTest.createTestEditor(); |
| 9 textEditor.setMimeType("text/javascript"); | 9 textEditor.setMimeType("text/javascript"); |
| 10 textEditor.setReadOnly(false); | 10 textEditor.setReadOnly(false); |
| 11 textEditor.element.focus(); | 11 textEditor.element.focus(); |
| 12 | 12 |
| 13 function clearEditor() | 13 function clearEditor() |
| 14 { | 14 { |
| 15 textEditor.setText(""); | 15 textEditor.setText(""); |
| 16 textEditor.setSelection(Common.TextRange.createFromLocation(0, 0)); | 16 textEditor.setSelection(TextUtils.TextRange.createFromLocation(0, 0)); |
| 17 } | 17 } |
| 18 | 18 |
| 19 InspectorTest.runTestSuite([ | 19 InspectorTest.runTestSuite([ |
| 20 function testTypeBraceSequence(next) | 20 function testTypeBraceSequence(next) |
| 21 { | 21 { |
| 22 clearEditor(); | 22 clearEditor(); |
| 23 InspectorTest.typeIn(textEditor, "({[", onTypedIn); | 23 InspectorTest.typeIn(textEditor, "({[", onTypedIn); |
| 24 function onTypedIn() | 24 function onTypedIn() |
| 25 { | 25 { |
| 26 InspectorTest.dumpTextWithSelection(textEditor); | 26 InspectorTest.dumpTextWithSelection(textEditor); |
| 27 next(); | 27 next(); |
| 28 } | 28 } |
| 29 }, | 29 }, |
| 30 | 30 |
| 31 function testBraceOverride(next) | 31 function testBraceOverride(next) |
| 32 { | 32 { |
| 33 clearEditor(); | 33 clearEditor(); |
| 34 InspectorTest.typeIn(textEditor, "({[]})", onTypedIn); | 34 InspectorTest.typeIn(textEditor, "({[]})", onTypedIn); |
| 35 function onTypedIn() | 35 function onTypedIn() |
| 36 { | 36 { |
| 37 InspectorTest.dumpTextWithSelection(textEditor); | 37 InspectorTest.dumpTextWithSelection(textEditor); |
| 38 next(); | 38 next(); |
| 39 } | 39 } |
| 40 }, | 40 }, |
| 41 | 41 |
| 42 function testQuotesToCloseStringLiterals(next) | 42 function testQuotesToCloseStringLiterals(next) |
| 43 { | 43 { |
| 44 textEditor.setText("'Hello"); | 44 textEditor.setText("'Hello"); |
| 45 textEditor.setSelection(Common.TextRange.createFromLocation(0, 6)); | 45 textEditor.setSelection(TextUtils.TextRange.createFromLocation(0, 6)
); |
| 46 InspectorTest.typeIn(textEditor, "\"'", onTypedIn); | 46 InspectorTest.typeIn(textEditor, "\"'", onTypedIn); |
| 47 function onTypedIn() | 47 function onTypedIn() |
| 48 { | 48 { |
| 49 InspectorTest.dumpTextWithSelection(textEditor); | 49 InspectorTest.dumpTextWithSelection(textEditor); |
| 50 next(); | 50 next(); |
| 51 } | 51 } |
| 52 }, | 52 }, |
| 53 | 53 |
| 54 function testQuotesToCloseStringLiteralInsideLine(next) | 54 function testQuotesToCloseStringLiteralInsideLine(next) |
| 55 { | 55 { |
| 56 textEditor.setText("console.log(\"information\");"); | 56 textEditor.setText("console.log(\"information\");"); |
| 57 textEditor.setSelection(Common.TextRange.createFromLocation(0, 24)); | 57 textEditor.setSelection(TextUtils.TextRange.createFromLocation(0, 24
)); |
| 58 InspectorTest.typeIn(textEditor, "\"", onTypedIn); | 58 InspectorTest.typeIn(textEditor, "\"", onTypedIn); |
| 59 function onTypedIn() | 59 function onTypedIn() |
| 60 { | 60 { |
| 61 InspectorTest.dumpTextWithSelection(textEditor); | 61 InspectorTest.dumpTextWithSelection(textEditor); |
| 62 next(); | 62 next(); |
| 63 } | 63 } |
| 64 } | 64 } |
| 65 ]); | 65 ]); |
| 66 } | 66 } |
| 67 | 67 |
| 68 </script> | 68 </script> |
| 69 </head> | 69 </head> |
| 70 | 70 |
| 71 <body onload="runTest();"> | 71 <body onload="runTest();"> |
| 72 <p> | 72 <p> |
| 73 This test checks text editor smart braces functionality. | 73 This test checks text editor smart braces functionality. |
| 74 </p> | 74 </p> |
| 75 | 75 |
| 76 </body> | 76 </body> |
| 77 </html> | 77 </html> |
| OLD | NEW |