| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | |
| 4 <script src="resources/obfuscated.js"></script> | |
| 5 | |
| 6 <script id="outline">function first(x,y) { } | |
| 7 var second = function(y | |
| 8 , | |
| 9 z) { } | |
| 10 Object = function(arg) { | |
| 11 } | |
| 12 Object.prototype.functionOnPrototype = function ( a, b , | |
| 13 c, d , | |
| 14 e , f ) { function innerFunction1() { | |
| 15 var innerFunction2 = function(arg1,arg2) {} } } | |
| 16 /** | |
| 17 * @constructor | |
| 18 * @param {string} name | |
| 19 */ | |
| 20 window.Cat = function(name) | |
| 21 { | |
| 22 this._name = name; | |
| 23 } | |
| 24 | |
| 25 window.Cat.prototype = { | |
| 26 mew: function() | |
| 27 { | |
| 28 console.log("Mew!"); | |
| 29 }, | |
| 30 | |
| 31 get name() | |
| 32 { | |
| 33 return this._name; | |
| 34 }, | |
| 35 | |
| 36 feed: function() | |
| 37 { | |
| 38 // noop | |
| 39 }, | |
| 40 | |
| 41 set name(newName) | |
| 42 { | |
| 43 this._name = newName; | |
| 44 } | |
| 45 }; | |
| 46 </script> | |
| 47 | |
| 48 <script> | |
| 49 | |
| 50 function getScriptText() | |
| 51 { | |
| 52 return document.querySelector("#outline").textContent; | |
| 53 } | |
| 54 | |
| 55 function test() | |
| 56 { | |
| 57 | |
| 58 var worker = new Common.Worker("formatter_worker"); | |
| 59 | |
| 60 worker.onmessage = InspectorTest.safeWrap(function(event) | |
| 61 { | |
| 62 InspectorTest.addObject(event.data); | |
| 63 InspectorTest.completeTest(); | |
| 64 }); | |
| 65 | |
| 66 worker.onerror = function(event) | |
| 67 { | |
| 68 InspectorTest.addResult("Error in worker: " + event.data); | |
| 69 InspectorTest.completeTest(); | |
| 70 }; | |
| 71 | |
| 72 InspectorTest.evaluateInPage("getScriptText()", onScriptText); | |
| 73 function onScriptText(result) | |
| 74 { | |
| 75 worker.postMessage({ method: "javaScriptOutline", params: { content: res
ult.value } }); | |
| 76 } | |
| 77 } | |
| 78 | |
| 79 </script> | |
| 80 | |
| 81 </head> | |
| 82 | |
| 83 <body onload="runTest()"> | |
| 84 <p>Tests the script outline extraction functionality. | |
| 85 </p> | |
| 86 | |
| 87 </body> | |
| 88 </html> | |
| OLD | NEW |