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 simpleHTML(next) |
| 15 { |
| 16 var mappingQueries = ["</head>", "test", "</title>"]; |
| 17 testFormatter("<html><head><title>test</title></head></html>", mappi
ngQueries, next); |
| 18 }, |
| 19 |
| 20 function selfClosingTags(next) |
| 21 { |
| 22 var mappingQueries = ["meta", "hr", "<html>", "</html>"]; |
| 23 testFormatter("<html><head><meta></head><img><hr/></html>", mappingQ
ueries, next); |
| 24 }, |
| 25 |
| 26 function erroneousSelfClosingTags(next) |
| 27 { |
| 28 var mappingQueries = ["<br/>", "<title>", "test", "</head>"]; |
| 29 testFormatter("<head><meta><meta></meta><br/></br><link></link><titl
e>test</title></head>", mappingQueries, next); |
| 30 }, |
| 31 |
| 32 function testAttributes(next) |
| 33 { |
| 34 var mappingQueries = ["<body>", "width", "height", "</body>"]; |
| 35 testFormatter("<body><canvas width=100 height=100 data-bad-attr='</c
anvas>'></canvas></body>", mappingQueries, next); |
| 36 }, |
| 37 |
| 38 function testCustomElements(next) |
| 39 { |
| 40 var mappingQueries = ["<body>", "custom-time", "year", "month", "</b
ody>"]; |
| 41 testFormatter("<body><custom-time year=2016 day=1 month=1><div>minut
es/seconds</div></custom-time></body>", 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 |