| 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 }; | 251 }; |
| 252 } | 252 } |
| 253 charCount += length; | 253 charCount += length; |
| 254 } | 254 } |
| 255 return null; | 255 return null; |
| 256 } | 256 } |
| 257 | 257 |
| 258 function selectMessages(fromMessage, fromTextOffset, toMessage, toTextOffset
) | 258 function selectMessages(fromMessage, fromTextOffset, toMessage, toTextOffset
) |
| 259 { | 259 { |
| 260 if (Math.abs(toMessage - fromMessage) > minimumViewportMessagesCount) { | 260 if (Math.abs(toMessage - fromMessage) > minimumViewportMessagesCount) { |
| 261 InspectorTest.addResult(String.sprintf("FAILURE: Cannot select more
then %d messages (requested to select from %d to %d", minimumViewportMessagesCou
nt, fromMessage, toMessage)); | 261 InspectorTest.addResult(String.sprintf("FAILURE: Cannot select more
than %d messages (requested to select from %d to %d", minimumViewportMessagesCou
nt, fromMessage, toMessage)); |
| 262 InspectorTest.completeTest(); | 262 InspectorTest.completeTest(); |
| 263 return; | 263 return; |
| 264 } | 264 } |
| 265 viewport.forceScrollItemToBeFirst(Math.min(fromMessage, toMessage)); | 265 viewport.forceScrollItemToBeFirst(Math.min(fromMessage, toMessage)); |
| 266 | 266 |
| 267 var from = selectionContainerAndOffset(consoleView.itemElement(fromMessa
ge).element(), fromTextOffset); | 267 var from = selectionContainerAndOffset(consoleView.itemElement(fromMessa
ge).element(), fromTextOffset); |
| 268 var to = selectionContainerAndOffset(consoleView.itemElement(toMessage).
element(), toTextOffset); | 268 var to = selectionContainerAndOffset(consoleView.itemElement(toMessage).
element(), toTextOffset); |
| 269 window.getSelection().setBaseAndExtent(from.container, from.offset, to.c
ontainer, to.offset); | 269 window.getSelection().setBaseAndExtent(from.container, from.offset, to.c
ontainer, to.offset); |
| 270 viewport._innerRefresh(true); | 270 viewport._innerRefresh(true); |
| 271 } | 271 } |
| 272 } | 272 } |
| 273 </script> | 273 </script> |
| 274 </head> | 274 </head> |
| 275 <body onload="runTest()"> | 275 <body onload="runTest()"> |
| 276 <p> | 276 <p> |
| 277 Tests that console viewport handles selection properly. | 277 Tests that console viewport handles selection properly. |
| 278 </p> | 278 </p> |
| 279 </body> | 279 </body> |
| 280 </html> | 280 </html> |
| OLD | NEW |