| 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 | 6 |
| 7 function testFunction() | 7 function testFunction() |
| 8 { | 8 { |
| 9 function innerTestFunction() | 9 function innerTestFunction() |
| 10 { | 10 { |
| 11 timeout1(); | 11 timeout1(); |
| 12 } | 12 } |
| 13 setTimeout(innerTestFunction, 0); | 13 setTimeout(innerTestFunction, 0); |
| 14 document.getElementById("image").addEventListener("error", imageErrorHandler
, false); | |
| 15 } | 14 } |
| 16 | 15 |
| 17 function timeout1() | 16 function timeout1() |
| 18 { | 17 { |
| 19 debugger; | 18 debugger; |
| 20 requestAnimationFrame(animFrame1); | 19 requestAnimationFrame(animFrame1); |
| 21 var id = setInterval(innerInterval1, 0); | 20 var id = setInterval(innerInterval1, 0); |
| 22 function innerInterval1() | 21 function innerInterval1() |
| 23 { | 22 { |
| 24 clearInterval(id); | 23 clearInterval(id); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 38 debugger; | 37 debugger; |
| 39 } | 38 } |
| 40 | 39 |
| 41 function timeout2() | 40 function timeout2() |
| 42 { | 41 { |
| 43 debugger; | 42 debugger; |
| 44 } | 43 } |
| 45 | 44 |
| 46 function animFrame2() | 45 function animFrame2() |
| 47 { | 46 { |
| 48 document.getElementById("image").addEventListener("error", imageErrorHandler
, true); | |
| 49 document.getElementById("image").addEventListener("click", imageClickHandler
Sync, true); | |
| 50 debugger; | 47 debugger; |
| 51 function longTail0() | 48 function longTail0() |
| 52 { | 49 { |
| 53 timeout3(); | 50 timeout3(); |
| 54 } | 51 } |
| 55 var funcs = []; | 52 var funcs = []; |
| 56 for (var i = 0; i < 20; ++i) | 53 for (var i = 0; i < 20; ++i) |
| 57 funcs.push("function longTail" + (i + 1) + "() { setTimeout(longTail" +
i + ", 0); };"); | 54 funcs.push("function longTail" + (i + 1) + "() { setTimeout(longTail" +
i + ", 0); };"); |
| 58 funcs.push("setTimeout(longTail" + i + ", 0);"); | 55 funcs.push("setTimeout(longTail" + i + ", 0);"); |
| 59 eval(funcs.join("\n")); | 56 eval(funcs.join("\n")); |
| 60 } | 57 } |
| 61 | 58 |
| 62 function timeout3() | 59 function timeout3() |
| 63 { | 60 { |
| 64 debugger; | 61 debugger; |
| 65 image.src = "non_existing.png"; | |
| 66 image.click(); | |
| 67 } | |
| 68 | |
| 69 function imageErrorHandler() | |
| 70 { | |
| 71 debugger; // should hit 3 times with different async stacks | |
| 72 } | |
| 73 | |
| 74 function imageClickHandlerSync() | |
| 75 { | |
| 76 debugger; // synchronous call => should have same async call chain as for ti
meout3() | |
| 77 } | 62 } |
| 78 | 63 |
| 79 var test = function() | 64 var test = function() |
| 80 { | 65 { |
| 81 var totalDebuggerStatements = 10; | 66 var totalDebuggerStatements = 6; |
| 82 var maxAsyncCallStackDepth = 4; | 67 var maxAsyncCallStackDepth = 4; |
| 83 InspectorTest.runAsyncCallStacksTest(totalDebuggerStatements, maxAsyncCallSt
ackDepth); | 68 InspectorTest.runAsyncCallStacksTest(totalDebuggerStatements, maxAsyncCallSt
ackDepth); |
| 84 } | 69 } |
| 85 | 70 |
| 86 </script> | 71 </script> |
| 87 </head> | 72 </head> |
| 88 | 73 |
| 89 <body onload="runTest()"> | 74 <body onload="runTest()"> |
| 90 <p> | 75 <p> |
| 91 Tests asynchronous call stacks in debugger. | 76 Tests asynchronous call stacks in debugger. |
| 92 </p> | 77 </p> |
| 93 <img id="image" onerror="imageErrorHandler()"></img> | |
| 94 | 78 |
| 95 </body> | 79 </body> |
| 96 </html> | 80 </html> |
| OLD | NEW |