OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 } | 65 } |
66 | 66 |
67 | 67 |
68 // Send a lookup request and return the evaluated JSON response. | 68 // Send a lookup request and return the evaluated JSON response. |
69 function lookupRequest(exec_state, arguments, success) { | 69 function lookupRequest(exec_state, arguments, success) { |
70 // Get the debug command processor. | 70 // Get the debug command processor. |
71 var dcp = exec_state.debugCommandProcessor("unspecified_running_state"); | 71 var dcp = exec_state.debugCommandProcessor("unspecified_running_state"); |
72 | 72 |
73 // The base part of all lookup requests. | 73 // The base part of all lookup requests. |
74 var base_request = '"seq":0,"type":"request","command":"lookup"' | 74 var base_request = '"seq":0,"type":"request","command":"lookup"' |
75 | 75 |
76 // Generate request with the supplied arguments. | 76 // Generate request with the supplied arguments. |
77 var request; | 77 var request; |
78 if (arguments) { | 78 if (arguments) { |
79 request = '{' + base_request + ',"arguments":' + arguments + '}'; | 79 request = '{' + base_request + ',"arguments":' + arguments + '}'; |
80 } else { | 80 } else { |
81 request = '{' + base_request + '}' | 81 request = '{' + base_request + '}' |
82 } | 82 } |
83 | 83 |
84 var response = safeEval(dcp.processDebugJSONRequest(request)); | 84 var response = safeEval(dcp.processDebugJSONRequest(request)); |
85 if (success) { | 85 if (success) { |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 } | 207 } |
208 } | 208 } |
209 assertEquals(3, count, 'Either "name", "length" or "caller" not found'); | 209 assertEquals(3, count, 'Either "name", "length" or "caller" not found'); |
210 | 210 |
211 count = 0; | 211 count = 0; |
212 for (var handle in response.body) { | 212 for (var handle in response.body) { |
213 assertTrue(refs.indexOf(parseInt(handle)) != -1, | 213 assertTrue(refs.indexOf(parseInt(handle)) != -1, |
214 'Handle not in the request: ' + handle); | 214 'Handle not in the request: ' + handle); |
215 count++; | 215 count++; |
216 } | 216 } |
217 assertEquals(count, obj.properties.length, | 217 assertEquals(count, obj.properties.length, |
218 'Unexpected number of resolved objects'); | 218 'Unexpected number of resolved objects'); |
219 | 219 |
220 | 220 |
221 // Indicate that all was processed. | 221 // Indicate that all was processed. |
222 listenerComplete = true; | 222 listenerComplete = true; |
223 } | 223 } |
224 } catch (e) { | 224 } catch (e) { |
225 exception = e | 225 exception = e |
226 }; | 226 }; |
227 }; | 227 }; |
(...skipping 15 matching lines...) Expand all Loading... |
243 p = {} | 243 p = {} |
244 o.o = o; | 244 o.o = o; |
245 o.p = p; | 245 o.p = p; |
246 p.o = o; | 246 p.o = o; |
247 p.p = p; | 247 p.p = p; |
248 g(o); | 248 g(o); |
249 | 249 |
250 assertFalse(exception, "exception in listener") | 250 assertFalse(exception, "exception in listener") |
251 // Make sure that the debug event listener vas invoked. | 251 // Make sure that the debug event listener vas invoked. |
252 assertTrue(listenerComplete, "listener did not run to completion: " + exception)
; | 252 assertTrue(listenerComplete, "listener did not run to completion: " + exception)
; |
OLD | NEW |