| OLD | NEW |
| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 assertEquals("", response.lookup(frames[1].func.ref).name); | 158 assertEquals("", response.lookup(frames[1].func.ref).name); |
| 159 | 159 |
| 160 // Get the individual frames. | 160 // Get the individual frames. |
| 161 json = '{"seq":0,"type":"request","command":"frame"}' | 161 json = '{"seq":0,"type":"request","command":"frame"}' |
| 162 response = new ParsedResponse(dcp.processDebugJSONRequest(json)); | 162 response = new ParsedResponse(dcp.processDebugJSONRequest(json)); |
| 163 frame = response.body(); | 163 frame = response.body(); |
| 164 assertEquals(0, frame.index); | 164 assertEquals(0, frame.index); |
| 165 assertEquals("f", response.lookup(frame.func.ref).name); | 165 assertEquals("f", response.lookup(frame.func.ref).name); |
| 166 assertTrue(frame.constructCall); | 166 assertTrue(frame.constructCall); |
| 167 assertEquals(31, frame.line); | 167 assertEquals(31, frame.line); |
| 168 assertEquals(3, frame.column); | 168 assertEquals(2, frame.column); |
| 169 assertEquals(2, frame.arguments.length); | 169 assertEquals(2, frame.arguments.length); |
| 170 assertEquals('x', frame.arguments[0].name); | 170 assertEquals('x', frame.arguments[0].name); |
| 171 assertEquals('number', response.lookup(frame.arguments[0].value.ref).type)
; | 171 assertEquals('number', response.lookup(frame.arguments[0].value.ref).type)
; |
| 172 assertEquals(1, response.lookup(frame.arguments[0].value.ref).value); | 172 assertEquals(1, response.lookup(frame.arguments[0].value.ref).value); |
| 173 assertEquals('y', frame.arguments[1].name); | 173 assertEquals('y', frame.arguments[1].name); |
| 174 assertEquals('undefined', response.lookup(frame.arguments[1].value.ref).ty
pe); | 174 assertEquals('undefined', response.lookup(frame.arguments[1].value.ref).ty
pe); |
| 175 | 175 |
| 176 json = '{"seq":0,"type":"request","command":"frame","arguments":{"number":
0}}' | 176 json = '{"seq":0,"type":"request","command":"frame","arguments":{"number":
0}}' |
| 177 response = new ParsedResponse(dcp.processDebugJSONRequest(json)); | 177 response = new ParsedResponse(dcp.processDebugJSONRequest(json)); |
| 178 frame = response.body(); | 178 frame = response.body(); |
| 179 assertEquals(0, frame.index); | 179 assertEquals(0, frame.index); |
| 180 assertEquals("f", response.lookup(frame.func.ref).name); | 180 assertEquals("f", response.lookup(frame.func.ref).name); |
| 181 assertEquals(31, frame.line); | 181 assertEquals(31, frame.line); |
| 182 assertEquals(3, frame.column); | 182 assertEquals(2, frame.column); |
| 183 assertEquals(2, frame.arguments.length); | 183 assertEquals(2, frame.arguments.length); |
| 184 assertEquals('x', frame.arguments[0].name); | 184 assertEquals('x', frame.arguments[0].name); |
| 185 assertEquals('number', response.lookup(frame.arguments[0].value.ref).type)
; | 185 assertEquals('number', response.lookup(frame.arguments[0].value.ref).type)
; |
| 186 assertEquals(1, response.lookup(frame.arguments[0].value.ref).value); | 186 assertEquals(1, response.lookup(frame.arguments[0].value.ref).value); |
| 187 assertEquals('y', frame.arguments[1].name); | 187 assertEquals('y', frame.arguments[1].name); |
| 188 assertEquals('undefined', response.lookup(frame.arguments[1].value.ref).ty
pe); | 188 assertEquals('undefined', response.lookup(frame.arguments[1].value.ref).ty
pe); |
| 189 | 189 |
| 190 json = '{"seq":0,"type":"request","command":"frame","arguments":{"number":
1}}' | 190 json = '{"seq":0,"type":"request","command":"frame","arguments":{"number":
1}}' |
| 191 response = new ParsedResponse(dcp.processDebugJSONRequest(json)); | 191 response = new ParsedResponse(dcp.processDebugJSONRequest(json)); |
| 192 frame = response.body(); | 192 frame = response.body(); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 // Add the debug event listener. | 262 // Add the debug event listener. |
| 263 Debug.setListener(listener); | 263 Debug.setListener(listener); |
| 264 | 264 |
| 265 // Set a break point and call to invoke the debug event listener. | 265 // Set a break point and call to invoke the debug event listener. |
| 266 Debug.setBreakPoint(f, 0, 0); | 266 Debug.setBreakPoint(f, 0, 0); |
| 267 g(); | 267 g(); |
| 268 | 268 |
| 269 // Make sure that the debug event listener vas invoked. | 269 // Make sure that the debug event listener vas invoked. |
| 270 assertFalse(exception, "exception in listener"); | 270 assertFalse(exception, "exception in listener"); |
| 271 assertTrue(listenerCalled); | 271 assertTrue(listenerCalled); |
| OLD | NEW |