Index: third_party/WebKit/LayoutTests/inspector/sources/pretty-print-html-3.html |
diff --git a/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-html-3.html b/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-html-3.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3cd4c43accb02f8e554ad89f1a6e11f076c7ca4f |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/inspector/sources/pretty-print-html-3.html |
@@ -0,0 +1,53 @@ |
+<html> |
+<head> |
+<script src="../../http/tests/inspector/inspector-test.js"></script> |
+<script src="../../http/tests/inspector/debugger-test.js"></script> |
+<script src="../../http/tests/inspector/sources-test.js"></script> |
+ |
+<script> |
+ |
+function test() |
+{ |
+ var testFormatter = InspectorTest.testPrettyPrint.bind(InspectorTest, "text/html"); |
+ |
+ InspectorTest.runTestSuite([ |
+ function testInlineJavascript(next) |
+ { |
+ var mappingQueries = ["console", "test", "</html"]; |
+ testFormatter("<html><script>for(var i=0;i<10;++i)console.log('test '+i);<\/script></html>", mappingQueries, next); |
+ }, |
+ |
+ function testInlineCSS(next) |
+ { |
+ var mappingQueries = ["<html>", "red", "black"]; |
+ testFormatter("<html><style>div{color:red;border:1px solid black;}</style></html>", mappingQueries, next); |
+ }, |
+ |
+ function testMultilineInput(next) |
+ { |
+ var html = `<html> |
+<head> |
+<meta name=\"ROBOTS\" content=\"NOODP\"> |
+<meta name='viewport' content='text/html'> |
+<title>foobar</title> |
+<body> |
+<script>if(1<2){if(2<3){if(3<4){if(4<5){console.log("magic")}}}}<\/script> |
+<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA..."> |
+<style>div{display:flex;align-items:center;justify-content:center;}body{width:100%}*{border:1px solid black}</style> |
+</body> |
+</html> |
+`; |
+ var mappingQueries = ["ROBOTS", "image", "...", "</body>", "</html>", "</style>"]; |
+ testFormatter(html, mappingQueries, next); |
+ }, |
+ ]); |
+} |
+ |
+</script> |
+ |
+</head> |
+ |
+<body onload="runTest()"> |
+<p>Verifies JavaScript pretty-printing functionality.</p> |
+</body> |
+</html> |