Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / sources / pretty-print-javascript-1.html
blob8034dc2874d12caadc3b6188917231c940bf114e
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 multipleVariableDeclarations(next)
17 var mappingQueries = ["{}", "hello", ";"];
18 testJSFormatter("var a=1,b={},c=2,d=\"hello world\";var a,b,c,d=2,e,f=3;", mappingQueries, next);
21 function emptyObjectExpression(next)
23 var mappingQueries = ["{", "}", "a"];
24 testJSFormatter("var a={}", mappingQueries, next);
27 function breakContinueStatements(next)
29 var mappingQueries = ["break", "continue", "2", "else"];
30 testJSFormatter("for(var i in set)if(i%2===0)break;else continue;", mappingQueries, next);
33 function chainedIfStatements(next)
35 var mappingQueries = ["7", "9", "3", "++"];
36 testJSFormatter("if(a%7===0)b=1;else if(a%9===1) b = 2;else if(a%5===3){b=a/2;b++;} else b= 3;", mappingQueries, next);
39 function tryCatchStatement(next)
41 var mappingQueries = ["try", "catch", "finally"];
42 testJSFormatter("try{a(b());}catch(e){f()}finally{f();}", mappingQueries, next);
44 ]);
47 </script>
49 </head>
51 <body onload="runTest()">
52 <p>Verifies JavaScript pretty-printing functionality.</p>
53 </body>
54 </html>