Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(812)

Side by Side Diff: LayoutTests/inspector/editor/text-editor-auto-whitespace-removing.html

Issue 402433007: DevTools: [CodeMirror] remove auto-inserted whitespaces (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaseline inspector/editor/text-editor-formatter.html Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/inspector/editor/text-editor-auto-whitespace-removing-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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;
8 }
9
10 function test() {
11 var textEditor = InspectorTest.createTestEditor();
12 textEditor.setMimeType("text/javascript");
13 textEditor.setReadOnly(false);
14 textEditor.element.focus();
15 InspectorTest.evaluateInPage("codeSnippet();", onCodeSnippet);
16 var codeSnippetText;
17
18 function onCodeSnippet(result)
19 {
20 codeSnippetText = result.value;
21 InspectorTest.runTestSuite(testSuite);
22 }
23
24 function dumpAndNext(next)
25 {
26 function innerDumpAndNext()
27 {
28 InspectorTest.dumpTextWithSelection(textEditor, true);
29 next();
30 }
31 return innerDumpAndNext;
32 }
33
34 function doubleEnter(next)
35 {
36 function onFirstEnter()
37 {
38 InspectorTest.fakeKeyEvent(textEditor, "enter", [], dumpAndNext(next ));
39 }
40
41 InspectorTest.fakeKeyEvent(textEditor, "enter", [], onFirstEnter);
42 }
43
44 var testSuite = [
45 function testCollapsedBlock(next)
46 {
47 textEditor.setText(codeSnippetText);
48 InspectorTest.setLineSelections(textEditor, [
49 {line: 0, column: 12}
50 ]);
51 doubleEnter(next);
52 },
53
54 function testOpenCurlyBrace(next)
55 {
56 textEditor.setText(codeSnippetText);
57 InspectorTest.setLineSelections(textEditor, [
58 {line: 1, column: 17}
59 ]);
60 doubleEnter(next);
61 },
62
63 function testSmartIndent(next)
64 {
65 textEditor.setText(codeSnippetText);
66 InspectorTest.setLineSelections(textEditor, [
67 {line: 1, column: 2}
68 ]);
69 doubleEnter(next);
70 },
71
72 function testMultiCursorSelection(next)
73 {
74 textEditor.setText(codeSnippetText);
75 InspectorTest.setLineSelections(textEditor, [
76 {line: 1, column: 2},
77 {line: 1, column: 4}
78 ]);
79 doubleEnter(next);
80 },
81
82 function testEditedAutoIndent(next)
83 {
84 textEditor.setText(codeSnippetText);
85 InspectorTest.setLineSelections(textEditor, [
86 {line: 1, column: 17}
87 ]);
88 InspectorTest.fakeKeyEvent(textEditor, "enter", [], onEnter);
89
90 function onEnter()
91 {
92 InspectorTest.fakeKeyEvent(textEditor, "W", [], onEditedText);
93 }
94
95 function onEditedText()
96 {
97 InspectorTest.fakeKeyEvent(textEditor, "enter", [], dumpAndNext( next));
98 }
99 },
100 ];
101 }
102
103 </script>
104 </head>
105
106 <body onload="runTest();">
107 <p>
108 This test verifies that auto-appended spaces are removed on consequent enters.
109 </p>
110
111 <pre id="codeSnippet">
112 function (){}
113 if (a == b) {
114 </pre>
115
116 </body>
117 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector/editor/text-editor-auto-whitespace-removing-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698