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="resources/obfuscated.js"></script> | 4 <script src="resources/obfuscated.js"></script> |
5 | 5 |
6 <script> | 6 <script> |
7 | 7 |
8 var test = function() | 8 var test = function() |
9 { | 9 { |
10 var worker = Runtime.startWorker("script_formatter_worker"); | 10 var worker = new Worker("script_formatter_worker/ScriptFormatterWorker.js"); |
11 var parsedScript = "function first(x,y) { }\n var second = function(y \n , \
nz) { }\n Object = function(arg) {\n}\n Object.prototype.functionOnPrototype = f
unction ( a, b , \n c, d , \n e , f ) { function innerFunction1(
) {\n var innerFunction2 = function(arg1,arg2) {} } }"; | 11 var parsedScript = "function first(x,y) { }\n var second = function(y \n , \
nz) { }\n Object = function(arg) {\n}\n Object.prototype.functionOnPrototype = f
unction ( a, b , \n c, d , \n e , f ) { function innerFunction1(
) {\n var innerFunction2 = function(arg1,arg2) {} } }"; |
12 | 12 |
13 worker.onmessage = InspectorTest.safeWrap(function(event) | 13 worker.onmessage = InspectorTest.safeWrap(function(event) |
14 { | 14 { |
15 InspectorTest.addObject(event.data); | 15 InspectorTest.addObject(event.data); |
16 InspectorTest.completeTest(); | 16 InspectorTest.completeTest(); |
17 }); | 17 }); |
18 | 18 |
19 worker.onerror = function(event) | 19 worker.onerror = function(event) |
20 { | 20 { |
21 InspectorTest.addResult("Error in worker: " + event.data); | 21 InspectorTest.addResult("Error in worker: " + event.data); |
22 InspectorTest.completeTest(); | 22 InspectorTest.completeTest(); |
23 }; | 23 }; |
24 | 24 |
25 worker.postMessage({ method: "javaScriptOutline", params: { content: parsedS
cript } }); | 25 worker.postMessage({ method: "javaScriptOutline", params: { content: parsedS
cript } }); |
26 } | 26 } |
27 | 27 |
28 </script> | 28 </script> |
29 | 29 |
30 </head> | 30 </head> |
31 | 31 |
32 <body onload="runTest()"> | 32 <body onload="runTest()"> |
33 <p>Tests the script outline extraction functionality. | 33 <p>Tests the script outline extraction functionality. |
34 </p> | 34 </p> |
35 | 35 |
36 </body> | 36 </body> |
37 </html> | 37 </html> |
OLD | NEW |