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>
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
);
51 <body onload=
"runTest()">
52 <p>Verifies JavaScript pretty-printing functionality.
</p>