Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / sources / pretty-print-javascript-3.html
blob2dd444b307e87932051a2bb43432152e7dbe5eaa
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 <script src="debugger/resources/obfuscated.js"></script>
8 <script>
10 function test()
12 var testJSFormatter = InspectorTest.testPrettyPrint.bind(InspectorTest, "text/javascript");
14 InspectorTest.runTestSuite([
15 function ifStatements(next)
17 var mappingQueries = ["===", "!==", "non-eq"];
18 testJSFormatter("if(a<b)log(a);else log(b);if(a<b){log(a)}else{log(b);}if(a===b)log('equals');if(a!==b){log('non-eq');}", mappingQueries, next);
21 function arrayLiteralFormatting(next)
23 var mappingQueries = ["3", "2", "1", "0"];
24 testJSFormatter("var arr=[3,2,1,0]", mappingQueries, next);
27 function ifFormatting(next)
29 var mappingQueries = ["&&", "print(a)"];
30 testJSFormatter("if(a>b&&b>c){print(a);print(b);}", mappingQueries, next);
33 function ternarOperatorFormatting(next)
35 var mappingQueries = ["?", ":"];
36 testJSFormatter("a>b?a:b", mappingQueries, next);
39 function labeledStatementFormatting(next)
41 var mappingQueries = ["break", "continue", "while"];
42 testJSFormatter("firstLoop:while(true){break firstLoop;continue firstLoop;}", mappingQueries, next);
44 ]);
47 </script>
49 </head>
51 <body onload="runTest()">
52 <p>Verifies JavaScript pretty-printing functionality.</p>
53 </body>
54 </html>