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

Unified Diff: test/inspector/debugger/command-line-api-with-bound-function.js

Issue 2391323002: [inspector] command line api debug and monitor works with bound functions (Closed)
Patch Set: addressed comments Created 4 years, 2 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: test/inspector/debugger/command-line-api-with-bound-function.js
diff --git a/test/inspector/debugger/command-line-api-with-bound-function.js b/test/inspector/debugger/command-line-api-with-bound-function.js
new file mode 100644
index 0000000000000000000000000000000000000000..0f1ae21ebe221e276a0d4f8273256ace521ecfc7
--- /dev/null
+++ b/test/inspector/debugger/command-line-api-with-bound-function.js
@@ -0,0 +1,64 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+print("Check that debug and monitor methods from Command Line API works with bound function.");
+
+InspectorTest.addScript(`
+function foo() {}
+function boo() {}
+var bar = boo.bind(null);
+
+function testFunction() {
+ console.log("> debug foo and bar");
+ debug(foo);
+ debug(bar);
+ console.log("> call foo and bar");
+ foo();
+ bar();
+ console.log("> undebug foo and bar");
+ undebug(foo);
+ undebug(bar);
+ console.log("> call foo and bar");
+ foo();
+ bar();
+
+ console.log("> monitor foo and bar");
+ monitor(foo);
+ monitor(bar);
+ console.log("> call foo and bar");
+ foo();
+ bar();
+ console.log("> unmonitor foo and bar");
+ unmonitor(foo);
+ unmonitor(bar);
+ console.log("> call foo and bar");
+ foo();
+ bar();
+
+ console.log("> monitor and debug bar");
+ monitor(bar);
+ debug(bar);
+ console.log("> call bar");
+ bar();
+ console.log("> undebug bar");
+ undebug(bar);
+ console.log("> call bar");
+ bar();
+ console.log("> debug and unmonitor bar");
+ debug(bar);
+ unmonitor(bar);
+ console.log("> call bar");
+ bar();
+}`);
+
+Protocol.Runtime.enable();
+Protocol.Debugger.enable();
+Protocol.Debugger.onPaused(message => {
+ var functionName = message.params.callFrames[0].functionName;
+ InspectorTest.log(`paused in ${functionName}`);
+ Protocol.Debugger.resume();
+});
+Protocol.Runtime.onConsoleAPICalled(message => InspectorTest.log(message.params.args[0].value));
+Protocol.Runtime.evaluate({ expression: "testFunction()", includeCommandLineAPI: true })
+ .then(InspectorTest.completeTest);
« no previous file with comments | « src/inspector/v8-console.cc ('k') | test/inspector/debugger/command-line-api-with-bound-function-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698