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