OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
4 <script src="../../http/tests/inspector/debugger-test.js"></script> | 4 <script src="../../http/tests/inspector/debugger-test.js"></script> |
5 <script src="../../http/tests/inspector/sources-test.js"></script> | 5 <script src="../../http/tests/inspector/sources-test.js"></script> |
6 <script src="debugger/resources/obfuscated.js"></script> | 6 <script src="debugger/resources/obfuscated.js"></script> |
7 | 7 |
8 <script> | 8 <script> |
9 | 9 |
10 function test() | 10 function test() |
11 { | 11 { |
12 var testJSFormatter = InspectorTest.testPrettyPrint.bind(InspectorTest, "tex
t/javascript"); | 12 var testJSFormatter = InspectorTest.testPrettyPrint.bind(InspectorTest, "tex
t/javascript"); |
13 | 13 |
14 InspectorTest.runTestSuite([ | 14 InspectorTest.runTestSuite([ |
15 function trailingCommentsTest(next) | 15 function trailingCommentsTest(next) |
16 { | 16 { |
17 var mappingQueries = []; | 17 var mappingQueries = []; |
18 testJSFormatter("noop(); //#sourceMappingURL=program.js.map", mappin
gQueries, next); | 18 testJSFormatter("noop(); //#sourceMappingURL=program.js.map", mappin
gQueries, next); |
19 }, | 19 }, |
20 | 20 |
21 function inlinedScriptFormatting(next) | 21 function inlinedScriptFormatting(next) |
22 { | 22 { |
23 var content = "<html><body><script>function f(){}<" + "/script><scri
pt>function g(){var a;window.return = 10;if (a) return;}<" + "/script></body></h
tml>"; | 23 var content = "<html><body><script>function f(){}<" + "/script><scri
pt>function g(){var a;window.return = 10;if (a) return;}<" + "/script></body></h
tml>"; |
24 InspectorTest.testPrettyPrint("text/html", content, [], next); | 24 InspectorTest.testPrettyPrint("text/html", content, [], next); |
25 }, | 25 }, |
26 | 26 |
27 function generatorFormatter(next) | 27 function generatorFormatter(next) |
28 { | 28 { |
29 var mappingQueries = ["max", "*", "else"]; | 29 var mappingQueries = ["max", "*", "else"]; |
30 testJSFormatter("function *max(){ var a = yield; var b = yield; if (
a > b) return a; else return b;}", mappingQueries, next); | 30 testJSFormatter("function *max(){var a=yield;var b=yield 10;if(a>b)r
eturn a;else return b;}", mappingQueries, next); |
31 }, | 31 }, |
32 | 32 |
33 function blockCommentFormatter(next) | 33 function blockCommentFormatter(next) |
34 { | 34 { |
35 var mappingQueries = ["this", "is", "block", "comment", "var", "10"]
; | 35 var mappingQueries = ["this", "is", "block", "comment", "var", "10"]
; |
36 testJSFormatter("/** this\n * is\n * block\n * comment\n */\nvar a=1
0;", mappingQueries, next); | 36 testJSFormatter("/** this\n * is\n * block\n * comment\n */\nvar a=1
0;", mappingQueries, next); |
37 } | 37 } |
38 ]); | 38 ]); |
39 } | 39 } |
40 | 40 |
41 </script> | 41 </script> |
42 | 42 |
43 </head> | 43 </head> |
44 | 44 |
45 <body onload="runTest()"> | 45 <body onload="runTest()"> |
46 <p>Verifies JavaScript pretty-printing functionality.</p> | 46 <p>Verifies JavaScript pretty-printing functionality.</p> |
47 </body> | 47 </body> |
48 </html> | 48 </html> |
OLD | NEW |