Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / sources / debugger / script-extract-outline.html
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 = Runtime.startWorker("script_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: result.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>