OLD | NEW |
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 { |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 } | 170 } |
171 for (var i = 0; i < 3; ++i) { | 171 for (var i = 0; i < 3; ++i) { |
172 rollover(); | 172 rollover(); |
173 dumpSelection(panel.visibleView.textEditor, "Rolled over"); | 173 dumpSelection(panel.visibleView.textEditor, "Rolled over"); |
174 } | 174 } |
175 next(); | 175 next(); |
176 }, | 176 }, |
177 | 177 |
178 function testHistoryDepth(next) | 178 function testHistoryDepth(next) |
179 { | 179 { |
| 180 function dumpSimpleHistoryManagerState(title) |
| 181 { |
| 182 var simpleHistoryManager = historyManager._historyManager; |
| 183 var entries = simpleHistoryManager._entries; |
| 184 InspectorTest.addResult("=== SimpleHistoryManager state " + titl
e + " ==="); |
| 185 InspectorTest.addResult("entries count: " + entries.length); |
| 186 for (var i = entries.length - 1; i >= 0; --i) { |
| 187 var position = entries[i]._positionHandle.resolve(); |
| 188 var positionText = position ? "{line: " + position.lineNumbe
r + ", column: " + position.columnNumber + "}" : position + ""; |
| 189 var positionMarker = simpleHistoryManager._activeEntryIndex
=== i ? ">" : " "; |
| 190 InspectorTest.addResult(positionMarker + "entry[" + i + "] =
" + positionText); |
| 191 } |
| 192 InspectorTest.addResult("=== ==="); |
| 193 } |
180 var lines = []; | 194 var lines = []; |
181 var columns = []; | 195 var columns = []; |
182 const jumpsAmount = WebInspector.EditingLocationHistoryManager.Histo
ryDepth; | 196 const jumpsAmount = WebInspector.EditingLocationHistoryManager.Histo
ryDepth; |
183 for(var i = 0; i < jumpsAmount; ++i) { | 197 for(var i = 0; i < jumpsAmount; ++i) { |
184 lines.push(i + 10); | 198 lines.push(i + 10); |
185 columns.push(7); | 199 columns.push(7); |
186 } | 200 } |
187 var editor = panel.visibleView.textEditor; | 201 var editor = panel.visibleView.textEditor; |
| 202 //FIXME(lushnikov): here and below excessive dumping to figure out a
reason for |
| 203 // unreproducible bot failures. |
| 204 dumpSimpleHistoryManagerState("before filling history stack"); |
188 clickAndDump(editor, lines, columns); | 205 clickAndDump(editor, lines, columns); |
189 for (var i = 0; i < jumpsAmount; ++i) { | 206 dumpSimpleHistoryManagerState("after filling history stack"); |
| 207 |
| 208 InspectorTest.addResult("First rollback result: " + historyManager._
historyManager.rollback()); |
| 209 dumpSimpleHistoryManagerState("after first rollback"); |
| 210 dumpSelection(editor, "Rolled back"); |
| 211 |
| 212 for (var i = 0; i < jumpsAmount - 1; ++i) { |
190 rollback(); | 213 rollback(); |
191 dumpSelection(editor, "Rolled back"); | 214 dumpSelection(editor, "Rolled back"); |
192 } | 215 } |
193 next(); | 216 next(); |
194 }, | 217 }, |
195 | 218 |
196 function testInFileSearch(next) | 219 function testInFileSearch(next) |
197 { | 220 { |
198 var searchableView = panel.searchableView(); | 221 var searchableView = panel.searchableView(); |
199 | 222 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 } | 280 } |
258 } | 281 } |
259 ]); | 282 ]); |
260 }; | 283 }; |
261 </script> | 284 </script> |
262 </head> | 285 </head> |
263 <body onload="runTest()"> | 286 <body onload="runTest()"> |
264 <p>Tests that jumping to previous location works as intended.</p> | 287 <p>Tests that jumping to previous location works as intended.</p> |
265 </body> | 288 </body> |
266 </html> | 289 </html> |
OLD | NEW |