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 testInlineJavascript(next) |
| 15 { |
| 16 var mappingQueries = ["console", "test", "</html"]; |
| 17 testFormatter("<html><script>for(var i=0;i<10;++i)console.log('test
'+i);<\/script></html>", mappingQueries, next); |
| 18 }, |
| 19 |
| 20 function testInlineCSS(next) |
| 21 { |
| 22 var mappingQueries = ["<html>", "red", "black"]; |
| 23 testFormatter("<html><style>div{color:red;border:1px solid black;}</
style></html>", mappingQueries, next); |
| 24 }, |
| 25 |
| 26 function testMultilineInput(next) |
| 27 { |
| 28 var html = `<html> |
| 29 <head> |
| 30 <meta name=\"ROBOTS\" content=\"NOODP\"> |
| 31 <meta name='viewport' content='text/html'> |
| 32 <title>foobar</title> |
| 33 <body> |
| 34 <script>if(1<2){if(2<3){if(3<4){if(4<5){console.log("magic")}}}}<\/script> |
| 35 <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA..."> |
| 36 <style>div{display:flex;align-items:center;justify-content:center;}body{width:10
0%}*{border:1px solid black}</style> |
| 37 </body> |
| 38 </html> |
| 39 `; |
| 40 var mappingQueries = ["ROBOTS", "image", "...", "</body>", "</html>"
, "</style>"]; |
| 41 testFormatter(html, mappingQueries, next); |
| 42 }, |
| 43 ]); |
| 44 } |
| 45 |
| 46 </script> |
| 47 |
| 48 </head> |
| 49 |
| 50 <body onload="runTest()"> |
| 51 <p>Verifies JavaScript pretty-printing functionality.</p> |
| 52 </body> |
| 53 </html> |
OLD | NEW |