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

Side by Side Diff: LayoutTests/inspector/jump-to-previous-editing-location.html

Issue 298723005: DevTools: even more logging for jump-to-previous-editing-location.html test (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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/jump-to-previous-editing-location-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
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../http/tests/inspector/inspector-test.js"></script> 3 <script src="../http/tests/inspector/inspector-test.js"></script>
4 <script src="../http/tests/inspector/workspace-test.js"></script> 4 <script src="../http/tests/inspector/workspace-test.js"></script>
5 <script src="../http/tests/inspector/debugger-test.js"></script> 5 <script src="../http/tests/inspector/debugger-test.js"></script>
6 <script src="resources/example-fileset-for-test.js"></script> 6 <script src="resources/example-fileset-for-test.js"></script>
7 <script src="editor/editor-test.js"></script> 7 <script src="editor/editor-test.js"></script>
8 <script> 8 <script>
9 function test() 9 function test()
10 { 10 {
11 WebInspector.inspectorView.showPanel("sources"); 11 WebInspector.inspectorView.showPanel("sources");
12 var panel = WebInspector.panels.sources; 12 var panel = WebInspector.panels.sources;
13 var sourcesView = panel._sourcesView; 13 var sourcesView = panel._sourcesView;
14 var historyManager = sourcesView._historyManager; 14 var historyManager = sourcesView._historyManager;
15 var editorContainer = sourcesView._editorContainer; 15 var editorContainer = sourcesView._editorContainer;
16 InspectorTest.addSniffer(historyManager._historyManager, "filterOut", functi on() { 16 var shouldLogSimpleHistoryManager = false;
17 InspectorTest.addResult("executed SimpleHistoryManager.filterOut; active EntryIndex = " + historyManager._historyManager._activeEntryIndex); 17
18 }, true); 18 function logSimpleHistoryManagerMethod(methodName)
19 {
20 if (!shouldLogSimpleHistoryManager)
21 return;
22 InspectorTest.addResult("SimpleHistoryManager." + methodName + " size: " + historyManager._historyManager._entries.length + " active: " + historyManager ._historyManager._activeEntryIndex);
23 }
24 InspectorTest.addSniffer(WebInspector.SimpleHistoryManager.prototype, "push" , logSimpleHistoryManagerMethod.bind(null, "push"), true);
25 InspectorTest.addSniffer(WebInspector.SimpleHistoryManager.prototype, "activ e", logSimpleHistoryManagerMethod.bind(null, "active"), true);
26 InspectorTest.addSniffer(WebInspector.SimpleHistoryManager.prototype, "rollb ack", logSimpleHistoryManagerMethod.bind(null, "rollback"), true);
27 InspectorTest.addSniffer(WebInspector.SimpleHistoryManager.prototype, "rollo ver", logSimpleHistoryManagerMethod.bind(null, "rollover"), true);
28 InspectorTest.addSniffer(WebInspector.SimpleHistoryManager.prototype, "filte rOut", logSimpleHistoryManagerMethod.bind(null, "filterOut"), true);
19 29
20 function rollback() 30 function rollback()
21 { 31 {
22 historyManager.rollback(); 32 historyManager.rollback();
23 } 33 }
24 34
25 function rollover() 35 function rollover()
26 { 36 {
27 historyManager.rollover(); 37 historyManager.rollover();
28 } 38 }
(...skipping 14 matching lines...) Expand all
43 function eventSenderClickAtEditor(editor, lineNumber, columnNumber) 53 function eventSenderClickAtEditor(editor, lineNumber, columnNumber)
44 { 54 {
45 editor.scrollToLine(lineNumber); 55 editor.scrollToLine(lineNumber);
46 var coordinates = editor.cursorPositionToCoordinates(lineNumber, columnN umber); 56 var coordinates = editor.cursorPositionToCoordinates(lineNumber, columnN umber);
47 eventSender.mouseMoveTo(coordinates.x, coordinates.y); 57 eventSender.mouseMoveTo(coordinates.x, coordinates.y);
48 eventSender.mouseDown(); 58 eventSender.mouseDown();
49 eventSender.mouseUp(); 59 eventSender.mouseUp();
50 dumpSelection(editor, "Mouse click (" + lineNumber + ", " + columnNumber + ")"); 60 dumpSelection(editor, "Mouse click (" + lineNumber + ", " + columnNumber + ")");
51 } 61 }
52 62
53 function clickAndDump(editor, lines, columns) 63 function clickAndDump(editor, lines, columns, logLocation)
54 { 64 {
55 for (var i = 0; i < lines.length; ++i) { 65 for (var i = 0; i < lines.length; ++i) {
56 var lineNumber = lines[i]; 66 var lineNumber = lines[i];
57 var columnNumber = columns[i]; 67 var columnNumber = columns[i];
58 var originSelection = editor.selection(); 68 var originSelection = editor.selection();
59 editor.setSelection(WebInspector.TextRange.createFromLocation(lineNu mber, columnNumber)); 69 editor.setSelection(WebInspector.TextRange.createFromLocation(lineNu mber, columnNumber));
60 editor._delegate.onJumpToPosition(originSelection, editor.selection( )); 70 editor._delegate.onJumpToPosition(originSelection, editor.selection( ));
61 dumpSelection(editor, "Mouse click (" + lineNumber + ", " + columnNu mber + ")"); 71 dumpSelection(editor, "Mouse click (" + lineNumber + ", " + columnNu mber + ")");
62 } 72 }
63 } 73 }
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 var lines = []; 207 var lines = [];
198 var columns = []; 208 var columns = [];
199 const jumpsAmount = WebInspector.EditingLocationHistoryManager.Histo ryDepth; 209 const jumpsAmount = WebInspector.EditingLocationHistoryManager.Histo ryDepth;
200 for(var i = 0; i < jumpsAmount; ++i) { 210 for(var i = 0; i < jumpsAmount; ++i) {
201 lines.push(i + 10); 211 lines.push(i + 10);
202 columns.push(7); 212 columns.push(7);
203 } 213 }
204 var editor = panel.visibleView.textEditor; 214 var editor = panel.visibleView.textEditor;
205 //FIXME(lushnikov): here and below excessive dumping to figure out a reason for 215 //FIXME(lushnikov): here and below excessive dumping to figure out a reason for
206 // unreproducible bot failures. 216 // unreproducible bot failures.
217 shouldLogSimpleHistoryManager = true;
207 dumpSimpleHistoryManagerState("before filling history stack"); 218 dumpSimpleHistoryManagerState("before filling history stack");
208 clickAndDump(editor, lines, columns); 219 clickAndDump(editor, lines, columns, true);
209 dumpSimpleHistoryManagerState("after filling history stack"); 220 dumpSimpleHistoryManagerState("after filling history stack");
210 221
211 InspectorTest.addResult("First rollback result: " + historyManager._ historyManager.rollback()); 222 InspectorTest.addResult("First rollback result: " + historyManager._ historyManager.rollback());
212 dumpSimpleHistoryManagerState("after first rollback"); 223 dumpSimpleHistoryManagerState("after first rollback");
213 dumpSelection(editor, "Rolled back"); 224 dumpSelection(editor, "Rolled back");
225 shouldLogSimpleHistoryManager = false;
214 226
215 for (var i = 0; i < jumpsAmount - 1; ++i) { 227 for (var i = 0; i < jumpsAmount - 1; ++i) {
216 rollback(); 228 rollback();
217 dumpSelection(editor, "Rolled back"); 229 dumpSelection(editor, "Rolled back");
218 } 230 }
219 next(); 231 next();
220 }, 232 },
221 233
222 function testInFileSearch(next) 234 function testInFileSearch(next)
223 { 235 {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 } 295 }
284 } 296 }
285 ]); 297 ]);
286 }; 298 };
287 </script> 299 </script>
288 </head> 300 </head>
289 <body onload="runTest()"> 301 <body onload="runTest()">
290 <p>Tests that jumping to previous location works as intended.</p> 302 <p>Tests that jumping to previous location works as intended.</p>
291 </body> 303 </body>
292 </html> 304 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector/jump-to-previous-editing-location-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698