Chromium Code Reviews| Index: LayoutTests/inspector/debugger/monitor-console-command.html |
| diff --git a/LayoutTests/inspector/debugger/monitor-console-command.html b/LayoutTests/inspector/debugger/monitor-console-command.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6f35d71521694c6c0ecb3c532edd33b7fbd26e97 |
| --- /dev/null |
| +++ b/LayoutTests/inspector/debugger/monitor-console-command.html |
| @@ -0,0 +1,83 @@ |
| +<html> |
| +<head> |
| +<script src="../../http/tests/inspector/inspector-test.js"></script> |
| +<script src="../../http/tests/inspector/debugger-test.js"></script> |
| +<script src="../../http/tests/inspector/console-test.js"></script> |
| + |
| +<script> |
| +function simpleTestFunction() |
| +{ |
| + return 0; |
| +} |
| +</script> |
| + |
| +<script> |
| +function simpleTestFunction2() |
| +{ |
| + return simpleTestFunction3(); |
| +} |
| + |
| +function simpleTestFunction3() |
| +{ |
| + return 0; |
| +} |
| +</script> |
| + |
| +<script> |
| +var test = function() |
| +{ |
| + var currentSourceFrame; |
| + InspectorTest.setQuiet(true); |
| + InspectorTest.runDebuggerTestSuite([ |
| + function testSimpleMonitor(next) |
| + { |
| + monitorAndRun(next, "simpleTestFunction", "simpleTestFunction();"); |
| + }, |
| + |
| + function testSimpleMonitorWith1Arg(next) |
| + { |
| + monitorAndRun(next, "simpleTestFunction", "simpleTestFunction(1);"); |
| + }, |
| + |
| + function testSimpleMonitorWithManyArgs(next) |
| + { |
| + monitorAndRun(next, "simpleTestFunction", "simpleTestFunction(1, 2, 3, 4 ,5);"); |
| + }, |
| + |
| + function testSimpleUnmonitor(next) |
| + { |
| + InspectorTest.evaluateInConsole("monitor(simpleTestFunction2)"); |
| + InspectorTest.evaluateInConsole("unmonitor(simpleTestFunction2)"); |
|
yurys
2013/06/13 09:46:51
Can you add a test that unmonitor works ok on a fu
SeRya
2013/06/13 10:45:14
Done.
|
| + monitorAndRun(next, "simpleTestFunction3", "simpleTestFunction2();"); |
| + }, |
| + ]); |
| + |
| + function monitorAndRun(next, functionName, runCmd) |
| + { |
| + InspectorTest.evaluateInConsole("monitor(" + functionName + ")"); |
| + InspectorTest.addResult("Start monitoring function."); |
| + |
| + InspectorTest.evaluateInConsole("setTimeout(function() { " + runCmd + " }, 0)"); |
| + InspectorTest.addResult("Set timer for test function."); |
| + InspectorTest.waitUntilMessageReceived(didReceive); |
| + |
| + function didReceive(message) |
| + { |
| + InspectorTest.addResult("Console message received: " + message.message); |
| + InspectorTest.evaluateInConsole("unmonitor(" + functionName + ")"); |
| + InspectorTest.addResult("Stop monitoring."); |
| + next(); |
| + } |
| + } |
| +} |
| + |
| +</script> |
| +</head> |
| + |
| +<body onload="runTest()"> |
| +<p> |
| +Tests traceCalls(fn) console command. |
| +</p> |
| + |
| +</body> |
| +</html> |