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 forLoopWithIfStatementWithoutBlockStatements(next
)
17 var mappingQueries
= ["length","console","of"];
18 testJSFormatter("for(var value of map)if (value.length%3===0)console.log(value);", mappingQueries
, next
);
21 function objectExpressionProperties(next
)
23 var mappingQueries
= ["mapping", "original", "formatted"];
24 testJSFormatter("var mapping={original:[1,2,3],formatted:[],count:0}", mappingQueries
, next
);
27 function blockFormatting(next
)
29 var mappingQueries
= ["(1)", "(2)"];
30 testJSFormatter("{ print(1); print(2); }", mappingQueries
, next
);
33 function assignmentFormatting(next
)
35 var mappingQueries
= ["string"];
36 testJSFormatter("var exp='a string';c=+a+(0>a?b:0);c=(1);var a=(1);", mappingQueries
, next
);
39 function objectLiteralFormatting(next
)
41 var mappingQueries
= [
46 testJSFormatter("var obj={'foo':1,bar:\"2\",cat:{dog:'1989'}}", mappingQueries
, next
);
55 <body onload=
"runTest()">
56 <p>Verifies JavaScript pretty-printing functionality.
</p>