OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/debugger-test.js"></script> |
| 5 <script src="../../http/tests/inspector/sources-test.js"></script> |
| 6 |
| 7 <script> |
| 8 |
| 9 function test() |
| 10 { |
| 11 var testFormatter = InspectorTest.testPrettyPrint.bind(InspectorTest, "text/
html"); |
| 12 |
| 13 InspectorTest.runTestSuite([ |
| 14 function testLinkFollowedByComment(next) |
| 15 { |
| 16 var mappingQueries = ["stylesheet", "some", "comment"]; |
| 17 testFormatter("<link href='a/b/c.css' rel='stylesheet'><!-- some com
ment -->", mappingQueries, next); |
| 18 }, |
| 19 |
| 20 function testInlineJavascript(next) |
| 21 { |
| 22 var mappingQueries = ["console", "test", "</html"]; |
| 23 testFormatter("<html><script>for(var i=0;i<10;++i)console.log('test
'+i);<\/script></html>", mappingQueries, next); |
| 24 }, |
| 25 |
| 26 function testInlineCSS(next) |
| 27 { |
| 28 var mappingQueries = ["<html>", "red", "black"]; |
| 29 testFormatter("<html><style>div{color:red;border:1px solid black;}</
style></html>", mappingQueries, next); |
| 30 }, |
| 31 |
| 32 function testMultilineInput(next) |
| 33 { |
| 34 var html = `<html> |
| 35 <head> |
| 36 <meta name=\"ROBOTS\" content=\"NOODP\"> |
| 37 <meta name='viewport' content='text/html'> |
| 38 <title>foobar</title> |
| 39 <body> |
| 40 <script>if(1<2){if(2<3){if(3<4){if(4<5){console.log("magic")}}}}<\/script> |
| 41 <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA..."> |
| 42 <style>div{display:flex;align-items:center;justify-content:center;}body{width:10
0%}*{border:1px solid black}</style> |
| 43 </body> |
| 44 </html> |
| 45 `; |
| 46 var mappingQueries = ["ROBOTS", "image", "...", "</body>", "</html>"
, "</style>"]; |
| 47 testFormatter(html, mappingQueries, next); |
| 48 }, |
| 49 ]); |
| 50 } |
| 51 |
| 52 </script> |
| 53 |
| 54 </head> |
| 55 |
| 56 <body onload="runTest()"> |
| 57 <p>Verifies JavaScript pretty-printing functionality.</p> |
| 58 </body> |
| 59 </html> |
OLD | NEW |