3 <script src=
"../../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"resources/obfuscated.js"></script>
6 <script id=
"outline">function first(x,y) { }
7 var second = function(y
10 Object = function(arg) {
12 Object.prototype.functionOnPrototype = function ( a, b ,
14 e , f ) { function innerFunction1() {
15 var innerFunction2 = function(arg1,arg2) {} } }
18 * @param {string} name
20 window.Cat = function(name)
25 window.Cat.prototype = {
50 function getScriptText()
52 return document
.querySelector("#outline").textContent
;
58 var worker
= new WorkerRuntime
.Worker("script_formatter_worker");
60 worker
.onmessage
= InspectorTest
.safeWrap(function(event
)
62 InspectorTest
.addObject(event
.data
);
63 InspectorTest
.completeTest();
66 worker
.onerror = function(event
)
68 InspectorTest
.addResult("Error in worker: " + event
.data
);
69 InspectorTest
.completeTest();
72 InspectorTest
.evaluateInPage("getScriptText()", onScriptText
);
73 function onScriptText(result
)
75 worker
.postMessage({ method
: "javaScriptOutline", params
: { content
: result
.value
} });
83 <body onload=
"runTest()">
84 <p>Tests the script outline extraction functionality.