Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Unified Diff: LayoutTests/inspector/debugger/monitor-console-command.html

Issue 16143005: monitor console command implemented. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..2934416f7df9a96f79de723b23ca8005efcf7a3a
--- /dev/null
+++ b/LayoutTests/inspector/debugger/monitor-console-command.html
@@ -0,0 +1,88 @@
+<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)");
+ monitorAndRun(next, "simpleTestFunction3", "simpleTestFunction2();");
+ },
+
+ function testUnmonitorFuntionNotMonitored(next)
+ {
+ InspectorTest.evaluateInConsole("monitor(simpleTestFunction)", next);
+ }
+ ]);
+
+ 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>
« no previous file with comments | « LayoutTests/http/tests/inspector/console-test.js ('k') | LayoutTests/inspector/debugger/monitor-console-command-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698