OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/debugger-test.js"></script> |
| 5 <script src="../../http/tests/inspector/console-test.js"></script> |
| 6 |
| 7 <script> |
| 8 function simpleTestFunction() |
| 9 { |
| 10 return 0; |
| 11 } |
| 12 </script> |
| 13 |
| 14 <script> |
| 15 function simpleTestFunction2() |
| 16 { |
| 17 return simpleTestFunction3(); |
| 18 } |
| 19 |
| 20 function simpleTestFunction3() |
| 21 { |
| 22 return 0; |
| 23 } |
| 24 </script> |
| 25 |
| 26 <script> |
| 27 var test = function() |
| 28 { |
| 29 var currentSourceFrame; |
| 30 InspectorTest.setQuiet(true); |
| 31 InspectorTest.runDebuggerTestSuite([ |
| 32 function testSimpleMonitor(next) |
| 33 { |
| 34 monitorAndRun(next, "simpleTestFunction", "simpleTestFunction();"); |
| 35 }, |
| 36 |
| 37 function testSimpleMonitorWith1Arg(next) |
| 38 { |
| 39 monitorAndRun(next, "simpleTestFunction", "simpleTestFunction(1);"); |
| 40 }, |
| 41 |
| 42 function testSimpleMonitorWithManyArgs(next) |
| 43 { |
| 44 monitorAndRun(next, "simpleTestFunction", "simpleTestFunction(1, 2,
3, 4 ,5);"); |
| 45 }, |
| 46 |
| 47 function testSimpleUnmonitor(next) |
| 48 { |
| 49 InspectorTest.evaluateInConsole("monitor(simpleTestFunction2)"); |
| 50 InspectorTest.evaluateInConsole("unmonitor(simpleTestFunction2)"); |
| 51 monitorAndRun(next, "simpleTestFunction3", "simpleTestFunction2();")
; |
| 52 }, |
| 53 |
| 54 function testUnmonitorFuntionNotMonitored(next) |
| 55 { |
| 56 InspectorTest.evaluateInConsole("monitor(simpleTestFunction)", next)
; |
| 57 } |
| 58 ]); |
| 59 |
| 60 function monitorAndRun(next, functionName, runCmd) |
| 61 { |
| 62 InspectorTest.evaluateInConsole("monitor(" + functionName + ")"); |
| 63 InspectorTest.addResult("Start monitoring function."); |
| 64 |
| 65 InspectorTest.evaluateInConsole("setTimeout(function() { " + runCmd + "
}, 0)"); |
| 66 InspectorTest.addResult("Set timer for test function."); |
| 67 InspectorTest.waitUntilMessageReceived(didReceive); |
| 68 |
| 69 function didReceive(message) |
| 70 { |
| 71 InspectorTest.addResult("Console message received: " + message.messa
ge); |
| 72 InspectorTest.evaluateInConsole("unmonitor(" + functionName + ")"); |
| 73 InspectorTest.addResult("Stop monitoring."); |
| 74 next(); |
| 75 } |
| 76 } |
| 77 } |
| 78 |
| 79 </script> |
| 80 </head> |
| 81 |
| 82 <body onload="runTest()"> |
| 83 <p> |
| 84 Tests traceCalls(fn) console command. |
| 85 </p> |
| 86 |
| 87 </body> |
| 88 </html> |
OLD | NEW |