| <html> |
| <head> |
| <script src="../http/tests/inspector/inspector-test.js"></script> |
| <script src="../http/tests/inspector/sources-test.js"></script> |
| <script>function dummy1() { } |
| //# sourceURL=http://test/helloWorld12.js |
| </script> |
| <script>function dummy2() { } |
| //# sourceURL=http://test/some/very-long-url/which/usually/breaks-rendering/due-to/trancation/so/that/the-path-is-cut-appropriately/and-no-horizontal-scrollbars/are-shown.js |
| </script> |
| <script> |
| function test() |
| { |
| var delegate = new WebInspector.FilteredUISourceCodeListDelegate(); |
| delegate.populate(); |
| |
| InspectorTest.runTestSuite([ |
| function testRenderingInNameOnly(next) |
| { |
| checkQuery("12"); |
| next(); |
| }, |
| |
| function testRenderingInPathAndName(next) |
| { |
| checkQuery("te12"); |
| next(); |
| }, |
| |
| function testRenderingInNameInTruncatedPath(next) |
| { |
| checkQuery("shown.js"); |
| next(); |
| }, |
| |
| function testRenderingInTruncatedPath(next) |
| { |
| checkQuery("usually-shown.js"); |
| next(); |
| }, |
| ]); |
| |
| function checkQuery(query) |
| { |
| InspectorTest.addResult("filter query: " + query); |
| var titleElement = document.createElement("div"); |
| var subtitleElement = document.createElement("div"); |
| var outputs = []; |
| for (var i = 0; i < delegate.itemCount(); ++i) { |
| delegate.renderItem(i, query, titleElement, subtitleElement); |
| if (!subtitleElement.textContent.startsWith("test")) |
| continue; |
| var text = elementHighlightedText(titleElement); |
| text += "\n" + elementHighlightedText(subtitleElement); |
| outputs.push(text); |
| } |
| outputs.sort(); |
| InspectorTest.addResult(outputs.join("\n--------------------\n")); |
| } |
| |
| function elementHighlightedText(element) |
| { |
| var text = ""; |
| for (var i = 0; i < element.childNodes.length; ++i) { |
| var node = element.childNodes[i]; |
| if (node.nodeType === Node.TEXT_NODE) |
| text += node.textContent; |
| else |
| text += String.sprintf("[%s]", node.textContent); |
| } |
| return text; |
| } |
| } |
| </script> |
| </head> |
| |
| <body onload="runTest()"> |
| <p> |
| Verifies that SelectUISourceCodeDialog rendering works properly. |
| </p> |
| |
| </body> |
| </html> |