Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / editor / text-editor-smart-braces.html
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="editor-test.js"></script>
5 <script>
6
7 function test()
8 {
9     var textEditor = InspectorTest.createTestEditor();
10     textEditor.setMimeType("text/javascript");
11     textEditor.setReadOnly(false);
12     textEditor.element.focus();
13
14     function clearEditor()
15     {
16         textEditor.setText("");
17         textEditor.setSelection(WebInspector.TextRange.createFromLocation(0, 0));
18     }
19
20     InspectorTest.runTestSuite([
21         function testTypeBraceSequence(next)
22         {
23             clearEditor();
24             InspectorTest.typeIn(textEditor, "({[", step2);
25             function step2()
26             {
27                 InspectorTest.dumpTextWithSelection(textEditor);
28                 next();
29             }
30         },
31
32         function testBraceOverride(next)
33         {
34             clearEditor();
35             InspectorTest.typeIn(textEditor, "({[]})", step3);
36             function step3()
37             {
38                 InspectorTest.dumpTextWithSelection(textEditor);
39                 next();
40             }
41         }
42     ]);
43 }
44
45 </script>
46 </head>
47
48 <body onload="runTest();">
49 <p>
50 This test checks text editor smart braces functionality.
51 </p>
52
53 </body>
54 </html>