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

Unified Diff: test/mjsunit/regress/regress-1853.js

Issue 2535733002: [debug] remove debug command processor from regress tests. (Closed)
Patch Set: 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/mjsunit/regress/regress-1639-2.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-1853.js
diff --git a/test/mjsunit/regress/regress-1853.js b/test/mjsunit/regress/regress-1853.js
index 71756888214d88a4a6c4c7132e3b635e90682251..c2d27e2bbdc670690896b275ad8d2a6407cda462 100644
--- a/test/mjsunit/regress/regress-1853.js
+++ b/test/mjsunit/regress/regress-1853.js
@@ -36,38 +36,22 @@ var break_count = 0;
var test_break_1 = false;
var test_break_2 = false;
-function sendCommand(state, cmd) {
- // Get the debug command processor in paused state.
- var dcp = state.debugCommandProcessor(false);
- var request = JSON.stringify(cmd);
- var response = dcp.processDebugJSONRequest(request);
- return JSON.parse(response);
-}
-
function setBreakPointByName(state) {
- sendCommand(state, {
- seq: 0,
- type: "request",
- command: "setbreakpoint",
- arguments: {
- type: "script",
- target: "testScriptOne",
- line: 2
+ var scripts = Debug.scripts();
+ for (var script of scripts) {
+ if (script.source_url == "testScriptOne") {
+ Debug.setScriptBreakPointById(script.id, 2);
}
- });
+ }
}
function setBreakPointByRegExp(state) {
- sendCommand(state, {
- seq: 0,
- type: "request",
- command: "setbreakpoint",
- arguments: {
- type: "scriptRegExp",
- target: "Scrip.Two",
- line: 2
+ var scripts = Debug.scripts();
+ for (var script of scripts) {
+ if (/Scrip.Two/.test(script.source_url)) {
+ Debug.setScriptBreakPointById(script.id, 2);
}
- });
+ }
}
function listener(event, exec_state, event_data, data) {
@@ -96,7 +80,6 @@ function listener(event, exec_state, event_data, data) {
}
Debug.setListener(listener);
-debugger;
eval('function test1() { \n' +
' assertFalse(test_break_1); \n' +
@@ -110,6 +93,8 @@ eval('function test2() { \n' +
'} \n' +
'//# sourceURL=testScriptTwo');
+debugger;
+
test1();
test2();
assertEquals(3, break_count);
« no previous file with comments | « test/mjsunit/regress/regress-1639-2.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698