| 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/sources-test.js"></script> | 4 <script src="../http/tests/inspector/sources-test.js"></script> |
| 5 <script>function dummy1() { } | 5 <script>function dummy1() { } |
| 6 //# sourceURL=http://test/helloWorld12.js | 6 //# sourceURL=http://test/helloWorld12.js |
| 7 </script> | 7 </script> |
| 8 <script>function dummy2() { } | 8 <script>function dummy2() { } |
| 9 //# 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 | 9 //# 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 |
| 10 </script> | 10 </script> |
| 11 <script> | 11 <script> |
| 12 function test() | 12 function test() |
| 13 { | 13 { |
| 14 setTimeout(InspectorTest.completeTest.bind(InspectorTest), 2000); | |
| 15 | |
| 16 var delegate = new WebInspector.SelectUISourceCodeDialog(); | 14 var delegate = new WebInspector.SelectUISourceCodeDialog(); |
| 17 | 15 |
| 18 InspectorTest.runTestSuite([ | 16 InspectorTest.runTestSuite([ |
| 19 function testRenderingInNameOnly(next) | 17 function testRenderingInNameOnly(next) |
| 20 { | 18 { |
| 21 checkQuery("12"); | 19 checkQuery("12"); |
| 22 next(); | 20 next(); |
| 23 }, | 21 }, |
| 24 | 22 |
| 25 function testRenderingInPathAndName(next) | 23 function testRenderingInPathAndName(next) |
| (...skipping 13 matching lines...) Expand all Loading... |
| 39 checkQuery("usually-shown.js"); | 37 checkQuery("usually-shown.js"); |
| 40 next(); | 38 next(); |
| 41 }, | 39 }, |
| 42 ]); | 40 ]); |
| 43 | 41 |
| 44 function checkQuery(query) | 42 function checkQuery(query) |
| 45 { | 43 { |
| 46 InspectorTest.addResult("filter query: " + query); | 44 InspectorTest.addResult("filter query: " + query); |
| 47 var titleElement = document.createElement("div"); | 45 var titleElement = document.createElement("div"); |
| 48 var subtitleElement = document.createElement("div"); | 46 var subtitleElement = document.createElement("div"); |
| 47 var outputs = []; |
| 49 for (var i = 0; i < delegate.itemCount(); ++i) { | 48 for (var i = 0; i < delegate.itemCount(); ++i) { |
| 50 delegate.renderItem(i, query, titleElement, subtitleElement); | 49 delegate.renderItem(i, query, titleElement, subtitleElement); |
| 51 if (!subtitleElement.textContent.startsWith("test/")) | 50 if (!subtitleElement.textContent.startsWith("test/")) |
| 52 continue; | 51 continue; |
| 53 dumpRenderedElement(titleElement); | 52 var text = elementHighlightedText(titleElement); |
| 54 dumpRenderedElement(subtitleElement); | 53 text += "\n" + elementHighlightedText(subtitleElement); |
| 55 InspectorTest.addResult("--------------------"); | 54 outputs.push(text); |
| 56 } | 55 } |
| 56 outputs.sort(); |
| 57 InspectorTest.addResult(outputs.join("\n--------------------\n")); |
| 57 } | 58 } |
| 58 | 59 |
| 59 function dumpRenderedElement(element) | 60 function elementHighlightedText(element) |
| 60 { | 61 { |
| 61 var text = ""; | 62 var text = ""; |
| 62 for (var i = 0; i < element.childNodes.length; ++i) { | 63 for (var i = 0; i < element.childNodes.length; ++i) { |
| 63 var node = element.childNodes[i]; | 64 var node = element.childNodes[i]; |
| 64 if (node.nodeType === Node.TEXT_NODE) | 65 if (node.nodeType === Node.TEXT_NODE) |
| 65 text += node.textContent; | 66 text += node.textContent; |
| 66 else | 67 else |
| 67 text += String.sprintf("[%s]", node.textContent); | 68 text += String.sprintf("[%s]", node.textContent); |
| 68 } | 69 } |
| 69 InspectorTest.addResult(text); | 70 return text; |
| 70 } | 71 } |
| 71 } | 72 } |
| 72 </script> | 73 </script> |
| 73 </head> | 74 </head> |
| 74 | 75 |
| 75 <body onload="runTest()"> | 76 <body onload="runTest()"> |
| 76 <p> | 77 <p> |
| 77 Verifies that SelectUISourceCodeDialog rendering works properly. | 78 Verifies that SelectUISourceCodeDialog rendering works properly. |
| 78 </p> | 79 </p> |
| 79 | 80 |
| 80 </body> | 81 </body> |
| 81 </html> | 82 </html> |
| OLD | NEW |