OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/console-test.js"></script> |
| 5 <script> |
| 6 function populateConsoleWithMessages() |
| 7 { |
| 8 console.dir(window); |
| 9 runTest(); |
| 10 } |
| 11 |
| 12 function test() |
| 13 { |
| 14 function addResult(result) |
| 15 { |
| 16 viewport.refresh(); |
| 17 InspectorTest.addResult(result); |
| 18 } |
| 19 |
| 20 // Make sure to produce test output in case test times out |
| 21 setTimeout(InspectorTest.completeTest.bind(InspectorTest), 2000); |
| 22 |
| 23 var consoleView = WebInspector.ConsolePanel._view(); |
| 24 var viewport = consoleView._viewport; |
| 25 const maximumViewportMessagesCount = 150; |
| 26 InspectorTest.runTestSuite([ |
| 27 function assertViewportHeight(next) |
| 28 { |
| 29 viewport.invalidate(); |
| 30 var viewportMessagesCount = viewport._lastVisibleIndex - viewport._f
irstVisibleIndex; |
| 31 if (viewportMessagesCount > maximumViewportMessagesCount) { |
| 32 InspectorTest.addResult(String.sprintf( |
| 33 "Test cannot be run because viewport can fit %d messages, wh
ile %d is the test's maximum.", |
| 34 viewportMessagesCount, maximumViewportMessagesCount)); |
| 35 InspectorTest.completeTest(); |
| 36 return; |
| 37 } |
| 38 next(); |
| 39 }, |
| 40 |
| 41 function scrollConsoleToTop(next) |
| 42 { |
| 43 viewport.forceScrollItemToBeFirst(0); |
| 44 addResult("first visible message index: " + viewport.firstVisibleInd
ex()); |
| 45 next(); |
| 46 }, |
| 47 |
| 48 function testFindMatches(next) |
| 49 { |
| 50 InspectorTest.expandConsoleMessages(function() |
| 51 { |
| 52 consoleView._searchableView._searchInputElement.value = "HTML"; |
| 53 consoleView._searchableView.showSearchField(); |
| 54 |
| 55 // Find first match |
| 56 consoleView._searchableView.handleFindNextShortcut(); |
| 57 // XXX: How to output currently matched tree element? |
| 58 |
| 59 // Find second match |
| 60 consoleView._searchableView.handleFindNextShortcut(); |
| 61 // XXX: How to output currently matched tree element? |
| 62 |
| 63 next(); |
| 64 }); |
| 65 } |
| 66 ]); |
| 67 } |
| 68 </script> |
| 69 </head> |
| 70 <body onload="populateConsoleWithMessages()"> |
| 71 <p> |
| 72 Tests that console can jump forward between search matches in tree elements. |
| 73 </p> |
| 74 </body> |
| 75 </html> |
OLD | NEW |