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); |
} |