Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / sources / debugger / script-extract-outline.html
index 420b903..7be3158 100644 (file)
@@ -3,12 +3,59 @@
 <script src="../../../http/tests/inspector/inspector-test.js"></script>
 <script src="resources/obfuscated.js"></script>
 
+<script id="outline">function first(x,y) { }
+ var second = function(y 
+ , 
+z) { }
+ Object = function(arg) {
+}
+ Object.prototype.functionOnPrototype = function  (  a,  b  ,  
+c,  d   ,  
+  e  ,  f )    { function innerFunction1() {
+ var innerFunction2 = function(arg1,arg2) {} } }
+/**
+ * @constructor
+ * @param {string} name
+ */
+window.Cat = function(name)
+{
+    this._name = name;
+}
+
+window.Cat.prototype = {
+    mew: function()
+    {
+        console.log("Mew!");
+    },
+
+    get name()
+    {
+        return this._name;
+    },
+
+    feed: function()
+    {
+        // noop
+    },
+
+    set name(newName)
+    {
+        this._name = newName;
+    }
+};
+</script>
+
 <script>
 
-var test = function()
+function getScriptText()
 {
+    return document.querySelector("#outline").textContent;
+}
+
+function test()
+{
+
     var worker = Runtime.startWorker("script_formatter_worker");
-    var parsedScript = "function first(x,y) { }\n var second = function(y \n , \nz) { }\n Object = function(arg) {\n}\n Object.prototype.functionOnPrototype = function  (  a,  b  ,  \n  c,  d   ,  \n  e  ,  f )    { function innerFunction1() {\n var innerFunction2 = function(arg1,arg2) {} } }";
 
     worker.onmessage = InspectorTest.safeWrap(function(event)
     {
@@ -22,7 +69,11 @@ var test = function()
         InspectorTest.completeTest();
     };
 
-    worker.postMessage({ method: "javaScriptOutline", params: { content: parsedScript } });
+    InspectorTest.evaluateInPage("getScriptText()", onScriptText);
+    function onScriptText(result)
+    {
+        worker.postMessage({ method: "javaScriptOutline", params: { content: result.value } });
+    }
 }
 
 </script>