| 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/console-test.js"></script> | 4 <script src="../../http/tests/inspector/console-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 function populateConsoleWithMessages(count) | 6 function populateConsoleWithMessages(count) |
| 7 { | 7 { |
| 8 for (var i = 0; i < count - 1; ++i) | 8 for (var i = 0; i < count - 1; ++i) |
| 9 console.log("Message #" + i); | 9 console.log("Message #" + i); |
| 10 console.log("hello %cworld", "color: blue"); | 10 console.log("hello %cworld", "color: blue"); |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 viewport.refresh(); | 214 viewport.refresh(); |
| 215 var text = viewport._selectedText(); | 215 var text = viewport._selectedText(); |
| 216 InspectorTest.addResult("Selected text:<<<EOL\n" + text + "\nEOL"); | 216 InspectorTest.addResult("Selected text:<<<EOL\n" + text + "\nEOL"); |
| 217 } | 217 } |
| 218 | 218 |
| 219 function dumpViewportRenderedItems() | 219 function dumpViewportRenderedItems() |
| 220 { | 220 { |
| 221 viewport.refresh(); | 221 viewport.refresh(); |
| 222 var firstVisibleIndex = viewport.firstVisibleIndex(); | 222 var firstVisibleIndex = viewport.firstVisibleIndex(); |
| 223 var lastVisibleIndex = viewport.lastVisibleIndex(); | 223 var lastVisibleIndex = viewport.lastVisibleIndex(); |
| 224 var renderedEnoughElements = viewportMessagesCount <= lastVisibleIndex -
firstVisibleIndex + 1; | 224 InspectorTest.addResult("first visible message index: " + firstVisibleIn
dex); |
| 225 InspectorTest.addResult("first visible message index: " + firstVisibleIn
dex + " viewport is covered: " + (renderedEnoughElements ? "YES" : "NO")); | |
| 226 } | 225 } |
| 227 | 226 |
| 228 function emulateShiftClickOnMessage(messageIndex) | 227 function emulateShiftClickOnMessage(messageIndex) |
| 229 { | 228 { |
| 230 viewport.refresh(); | 229 viewport.refresh(); |
| 231 var selection = window.getSelection(); | 230 var selection = window.getSelection(); |
| 232 if (!selection || !selection.rangeCount) { | 231 if (!selection || !selection.rangeCount) { |
| 233 InspectorTest.addResult("FAILURE: There's no selection"); | 232 InspectorTest.addResult("FAILURE: There's no selection"); |
| 234 return; | 233 return; |
| 235 } | 234 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 } | 271 } |
| 273 } | 272 } |
| 274 </script> | 273 </script> |
| 275 </head> | 274 </head> |
| 276 <body onload="runTest()"> | 275 <body onload="runTest()"> |
| 277 <p> | 276 <p> |
| 278 Tests that console viewport handles selection properly. | 277 Tests that console viewport handles selection properly. |
| 279 </p> | 278 </p> |
| 280 </body> | 279 </body> |
| 281 </html> | 280 </html> |
| OLD | NEW |