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 simpleLiteral(next
)
17 var mappingQueries
= ["foo", "bar"];
18 testJSFormatter("var foo = `bar`;", mappingQueries
, next
);
21 function multilineLiteral(next
)
23 var mappingQueries
= ["foo", "bar"];
24 testJSFormatter("var foo = `this\nbar`;", mappingQueries
, next
);
27 function stringSubstitution(next
)
29 var mappingQueries
= ["credit", "cash"];
30 testJSFormatter("var a=`I have ${credit+cash}$`;", mappingQueries
, next
);
33 function multipleStringSubstitution(next
)
35 var mappingQueries
= ["credit", "cash"];
36 testJSFormatter("var a=`${name} has ${credit+cash}${currency?currency:\"$\"}`;", mappingQueries
, next
);
39 function taggedTemplate(next
)
41 var mappingQueries
= ["escapeHtml", "width"];
42 testJSFormatter("escapeHtml`<div class=${classnName} width=${a+b}/>`;", mappingQueries
, next
);
45 function escapedApostrophe(next
)
47 var mappingQueries
= ["That", "great"];
48 testJSFormatter("var a=`That\`s great!`;", mappingQueries
, next
);
57 <body onload=
"runTest()">
58 <p>Verifies JavaScript pretty-printing functionality.
</p>