3 <script src=
"../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"editor-test.js"></script>
8 var textEditor
= InspectorTest
.createTestEditor();
9 textEditor
.setMimeType("text/javascript");
10 textEditor
.setReadOnly(false);
11 textEditor
.element
.focus();
13 function clearEditor()
15 textEditor
.setText("");
16 textEditor
.setSelection(WebInspector
.TextRange
.createFromLocation(0, 0));
19 InspectorTest
.runTestSuite([
20 function testTypeBraceSequence(next
)
23 InspectorTest
.typeIn(textEditor
, "({[", onTypedIn
);
26 InspectorTest
.dumpTextWithSelection(textEditor
);
31 function testBraceOverride(next
)
34 InspectorTest
.typeIn(textEditor
, "({[]})", onTypedIn
);
37 InspectorTest
.dumpTextWithSelection(textEditor
);
42 function testQuotesToCloseStringLiterals(next
)
44 textEditor
.setText("'Hello");
45 textEditor
.setSelection(WebInspector
.TextRange
.createFromLocation(0, 6));
46 InspectorTest
.typeIn(textEditor
, "\"'", onTypedIn
);
49 InspectorTest
.dumpTextWithSelection(textEditor
);
54 function testQuotesToCloseStringLiteralInsideLine(next
)
56 textEditor
.setText("console.log(\"information\");");
57 textEditor
.setSelection(WebInspector
.TextRange
.createFromLocation(0, 24));
58 InspectorTest
.typeIn(textEditor
, "\"", onTypedIn
);
61 InspectorTest
.dumpTextWithSelection(textEditor
);
71 <body onload=
"runTest();">
73 This test checks text editor smart braces functionality.