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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 assertTrue(scope.isScope()); | 85 assertTrue(scope.isScope()); |
86 assertEquals(scopes[i], scope.scopeType()); | 86 assertEquals(scopes[i], scope.scopeType()); |
87 | 87 |
88 // Check the global object when hitting the global scope. | 88 // Check the global object when hitting the global scope. |
89 if (scopes[i] == debug.ScopeType.Global) { | 89 if (scopes[i] == debug.ScopeType.Global) { |
90 assertEquals(this, scope.scopeObject().value()); | 90 assertEquals(this, scope.scopeObject().value()); |
91 } | 91 } |
92 } | 92 } |
93 | 93 |
94 // Get the debug command processor. | 94 // Get the debug command processor. |
95 var dcp = exec_state.debugCommandProcessor(); | 95 var dcp = exec_state.debugCommandProcessor("unspecified_running_state"); |
96 | 96 |
97 // Send a scopes request and check the result. | 97 // Send a scopes request and check the result. |
98 var json; | 98 var json; |
99 request_json = '{"seq":0,"type":"request","command":"scopes"}' | 99 request_json = '{"seq":0,"type":"request","command":"scopes"}' |
100 var response_json = dcp.processDebugJSONRequest(request_json); | 100 var response_json = dcp.processDebugJSONRequest(request_json); |
101 var response = JSON.parse(response_json); | 101 var response = JSON.parse(response_json); |
102 assertEquals(scopes.length, response.body.scopes.length); | 102 assertEquals(scopes.length, response.body.scopes.length); |
103 for (var i = 0; i < scopes.length; i++) { | 103 for (var i = 0; i < scopes.length; i++) { |
104 assertEquals(i, response.body.scopes[i].index); | 104 assertEquals(i, response.body.scopes[i].index); |
105 assertEquals(scopes[i], response.body.scopes[i].type); | 105 assertEquals(scopes[i], response.body.scopes[i].type); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 if (count != scope_size) { | 148 if (count != scope_size) { |
149 print('Names found in scope:'); | 149 print('Names found in scope:'); |
150 var names = scope.scopeObject().propertyNames(); | 150 var names = scope.scopeObject().propertyNames(); |
151 for (var i = 0; i < names.length; i++) { | 151 for (var i = 0; i < names.length; i++) { |
152 print(names[i]); | 152 print(names[i]); |
153 } | 153 } |
154 } | 154 } |
155 assertEquals(count, scope_size); | 155 assertEquals(count, scope_size); |
156 | 156 |
157 // Get the debug command processor. | 157 // Get the debug command processor. |
158 var dcp = exec_state.debugCommandProcessor(); | 158 var dcp = exec_state.debugCommandProcessor("unspecified_running_state"); |
159 | 159 |
160 // Send a scope request for information on a single scope and check the | 160 // Send a scope request for information on a single scope and check the |
161 // result. | 161 // result. |
162 request_json = '{"seq":0,"type":"request","command":"scope","arguments":{"numb
er":' | 162 request_json = '{"seq":0,"type":"request","command":"scope","arguments":{"numb
er":' |
163 request_json += scope.scopeIndex(); | 163 request_json += scope.scopeIndex(); |
164 request_json += '}}' | 164 request_json += '}}' |
165 var response_json = dcp.processDebugJSONRequest(request_json); | 165 var response_json = dcp.processDebugJSONRequest(request_json); |
166 var response = JSON.parse(response_json); | 166 var response = JSON.parse(response_json); |
167 assertEquals(scope.scopeType(), response.body.type); | 167 assertEquals(scope.scopeType(), response.body.type); |
168 assertEquals(number, response.body.index); | 168 assertEquals(number, response.body.index); |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 CheckScopeContent({n:10}, 0, exec_state); | 752 CheckScopeContent({n:10}, 0, exec_state); |
753 CheckScopeContent({e:'Exception'}, 1, exec_state); | 753 CheckScopeContent({e:'Exception'}, 1, exec_state); |
754 CheckScopeContent({y:98}, 2, exec_state); | 754 CheckScopeContent({y:98}, 2, exec_state); |
755 } | 755 } |
756 catch_block_2() | 756 catch_block_2() |
757 EndTest(); | 757 EndTest(); |
758 | 758 |
759 | 759 |
760 assertEquals(begin_test_count, break_count, 'one or more tests did not enter the
debugger'); | 760 assertEquals(begin_test_count, break_count, 'one or more tests did not enter the
debugger'); |
761 assertEquals(begin_test_count, end_test_count, 'one or more tests did not have i
ts result checked'); | 761 assertEquals(begin_test_count, end_test_count, 'one or more tests did not have i
ts result checked'); |
OLD | NEW |