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

Unified Diff: test/debugger/test-api.js

Issue 2482903002: [debugger] Stepping and break-related functions in wrapper (Closed)
Patch Set: Correctly revert changes to testcase Created 4 years, 1 month 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
« no previous file with comments | « test/debugger/debug/regress/regress-crbug-401915.js ('k') | test/mjsunit/debug-constructor.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/debugger/test-api.js
diff --git a/test/debugger/test-api.js b/test/debugger/test-api.js
index 3d9de1f0485e9d8e70d344b0640398660cc7cffa..fc3d967e86600e0476a07670520614420c1f644c 100644
--- a/test/debugger/test-api.js
+++ b/test/debugger/test-api.js
@@ -59,6 +59,10 @@ class DebugWrapper {
Module: 8
};
+ // Types of exceptions that can be broken upon.
+ this.ExceptionBreak = { Caught : 0,
+ Uncaught: 1 };
+
// Store the current script id so we can skip corresponding break events.
this.thisScriptId = %FunctionGetScriptId(receive);
@@ -76,6 +80,39 @@ class DebugWrapper {
stepInto() { this.sendMessageForMethodChecked("Debugger.stepInto"); }
stepOut() { this.sendMessageForMethodChecked("Debugger.stepOut"); }
+ setBreakOnException() {
+ this.sendMessageForMethodChecked(
+ "Debugger.setPauseOnExceptions", { state : "all" });
+ }
+
+ clearBreakOnException() {
+ const newState = this.isBreakOnUncaughtException() ? "uncaught" : "none";
+ this.sendMessageForMethodChecked(
+ "Debugger.setPauseOnExceptions", { state : newState });
+ }
+
+ isBreakOnException() {
+ return !!%IsBreakOnException(this.ExceptionBreak.Caught);
+ };
+
+ setBreakOnUncaughtException() {
+ const newState = this.isBreakOnException() ? "all" : "uncaught";
+ this.sendMessageForMethodChecked(
+ "Debugger.setPauseOnExceptions", { state : newState });
+ }
+
+ clearBreakOnUncaughtException() {
+ const newState = this.isBreakOnException() ? "all" : "none";
+ this.sendMessageForMethodChecked(
+ "Debugger.setPauseOnExceptions", { state : newState });
+ }
+
+ isBreakOnUncaughtException() {
+ return !!%IsBreakOnException(this.ExceptionBreak.Uncaught);
+ };
+
+ clearStepping() { %ClearStepping(); };
+
// Returns the resulting breakpoint id.
setBreakPoint(func, opt_line, opt_column, opt_condition) {
assertTrue(%IsFunction(func));
@@ -161,8 +198,8 @@ class DebugWrapper {
send(message);
}
- sendMessageForMethodChecked(method) {
- const {msgid, msg} = this.createMessage(method);
+ sendMessageForMethodChecked(method, params) {
+ const {msgid, msg} = this.createMessage(method, params);
this.sendMessage(msg);
this.takeReplyChecked(msgid);
}
« no previous file with comments | « test/debugger/debug/regress/regress-crbug-401915.js ('k') | test/mjsunit/debug-constructor.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698