Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / editor / text-editor-enter-behaviour.html
blob7e4135f21fe1d11353527cb45ce230937a82bbf9
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 function testFunction()
14 var a = 100;
15 var b = 200;
16 var c = (a + b) / 2;
17 console.log(a);
18 console.log(b);
19 console.log(c);
20 if (a > b) {
21 console.log(a);
23 return c;
25 var textEditor = InspectorTest.createTestEditor();
26 textEditor.setMimeType("text/javascript");
27 textEditor.setReadOnly(false);
28 textEditor.element.focus();
30 InspectorTest.runTestSuite([
31 function testEnterInTheLineEnd(next)
33 textEditor.setText(testFunction.toString());
34 var line = textEditor.line(2);
35 textEditor.setSelection(WebInspector.TextRange.createFromLocation(2, line.length));
36 hitEnterDumpTextAndNext(next);
39 function testEnterAfterOpenCurlyBrace(next)
41 textEditor.setText(testFunction.toString());
42 var line = textEditor.line(1);
43 textEditor.setSelection(WebInspector.TextRange.createFromLocation(1, line.length));
44 hitEnterDumpTextAndNext(next);
47 function testEnterInTheMiddleOfLine(next)
49 textEditor.setText(testFunction.toString());
50 var line = textEditor.line(2);
51 textEditor.setSelection(WebInspector.TextRange.createFromLocation(2, line.length / 2));
52 hitEnterDumpTextAndNext(next);
55 function testEnterInTheBeginningOfTheLine(next)
57 textEditor.setText(testFunction.toString());
58 textEditor.setSelection(WebInspector.TextRange.createFromLocation(2, 0));
59 hitEnterDumpTextAndNext(next);
62 function testEnterWithTheSelection(next)
64 textEditor.setText(testFunction.toString());
65 textEditor.setSelection(new WebInspector.TextRange(2, 2, 2, 4));
66 hitEnterDumpTextAndNext(next);
69 function testEnterWithReversedSelection(next)
71 textEditor.setText(testFunction.toString());
72 textEditor.setSelection(new WebInspector.TextRange(2, 4, 2, 2));
73 hitEnterDumpTextAndNext(next);
76 function testEnterWithTheMultiLineSelection(next)
78 textEditor.setText(testFunction.toString());
79 textEditor.setSelection(new WebInspector.TextRange(2, 0, 8, 4));
80 hitEnterDumpTextAndNext(next);
83 function testEnterWithFullLineSelection(next)
85 textEditor.setText(testFunction.toString());
86 textEditor.setSelection(new WebInspector.TextRange(2, 0, 3, 0));
87 hitEnterDumpTextAndNext(next);
90 function testEnterBeforeOpenBrace(next)
92 textEditor.setText(testFunction.toString());
93 textEditor.setSelection(new WebInspector.TextRange(8, 0, 8, 0));
94 hitEnterDumpTextAndNext(next);
97 function testEnterMultiCursor(next)
99 textEditor.setText(testFunction.toString());
100 InspectorTest.setLineSelections(textEditor, [
101 { line: 3, column: 0 },
102 { line: 5, column: 1 },
103 { line: 6, column: 2 },
105 hitEnterDumpTextAndNext(next);
109 function hitEnterDumpTextAndNext(next)
111 InspectorTest.fakeKeyEvent(textEditor, "enter", null, step2);
112 function step2()
114 InspectorTest.dumpTextWithSelection(textEditor, true);
115 next();
120 </script>
121 </head>
123 <body onload="runTest();">
125 This test checks text editor enter behaviour.
126 </p>
127 </body>
128 </html>