| 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="../../../http/tests/inspector/debugger-test.js"></script> | 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 var test = function() | 6 var test = function() |
| 7 { | 7 { |
| 8 function printExceptionDetails(exceptionDetails) | 8 function printExceptionDetails(exceptionDetails) |
| 9 { | 9 { |
| 10 InspectorTest.addResult("exceptionDetails:"); | 10 InspectorTest.addResult("exceptionDetails:"); |
| 11 var text = exceptionDetails.text; | 11 var text = exceptionDetails.text; |
| 12 if (exceptionDetails.exception) | 12 if (exceptionDetails.exception) |
| 13 text += " " + exceptionDetails.exception.description; | 13 text += " " + exceptionDetails.exception.description; |
| 14 InspectorTest.addResult(" " + text); | 14 InspectorTest.addResult(" " + text); |
| 15 InspectorTest.addResult(" line: " + exceptionDetails.lineNumber + ", c
olumn: " + exceptionDetails.columnNumber); | 15 InspectorTest.addResult(" line: " + exceptionDetails.lineNumber + ", c
olumn: " + exceptionDetails.columnNumber); |
| 16 | 16 |
| 17 var stack = exceptionDetails.stackTrace ? exceptionDetails.stackTrace.ca
llFrames : null; | 17 var stack = exceptionDetails.stackTrace ? exceptionDetails.stackTrace.ca
llFrames : null; |
| 18 if (!stack) { | 18 if (!stack) { |
| 19 InspectorTest.addResult(" no stack trace attached to exceptionDeta
ils"); | 19 InspectorTest.addResult(" no stack trace attached to exceptionDeta
ils"); |
| 20 } else { | 20 } else { |
| 21 InspectorTest.addResult(" exceptionDetails stack trace:"); | 21 InspectorTest.addResult(" exceptionDetails stack trace:"); |
| 22 for (var i = 0; i < stack.length && i < 100; ++i) { | 22 for (var i = 0; i < stack.length && i < 100; ++i) { |
| 23 InspectorTest.addResult(" url: " + stack[i].url); | 23 InspectorTest.addResult(" url: " + stack[i].url); |
| 24 InspectorTest.addResult(" function: " + stack[i].functionN
ame); | 24 InspectorTest.addResult(" function: " + stack[i].functionN
ame); |
| 25 InspectorTest.addResult(" line: " + stack[i].lineNumber); | 25 InspectorTest.addResult(" line: " + stack[i].lineNumber); |
| 26 } | 26 } |
| 27 } | 27 } |
| 28 } | 28 } |
| 29 | 29 |
| 30 var contextId = WebInspector.context.flavor(WebInspector.ExecutionContext).i
d; | 30 var contextId = UI.context.flavor(SDK.ExecutionContext).id; |
| 31 InspectorTest.runDebuggerTestSuite([ | 31 InspectorTest.runDebuggerTestSuite([ |
| 32 function testSuccessfulCompileAndRun(next) | 32 function testSuccessfulCompileAndRun(next) |
| 33 { | 33 { |
| 34 var expression = "var a = 1; var b = 2; a + b; "; | 34 var expression = "var a = 1; var b = 2; a + b; "; |
| 35 InspectorTest.addResult("Compiling script"); | 35 InspectorTest.addResult("Compiling script"); |
| 36 InspectorTest.RuntimeAgent.compileScript(expression, "test.js", true
, contextId, compileCallback.bind(this)); | 36 InspectorTest.RuntimeAgent.compileScript(expression, "test.js", true
, contextId, compileCallback.bind(this)); |
| 37 | 37 |
| 38 function compileCallback(error, scriptId, exceptionDetails) | 38 function compileCallback(error, scriptId, exceptionDetails) |
| 39 { | 39 { |
| 40 InspectorTest.assertTrue(!error); | 40 InspectorTest.assertTrue(!error); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 } | 94 } |
| 95 ]); | 95 ]); |
| 96 } | 96 } |
| 97 </script> | 97 </script> |
| 98 </head> | 98 </head> |
| 99 <body onload="runTest()"> | 99 <body onload="runTest()"> |
| 100 <p>Tests separate compilation and run.</p> | 100 <p>Tests separate compilation and run.</p> |
| 101 <a href="https://bugs.webkit.org/show_bug.cgi?id=89646">Bug 89646.</a> | 101 <a href="https://bugs.webkit.org/show_bug.cgi?id=89646">Bug 89646.</a> |
| 102 </body> | 102 </body> |
| 103 </html> | 103 </html> |
| OLD | NEW |