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

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

Issue 2503293002: [debug-wrapper] LiveEdit, frame.restart(), breakpoints (Closed)
Patch Set: Address comments 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/debugger.status ('k') | test/mjsunit/debug-liveedit-1.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 c81c08e93ac9515cdc2e16399fb60f574fa7b73f..5bd987db8f648b87932fa6006a1022680d8ca868 100644
--- a/test/debugger/test-api.js
+++ b/test/debugger/test-api.js
@@ -70,6 +70,11 @@ class DebugWrapper {
BreakPosition: 1
};
+ // The different script break point types.
+ this.ScriptBreakPointType = { ScriptId: 0,
+ ScriptName: 1,
+ ScriptRegExp: 2 };
+
// Store the current script id so we can skip corresponding break events.
this.thisScriptId = %FunctionGetScriptId(receive);
@@ -141,8 +146,37 @@ class DebugWrapper {
params.condition = opt_condition;
}
- const {msgid, msg} = this.createMessage(
- "Debugger.setBreakpoint", params);
+ const {msgid, msg} = this.createMessage("Debugger.setBreakpoint", params);
+ this.sendMessage(msg);
+
+ const reply = this.takeReplyChecked(msgid);
+ assertTrue(reply.result !== undefined);
+ const breakid = reply.result.breakpointId;
+ assertTrue(breakid !== undefined);
+
+ return breakid;
+ }
+
+ setScriptBreakPoint(type, scriptid, opt_line, opt_column, opt_condition) {
+ // Only sets by script id are supported for now.
+ assertEquals(this.ScriptBreakPointType.ScriptId, type);
+ return this.setScriptBreakPointById(scriptid, opt_line, opt_column,
+ opt_condition);
+ }
+
+ setScriptBreakPointById(scriptid, opt_line, opt_column, opt_condition) {
+ const loc = %ScriptLocationFromLine2(scriptid, opt_line, opt_column, 0);
+
+ const params = { location :
+ { scriptId : scriptid.toString(),
+ lineNumber : loc.line,
+ columnNumber : loc.column,
+ }};
+ if (!!opt_condition) {
+ params.condition = opt_condition;
+ }
+
+ const {msgid, msg} = this.createMessage("Debugger.setBreakpoint", params);
this.sendMessage(msg);
const reply = this.takeReplyChecked(msgid);
@@ -247,6 +281,11 @@ class DebugWrapper {
this.takeReplyChecked(msgid);
}
+ get LiveEdit() {
+ const debugContext = %GetDebugContext();
+ return debugContext.Debug.LiveEdit;
+ }
+
// --- Internal methods. -----------------------------------------------------
getNextMessageId() {
@@ -463,7 +502,6 @@ class DebugWrapper {
return { value : () => value,
isUndefined : () => obj.type == "undefined"
};
-
}
evaluateOnCallFrame(frame, expr) {
@@ -480,6 +518,14 @@ class DebugWrapper {
return this.reconstructRemoteObject(result);
}
+ execStateFrameRestart(frame) {
+ const frameid = frame.callFrameId;
+ const {msgid, msg} = this.createMessage(
+ "Debugger.restartFrame", { callFrameId : frameid });
+ this.sendMessage(msg);
+ this.takeReplyChecked(msgid);
+ }
+
execStateFrame(frame) {
const scriptid = parseInt(frame.location.scriptId);
const line = frame.location.lineNumber;
@@ -504,6 +550,7 @@ class DebugWrapper {
localCount : () => this.execStateFrameLocalCount(frame),
localName : (ix) => this.execStateFrameLocalName(frame, ix),
localValue: (ix) => this.execStateFrameLocalValue(frame, ix),
+ restart : () => this.execStateFrameRestart(frame),
scopeCount : () => frame.scopeChain.length,
scope : (index) => this.execStateScope(frame, index),
allScopes : allScopes.bind(this)
« no previous file with comments | « test/debugger/debugger.status ('k') | test/mjsunit/debug-liveedit-1.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698