Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / editor / text-editor-block-indent.html
blobde50cd6b6582a124235066ea2acb61e8f70cb839
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="editor-test.js"></script>
5 <script>
6 function codeSnippet() {
7 return document.getElementById("codeSnippet").textContent;
10 function test()
12 var textEditor = InspectorTest.createTestEditor();
13 textEditor.setMimeType("text/javascript");
14 textEditor.setReadOnly(false);
15 textEditor.element.focus();
16 InspectorTest.evaluateInPage("codeSnippet();", onCodeSnippet);
17 var codeSnippetText;
19 function onCodeSnippet(result)
21 codeSnippetText = result.value;
22 InspectorTest.runTestSuite(testSuite);
25 function dumpAndNext(next)
27 function innerDumpAndNext()
29 InspectorTest.dumpTextWithSelection(textEditor, true);
30 next();
32 return innerDumpAndNext;
35 var testSuite = [
36 function testSimpleCollapsedBlockExpanding(next)
38 textEditor.setText(codeSnippetText);
39 InspectorTest.setLineSelections(textEditor, [
40 {line: 0, column: 1}
41 ]);
42 InspectorTest.fakeKeyEvent(textEditor, "enter", [], dumpAndNext(next));
45 function testMulticursorCollapsedBlockExpanding(next)
47 textEditor.setText(codeSnippetText);
48 InspectorTest.setLineSelections(textEditor, [
49 {line: 0, column: 1},
50 {line: 0, column: 4},
51 {line: 1, column: 3}
52 ]);
53 InspectorTest.fakeKeyEvent(textEditor, "enter", [], dumpAndNext(next));
56 function testMulticursorCollapsedBlockNotExpanding(next)
58 textEditor.setText(codeSnippetText);
59 InspectorTest.setLineSelections(textEditor, [
60 {line: 0, column: 1},
61 {line: 1, column: 2}
62 ]);
63 InspectorTest.fakeKeyEvent(textEditor, "enter", [], dumpAndNext(next));
66 function testSingleCursorClosingBracketIndent(next)
68 textEditor.setText(codeSnippetText);
69 InspectorTest.setLineSelections(textEditor, [
70 {line: 3, column: 0}
71 ]);
72 InspectorTest.fakeKeyEvent(textEditor, "}", [], dumpAndNext(next));
75 function testMulticursorClosingBracketIndent(next)
77 textEditor.setText(codeSnippetText);
78 InspectorTest.setLineSelections(textEditor, [
79 {line: 3, column: 5},
80 {line: 5, column: 9}
81 ]);
82 InspectorTest.fakeKeyEvent(textEditor, "}", [], dumpAndNext(next));
85 function testMulticursorClosingBracketIndentNotExecuted(next)
87 textEditor.setText(codeSnippetText);
88 InspectorTest.setLineSelections(textEditor, [
89 {line: 3, column: 5},
90 {line: 4, column: 5}
91 ]);
92 InspectorTest.fakeKeyEvent(textEditor, "}", [], dumpAndNext(next));
97 </script>
98 </head>
100 <body onload="runTest();">
102 This test verifies applied indentation whenever you hit enter in "{|}" or type in "}" while inside opened block.
103 </p>
105 <pre id="codeSnippet">
106 {} {}
112 </pre>
114 </body>
115 </html>