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

Side by Side Diff: test/mjsunit/debug-evaluate.js

Issue 242034: Redo "running" field in debug-delay.js and support "suspend" command (Closed)
Patch Set: do not remove body from backtrace Created 11 years, 2 months 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 unified diff | Download patch
« no previous file with comments | « test/mjsunit/debug-continue.js ('k') | test/mjsunit/debug-evaluate-recursive.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } else { 52 } else {
53 request = '{' + base_request + '}' 53 request = '{' + base_request + '}'
54 } 54 }
55 var response = safeEval(dcp.processDebugJSONRequest(request)); 55 var response = safeEval(dcp.processDebugJSONRequest(request));
56 if (success) { 56 if (success) {
57 assertTrue(response.success, request + ' -> ' + response.message); 57 assertTrue(response.success, request + ' -> ' + response.message);
58 assertEquals(result, response.body.value); 58 assertEquals(result, response.body.value);
59 } else { 59 } else {
60 assertFalse(response.success, request + ' -> ' + response.message); 60 assertFalse(response.success, request + ' -> ' + response.message);
61 } 61 }
62 assertFalse(response.running, request + ' -> expected not running'); 62 assertEquals(response.running, "unspecified_running_state",
63 request + ' -> expected not running');
63 } 64 }
64 65
65 function listener(event, exec_state, event_data, data) { 66 function listener(event, exec_state, event_data, data) {
66 try { 67 try {
67 if (event == Debug.DebugEvent.Break) { 68 if (event == Debug.DebugEvent.Break) {
68 // Get the debug command processor. 69 // Get the debug command processor.
69 var dcp = exec_state.debugCommandProcessor(); 70 var dcp = exec_state.debugCommandProcessor("unspecified_running_state");
70 71
71 // Test some illegal evaluate requests. 72 // Test some illegal evaluate requests.
72 testRequest(dcp, void 0, false); 73 testRequest(dcp, void 0, false);
73 testRequest(dcp, '{"expression":"1","global"=true}', false); 74 testRequest(dcp, '{"expression":"1","global"=true}', false);
74 testRequest(dcp, '{"expression":"a","frame":4}', false); 75 testRequest(dcp, '{"expression":"a","frame":4}', false);
75 76
76 // Test some legal evaluate requests. 77 // Test some legal evaluate requests.
77 testRequest(dcp, '{"expression":"1+2"}', true, 3); 78 testRequest(dcp, '{"expression":"1+2"}', true, 3);
78 testRequest(dcp, '{"expression":"a+2"}', true, 5); 79 testRequest(dcp, '{"expression":"a+2"}', true, 5);
79 testRequest(dcp, '{"expression":"({\\"a\\":1,\\"b\\":2}).b+2"}', true, 4); 80 testRequest(dcp, '{"expression":"({\\"a\\":1,\\"b\\":2}).b+2"}', true, 4);
(...skipping 25 matching lines...) Expand all
105 var a = 2; 106 var a = 2;
106 f(); 107 f();
107 }; 108 };
108 109
109 a = 1; 110 a = 1;
110 111
111 // Set a break point at return in f and invoke g to hit the breakpoint. 112 // Set a break point at return in f and invoke g to hit the breakpoint.
112 Debug.setBreakPoint(f, 2, 0); 113 Debug.setBreakPoint(f, 2, 0);
113 g(); 114 g();
114 115
116 assertFalse(exception, "exception in listener")
115 // Make sure that the debug event listener vas invoked. 117 // Make sure that the debug event listener vas invoked.
116 assertTrue(listenerComplete, "listener did not run to completion"); 118 assertTrue(listenerComplete, "listener did not run to completion");
117 assertFalse(exception, "exception in listener")
OLDNEW
« no previous file with comments | « test/mjsunit/debug-continue.js ('k') | test/mjsunit/debug-evaluate-recursive.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698