| 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:") |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 function compileCallback(error, scriptId, exceptionDetails) | 35 function compileCallback(error, scriptId, exceptionDetails) |
| 36 { | 36 { |
| 37 InspectorTest.assertTrue(!error); | 37 InspectorTest.assertTrue(!error); |
| 38 InspectorTest.assertTrue(!exceptionDetails); | 38 InspectorTest.assertTrue(!exceptionDetails); |
| 39 InspectorTest.assertTrue(!!scriptId); | 39 InspectorTest.assertTrue(!!scriptId); |
| 40 InspectorTest.addResult("Running script"); | 40 InspectorTest.addResult("Running script"); |
| 41 InspectorTest.RuntimeAgent.runScript(scriptId, contextId, "conso
le", false, runCallback.bind(this)); | 41 InspectorTest.RuntimeAgent.runScript(scriptId, contextId, "conso
le", false, runCallback.bind(this)); |
| 42 } | 42 } |
| 43 | 43 |
| 44 function runCallback(error, result, exceptionDetails) | 44 function runCallback(error, result, wasThrown, exceptionDetails) |
| 45 { | 45 { |
| 46 var wasThrown = !!exceptionDetails; | |
| 47 InspectorTest.assertTrue(!error); | 46 InspectorTest.assertTrue(!error); |
| 48 InspectorTest.assertTrue(!wasThrown); | 47 InspectorTest.assertTrue(!wasThrown); |
| 49 InspectorTest.addResult("Script result: " + result.value); | 48 InspectorTest.addResult("Script result: " + result.value); |
| 50 next(); | 49 next(); |
| 51 } | 50 } |
| 52 }, | 51 }, |
| 53 | 52 |
| 54 function testRunError(next) | 53 function testRunError(next) |
| 55 { | 54 { |
| 56 var expression = "var a = 1; a + c; "; | 55 var expression = "var a = 1; a + c; "; |
| 57 InspectorTest.addResult("Compiling script"); | 56 InspectorTest.addResult("Compiling script"); |
| 58 InspectorTest.RuntimeAgent.compileScript(expression, "test.js", true
, contextId, compileCallback.bind(this)); | 57 InspectorTest.RuntimeAgent.compileScript(expression, "test.js", true
, contextId, compileCallback.bind(this)); |
| 59 | 58 |
| 60 function compileCallback(error, scriptId, exceptionDetails) | 59 function compileCallback(error, scriptId, exceptionDetails) |
| 61 { | 60 { |
| 62 InspectorTest.assertTrue(!error); | 61 InspectorTest.assertTrue(!error); |
| 63 InspectorTest.assertTrue(!exceptionDetails); | 62 InspectorTest.assertTrue(!exceptionDetails); |
| 64 InspectorTest.assertTrue(!!scriptId); | 63 InspectorTest.assertTrue(!!scriptId); |
| 65 InspectorTest.addResult("Running script"); | 64 InspectorTest.addResult("Running script"); |
| 66 InspectorTest.RuntimeAgent.runScript(scriptId, contextId, "conso
le", false, runCallback.bind(this)); | 65 InspectorTest.RuntimeAgent.runScript(scriptId, contextId, "conso
le", false, runCallback.bind(this)); |
| 67 } | 66 } |
| 68 | 67 |
| 69 function runCallback(error, result, exceptionDetails) | 68 function runCallback(error, result, wasThrown, exceptionDetails) |
| 70 { | 69 { |
| 71 var wasThrown = !!exceptionDetails; | |
| 72 InspectorTest.assertTrue(!error); | 70 InspectorTest.assertTrue(!error); |
| 73 InspectorTest.assertTrue(wasThrown); | 71 InspectorTest.assertTrue(wasThrown); |
| 74 printExceptionDetails(exceptionDetails); | 72 printExceptionDetails(exceptionDetails); |
| 75 next(); | 73 next(); |
| 76 } | 74 } |
| 77 }, | 75 }, |
| 78 | 76 |
| 79 function testCompileError(next) | 77 function testCompileError(next) |
| 80 { | 78 { |
| 81 var expression = "}"; | 79 var expression = "}"; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 93 } | 91 } |
| 94 ]); | 92 ]); |
| 95 } | 93 } |
| 96 </script> | 94 </script> |
| 97 </head> | 95 </head> |
| 98 <body onload="runTest()"> | 96 <body onload="runTest()"> |
| 99 <p>Tests separate compilation and run.</p> | 97 <p>Tests separate compilation and run.</p> |
| 100 <a href="https://bugs.webkit.org/show_bug.cgi?id=89646">Bug 89646.</a> | 98 <a href="https://bugs.webkit.org/show_bug.cgi?id=89646">Bug 89646.</a> |
| 101 </body> | 99 </body> |
| 102 </html> | 100 </html> |
| OLD | NEW |