| 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); |
| 14 } | 15 } |
| 15 | 16 |
| 16 function timeout1() | 17 function timeout1() |
| 17 { | 18 { |
| 18 debugger; | 19 debugger; |
| 19 requestAnimationFrame(animFrame1); | 20 requestAnimationFrame(animFrame1); |
| 20 var id = setInterval(innerInterval1, 0); | 21 var id = setInterval(innerInterval1, 0); |
| 21 function innerInterval1() | 22 function innerInterval1() |
| 22 { | 23 { |
| 23 clearInterval(id); | 24 clearInterval(id); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 37 debugger; | 38 debugger; |
| 38 } | 39 } |
| 39 | 40 |
| 40 function timeout2() | 41 function timeout2() |
| 41 { | 42 { |
| 42 debugger; | 43 debugger; |
| 43 } | 44 } |
| 44 | 45 |
| 45 function animFrame2() | 46 function animFrame2() |
| 46 { | 47 { |
| 48 document.getElementById("image").addEventListener("error", imageErrorHandler
, true); |
| 49 document.getElementById("image").addEventListener("click", imageClickHandler
Sync, true); |
| 47 debugger; | 50 debugger; |
| 48 function longTail0() | 51 function longTail0() |
| 49 { | 52 { |
| 50 timeout3(); | 53 timeout3(); |
| 51 } | 54 } |
| 52 var funcs = []; | 55 var funcs = []; |
| 53 for (var i = 0; i < 20; ++i) | 56 for (var i = 0; i < 20; ++i) |
| 54 funcs.push("function longTail" + (i + 1) + "() { setTimeout(longTail" +
i + ", 0); };"); | 57 funcs.push("function longTail" + (i + 1) + "() { setTimeout(longTail" +
i + ", 0); };"); |
| 55 funcs.push("setTimeout(longTail" + i + ", 0);"); | 58 funcs.push("setTimeout(longTail" + i + ", 0);"); |
| 56 eval(funcs.join("\n")); | 59 eval(funcs.join("\n")); |
| 57 } | 60 } |
| 58 | 61 |
| 59 function timeout3() | 62 function timeout3() |
| 60 { | 63 { |
| 61 debugger; | 64 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() |
| 62 } | 77 } |
| 63 | 78 |
| 64 var test = function() | 79 var test = function() |
| 65 { | 80 { |
| 66 var totalDebuggerStatements = 6; | 81 var totalDebuggerStatements = 10; |
| 67 var maxAsyncCallStackDepth = 4; | 82 var maxAsyncCallStackDepth = 4; |
| 68 | 83 |
| 69 InspectorTest.setQuiet(true); | 84 InspectorTest.setQuiet(true); |
| 70 InspectorTest.startDebuggerTest(step1); | 85 InspectorTest.startDebuggerTest(step1); |
| 71 | 86 |
| 72 function step1() | 87 function step1() |
| 73 { | 88 { |
| 74 DebuggerAgent.setAsyncCallStackDepth(maxAsyncCallStackDepth, step2); | 89 DebuggerAgent.setAsyncCallStackDepth(maxAsyncCallStackDepth, step2); |
| 75 } | 90 } |
| 76 | 91 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 99 } | 114 } |
| 100 } | 115 } |
| 101 | 116 |
| 102 </script> | 117 </script> |
| 103 </head> | 118 </head> |
| 104 | 119 |
| 105 <body onload="runTest()"> | 120 <body onload="runTest()"> |
| 106 <p> | 121 <p> |
| 107 Tests asynchronous call stacks in debugger. | 122 Tests asynchronous call stacks in debugger. |
| 108 </p> | 123 </p> |
| 124 <img id="image" onerror="imageErrorHandler()"></img> |
| 109 | 125 |
| 110 </body> | 126 </body> |
| 111 </html> | 127 </html> |
| OLD | NEW |