| 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() | 6 function populateConsoleWithMessages() |
| 7 { | 7 { |
| 8 console.log("FIRST MATCH, SECOND MATCH"); | 8 console.log("FIRST MATCH, SECOND MATCH"); |
| 9 for (var i = 0; i < 200; ++i) | 9 for (var i = 0; i < 200; ++i) |
| 10 console.log("Message #" + i); | 10 console.log("Message #" + i); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 consoleView._searchableView.showSearchField(); | 36 consoleView._searchableView.showSearchField(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 function matchesText() | 39 function matchesText() |
| 40 { | 40 { |
| 41 return consoleView._searchableView.contentElement.querySelector(".search
-results-matches").textContent; | 41 return consoleView._searchableView.contentElement.querySelector(".search
-results-matches").textContent; |
| 42 } | 42 } |
| 43 | 43 |
| 44 function dumpMatches() | 44 function dumpMatches() |
| 45 { | 45 { |
| 46 var matches = document.querySelectorAll("html /deep/ .highlighted-search
-result"); | 46 var matches = consoleView.element.childTextNodes().filter(node => node.p
arentElement.classList.contains("highlighted-search-result")).map(node => node.p
arentElement); |
| 47 addResult("number of visible matches: " + matches.length); | 47 addResult("number of visible matches: " + matches.length); |
| 48 for (var i = 0; i < matches.length; ++i) | 48 for (var i = 0; i < matches.length; ++i) |
| 49 addResult(" match " + i + ": " + matches[i].className); | 49 addResult(" match " + i + ": " + matches[i].className); |
| 50 addResult(""); | 50 addResult(""); |
| 51 } | 51 } |
| 52 | 52 |
| 53 var consoleView = Console.ConsoleView.instance(); | 53 var consoleView = Console.ConsoleView.instance(); |
| 54 var viewport = consoleView._viewport; | 54 var viewport = consoleView._viewport; |
| 55 const maximumViewportMessagesCount = 150; | 55 const maximumViewportMessagesCount = 150; |
| 56 InspectorTest.runTestSuite([ | 56 InspectorTest.runTestSuite([ |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 157 |
| 158 next(); | 158 next(); |
| 159 }); | 159 }); |
| 160 }, | 160 }, |
| 161 | 161 |
| 162 function testCanJumpForwardBetweenTreeElementMatches(next) | 162 function testCanJumpForwardBetweenTreeElementMatches(next) |
| 163 { | 163 { |
| 164 function dumpElements(callback) | 164 function dumpElements(callback) |
| 165 { | 165 { |
| 166 consoleView._searchableView.handleFindNextShortcut(); | 166 consoleView._searchableView.handleFindNextShortcut(); |
| 167 var currentResultElem = document.querySelector("html /deep/ .cur
rent-search-result"); | 167 var currentResultElem = consoleView.element.childTextNodes().fil
ter(node => node.parentElement.classList.contains("current-search-result"))[0]; |
| 168 addResult("matched tree element: " + currentResultElem.innerHTML
); | 168 addResult("matched tree element: " + currentResultElem.textConte
nt); |
| 169 callback(); | 169 callback(); |
| 170 } | 170 } |
| 171 | 171 |
| 172 function searchField1(callback) | 172 function searchField1(callback) |
| 173 { | 173 { |
| 174 // Find first match. | 174 // Find first match. |
| 175 setQuery("field_1", false, false, dumpElements.bind(null, callba
ck)); | 175 setQuery("field_1", false, false, dumpElements.bind(null, callba
ck)); |
| 176 } | 176 } |
| 177 | 177 |
| 178 function searchField199(callback) | 178 function searchField199(callback) |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 ]); | 232 ]); |
| 233 } | 233 } |
| 234 </script> | 234 </script> |
| 235 </head> | 235 </head> |
| 236 <body onload="populateConsoleWithMessages()"> | 236 <body onload="populateConsoleWithMessages()"> |
| 237 <p> | 237 <p> |
| 238 Tests console search. | 238 Tests console search. |
| 239 </p> | 239 </p> |
| 240 </body> | 240 </body> |
| 241 </html> | 241 </html> |
| OLD | NEW |