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>
8 function simpleTestFunction()
15 function simpleTestFunction2()
17 return simpleTestFunction3();
20 function simpleTestFunction3()
29 var currentSourceFrame
;
30 InspectorTest
.setQuiet(true);
31 InspectorTest
.runDebuggerTestSuite([
32 function testSimpleMonitor(next
)
34 monitorAndRun(next
, "simpleTestFunction", "simpleTestFunction();");
37 function testSimpleMonitorWith1Arg(next
)
39 monitorAndRun(next
, "simpleTestFunction", "simpleTestFunction(1);");
42 function testSimpleMonitorWithManyArgs(next
)
44 monitorAndRun(next
, "simpleTestFunction", "simpleTestFunction(1, 2, 3, 4 ,5);");
47 function testSimpleUnmonitor(next
)
49 InspectorTest
.evaluateInConsole("monitor(simpleTestFunction2)");
50 InspectorTest
.evaluateInConsole("unmonitor(simpleTestFunction2)");
51 monitorAndRun(next
, "simpleTestFunction3", "simpleTestFunction2();");
54 function testUnmonitorFuntionNotMonitored(next
)
56 InspectorTest
.evaluateInConsole("monitor(simpleTestFunction)", next
);
60 function monitorAndRun(next
, functionName
, runCmd
)
62 InspectorTest
.evaluateInConsole("monitor(" + functionName
+ ")");
63 InspectorTest
.addResult("Start monitoring function.");
65 InspectorTest
.evaluateInConsole("setTimeout(function() { " + runCmd
+ " }, 0)");
66 InspectorTest
.addResult("Set timer for test function.");
67 InspectorTest
.waitUntilMessageReceived(didReceive
);
69 function didReceive(message
)
71 if (message
.type
=== WebInspector
.ConsoleMessage
.MessageType
.Result
) {
72 InspectorTest
.waitUntilMessageReceived(didReceive
);
76 InspectorTest
.addResult("Console message received: " + message
.messageText
);
77 InspectorTest
.evaluateInConsole("unmonitor(" + functionName
+ ")");
78 InspectorTest
.addResult("Stop monitoring.");
87 <body onload=
"runTest()">
89 Tests traceCalls(fn) console command.