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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/editor/editor-test.js

Issue 2080603008: DevTools: allow codemirror softundo to work on readonly files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing test for preserving readOnly Created 4 years, 6 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
OLDNEW
1 function initialize_EditorTests() 1 function initialize_EditorTests()
2 { 2 {
3 3
4 InspectorTest.createTestEditor = function(clientHeight, textEditorDelegate) 4 InspectorTest.createTestEditor = function(clientHeight, textEditorDelegate)
5 { 5 {
6 var textEditor = new WebInspector.CodeMirrorTextEditor("", textEditorDelegat e || new WebInspector.TextEditorDelegate()); 6 var textEditor = new WebInspector.CodeMirrorTextEditor("", textEditorDelegat e || new WebInspector.TextEditorDelegate());
7 clientHeight = clientHeight || 100; 7 clientHeight = clientHeight || 100;
8 textEditor.element.style.height = clientHeight + "px"; 8 textEditor.element.style.height = clientHeight + "px";
9 textEditor.element.style.flex = "none"; 9 textEditor.element.style.flex = "none";
10 textEditor.show(WebInspector.inspectorView.element); 10 textEditor.show(WebInspector.inspectorView.element);
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 function fakeCodeMirrorInputEvent(editor, character) 138 function fakeCodeMirrorInputEvent(editor, character)
139 { 139 {
140 if (typeof character === "string") 140 if (typeof character === "string")
141 editor._codeMirror.display.input.value += character; 141 editor._codeMirror.display.input.value += character;
142 } 142 }
143 143
144 InspectorTest.fakeKeyEvent = function(editor, originalCode, modifiers, callback) 144 InspectorTest.fakeKeyEvent = function(editor, originalCode, modifiers, callback)
145 { 145 {
146 modifiers = modifiers || []; 146 modifiers = modifiers || [];
147 callback = callback || function() {};
147 var code; 148 var code;
148 var charCode; 149 var charCode;
149 if (originalCode === "'") { 150 if (originalCode === "'") {
150 code = 222; 151 code = 222;
151 charCode = 0; 152 charCode = 0;
152 } else if (originalCode === "\"") { 153 } else if (originalCode === "\"") {
153 code = 222; 154 code = 222;
154 modifiers.push("shiftKey"); 155 modifiers.push("shiftKey");
155 charCode = 34; 156 charCode = 34;
156 } else if (originalCode === "(") { 157 } else if (originalCode === "(") {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 var keyName = sortedKeys[i]; 200 var keyName = sortedKeys[i];
200 if (!keyName.length) 201 if (!keyName.length)
201 keyName = "<Empty string>"; 202 keyName = "<Empty string>";
202 else 203 else
203 keyName = "'" + keyName + "'"; 204 keyName = "'" + keyName + "'";
204 InspectorTest.addResult(keyName + ": " + listHashMap[sortedKeys[i]]); 205 InspectorTest.addResult(keyName + ": " + listHashMap[sortedKeys[i]]);
205 } 206 }
206 } 207 }
207 208
208 } 209 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698