Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / editor / text-editor-goto-matching-bracket.html
blob0cafde4c9dad7117702b3ae9aea8438a2b7e1cdd
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 testSingleCursorFromOutsideOpenBracket(next)
38 textEditor.setText(codeSnippetText);
39 InspectorTest.setLineSelections(textEditor, [
40 { line: 0, column: 16 }
41 ]);
42 InspectorTest.fakeKeyEvent(textEditor, "M", ["ctrlKey"], dumpAndNext(next));
45 function testSingleCursorFromInsideOpenBracket(next)
47 textEditor.setText(codeSnippetText);
48 InspectorTest.setLineSelections(textEditor, [
49 { line: 0, column: 17 }
50 ]);
51 InspectorTest.fakeKeyEvent(textEditor, "M", ["ctrlKey"], dumpAndNext(next));
54 function testSingleCursorFromOutsideCloseBracket(next)
56 textEditor.setText(codeSnippetText);
57 InspectorTest.setLineSelections(textEditor, [
58 { line: 3, column: 1 }
59 ]);
60 InspectorTest.fakeKeyEvent(textEditor, "M", ["ctrlKey"], dumpAndNext(next));
63 function testSingleCursorFromInsideCloseBracket(next)
65 textEditor.setText(codeSnippetText);
66 InspectorTest.setLineSelections(textEditor, [
67 { line: 3, column: 0 }
68 ]);
69 InspectorTest.fakeKeyEvent(textEditor, "M", ["ctrlKey"], dumpAndNext(next));
72 function testMulticursor(next)
74 textEditor.setText(codeSnippetText);
75 InspectorTest.setLineSelections(textEditor, [
76 { line: 0, column: 16 },
77 { line: 0, column: 21 },
78 { line: 3, column: 0 },
79 { line: 2, column: 10 }
80 ]);
81 InspectorTest.fakeKeyEvent(textEditor, "M", ["ctrlKey"], dumpAndNext(next));
86 </script>
87 </head>
89 <body onload="runTest();">
90 <p>
91 This test verifies editor's "Goto Matching Bracket" behavior, which is triggered via Ctrl-M shortcut.
92 </p>
94 <pre id="codeSnippet">
95 function MyClass(a, b)
97 console.log("Test");
99 </pre>
101 </body>
102 </html>