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> | |
7 | 6 |
8 <script> | 7 <script> |
9 | 8 |
10 function test() | 9 function test() |
11 { | 10 { |
12 var testJSFormatter = InspectorTest.testPrettyPrint.bind(InspectorTest, "tex
t/javascript"); | 11 var testJSFormatter = InspectorTest.testPrettyPrint.bind(InspectorTest, "tex
t/javascript"); |
13 | 12 |
14 InspectorTest.runTestSuite([ | 13 InspectorTest.runTestSuite([ |
15 function semicolonAfterFunctionExpression(next) | 14 function semicolonAfterFunctionExpression(next) |
16 { | 15 { |
17 var mappingQueries = ["onClick", "function", "console", "log", "clic
k!", "done"]; | 16 var mappingQueries = ["onClick", "function", "console", "log", "clic
k!", "done"]; |
18 testJSFormatter("var onClick = function() { console.log('click!'); }
;console.log('done');", mappingQueries, next); | 17 testJSFormatter("var onClick = function() { console.log('click!'); }
;console.log('done');", mappingQueries, next); |
19 }, | 18 }, |
20 | 19 |
21 function semicolonAfterMultipleFunctionExpressions(next) | 20 function semicolonAfterMultipleFunctionExpressions(next) |
22 { | 21 { |
23 var mappingQueries = ["onStart", "onFinish", "a()", "b()"]; | 22 var mappingQueries = ["onStart", "onFinish", "a()", "b()"]; |
24 testJSFormatter("var onStart = function() { a(); }, onFinish = funct
ion() { b(); };", mappingQueries, next); | 23 testJSFormatter("var onStart = function() { a(); }, onFinish = funct
ion() { b(); };", mappingQueries, next); |
25 }, | 24 }, |
26 | 25 |
27 function semicolonAfterEmptyFunctionExpressions(next) | 26 function semicolonAfterEmptyFunctionExpressions(next) |
28 { | 27 { |
29 var mappingQueries = ["onStart", "delay", "1000", "belay", "activeEl
ement"]; | 28 var mappingQueries = ["onStart", "delay", "1000", "belay", "activeEl
ement"]; |
30 testJSFormatter("var onStart = function() {}, delay=1000, belay=docu
ment.activeElement;", mappingQueries, next); | 29 testJSFormatter("var onStart = function() {}, delay=1000, belay=docu
ment.activeElement;", mappingQueries, next); |
31 }, | 30 }, |
| 31 |
| 32 function continueStatementFormatting(next) |
| 33 { |
| 34 var mappingQueries = ["function", "1", "continue", "test"]; |
| 35 testJSFormatter("function foo(){while(1){if (a)continue;test();}}",
mappingQueries, next); |
| 36 }, |
32 ]); | 37 ]); |
33 } | 38 } |
34 | 39 |
35 </script> | 40 </script> |
36 | 41 |
37 </head> | 42 </head> |
38 | 43 |
39 <body onload="runTest()"> | 44 <body onload="runTest()"> |
40 <p>Verifies JavaScript pretty-printing functionality.</p> | 45 <p>Verifies JavaScript pretty-printing functionality.</p> |
41 </body> | 46 </body> |
42 </html> | 47 </html> |
OLD | NEW |