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

Unified Diff: test/mjsunit/debug-changebreakpoint.js

Issue 2557043005: [debugger] remove remaining uses of the debug command processor. (Closed)
Patch Set: fix Created 4 years 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 | « no previous file | test/mjsunit/debug-clearbreakpoint.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/debug-changebreakpoint.js
diff --git a/test/mjsunit/debug-changebreakpoint.js b/test/mjsunit/debug-changebreakpoint.js
index ad43b1749ec3d4dc852fe20ca425575980afe280..69c6359baf3d859c6ee1b3fa5d963fb828375375 100644
--- a/test/mjsunit/debug-changebreakpoint.js
+++ b/test/mjsunit/debug-changebreakpoint.js
@@ -34,55 +34,17 @@ listenerComplete = false;
exception = false;
var breakpoint = -1;
-var base_request = '"seq":0,"type":"request","command":"changebreakpoint"'
-
-function safeEval(code) {
- try {
- return eval('(' + code + ')');
- } catch (e) {
- assertEquals(void 0, e);
- return undefined;
- }
-}
-
-function testArguments(dcp, arguments, success) {
- var request = '{' + base_request + ',"arguments":' + arguments + '}'
- var json_response = dcp.processDebugJSONRequest(request);
- var response = safeEval(json_response);
- if (success) {
- assertTrue(response.success, json_response);
- } else {
- assertFalse(response.success, json_response);
- }
-}
function listener(event, exec_state, event_data, data) {
try {
- if (event == Debug.DebugEvent.Break) {
- // Get the debug command processor.
- var dcp = exec_state.debugCommandProcessor("unspecified_running_state");
-
- // Test some illegal clearbreakpoint requests.
- var request = '{' + base_request + '}'
- var response = safeEval(dcp.processDebugJSONRequest(request));
- assertFalse(response.success);
-
- testArguments(dcp, '{}', false);
- testArguments(dcp, '{"breakpoint":0,"condition":"false"}', false);
- testArguments(dcp, '{"breakpoint":' + (breakpoint + 1) + ',"condition":"false"}', false);
- testArguments(dcp, '{"breakpoint":"xx","condition":"false"}', false);
-
- // Test some legal clearbreakpoint requests.
- var bp_str = '"breakpoint":' + breakpoint;;
- testArguments(dcp, '{' + bp_str + '}', true);
- testArguments(dcp, '{' + bp_str + ',"enabled":"true"}', true);
- testArguments(dcp, '{' + bp_str + ',"enabled":"false"}', true);
- testArguments(dcp, '{' + bp_str + ',"condition":"1==2"}', true);
- testArguments(dcp, '{' + bp_str + ',"condition":"false"}', true);
-
- // Indicate that all was processed.
- listenerComplete = true;
- }
+ if (event == Debug.DebugEvent.Break) {
+ // Test some legal clearbreakpoint requests.
+ Debug.enableBreakPoint(breakpoint);
+ Debug.disableBreakPoint(breakpoint);
+ Debug.changeBreakPointCondition(breakpoint, "1==2");
+ Debug.changeBreakPointCondition(breakpoint, "false");
+ listenerComplete = true;
+ }
} catch (e) {
exception = e
};
« no previous file with comments | « no previous file | test/mjsunit/debug-clearbreakpoint.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698