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

Side by Side Diff: runtime/observatory/tests/service/get_source_report_test.dart

Issue 1586253002: Add PossibleBreakpoints source reporting. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | runtime/vm/debugger.cc » ('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 (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // VMOptions=--error_on_bad_type --error_on_bad_override 4 // VMOptions=--error_on_bad_type --error_on_bad_override
5 5
6 import 'package:observatory/service_io.dart'; 6 import 'package:observatory/service_io.dart';
7 import 'package:unittest/unittest.dart'; 7 import 'package:unittest/unittest.dart';
8 import 'test_helper.dart'; 8 import 'test_helper.dart';
9 import 'dart:developer'; 9 import 'dart:developer';
10 10
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 endsWith('get_source_report_test.dart')); 103 endsWith('get_source_report_test.dart'));
104 104
105 // Full isolate 105 // Full isolate
106 params = { 'reports' : ['Coverage'] }; 106 params = { 'reports' : ['Coverage'] };
107 coverage = await isolate.invokeRpcNoUpgrade('_getSourceReport', params); 107 coverage = await isolate.invokeRpcNoUpgrade('_getSourceReport', params);
108 expect(coverage['type'], equals('SourceReport')); 108 expect(coverage['type'], equals('SourceReport'));
109 expect(coverage['ranges'].length, greaterThan(1)); 109 expect(coverage['ranges'].length, greaterThan(1));
110 expect(coverage['scripts'].length, greaterThan(1)); 110 expect(coverage['scripts'].length, greaterThan(1));
111 111
112 // Multiple reports (make sure enum list parameter parsing works). 112 // Multiple reports (make sure enum list parameter parsing works).
113 params = { 'reports' : ['CallSites', 'Coverage'], 113 params = { 'reports' : ['CallSites', 'Coverage', 'PossibleBreakpoints'],
114 'scriptId' : func.location.script.id, 114 'scriptId' : func.location.script.id,
115 'tokenPos' : func.location.tokenPos, 115 'tokenPos' : func.location.tokenPos,
116 'endTokenPos' : func.location.endTokenPos }; 116 'endTokenPos' : func.location.endTokenPos };
117 coverage = await isolate.invokeRpcNoUpgrade('_getSourceReport', params); 117 coverage = await isolate.invokeRpcNoUpgrade('_getSourceReport', params);
118 expect(coverage['type'], equals('SourceReport')); 118 expect(coverage['type'], equals('SourceReport'));
119 expect(coverage['ranges'].length, 1); 119 expect(coverage['ranges'].length, 1);
120 var range = coverage['ranges'][0]; 120 var range = coverage['ranges'][0];
121 expect(range.containsKey('callSites'), isTrue); 121 expect(range.containsKey('callSites'), isTrue);
122 expect(range.containsKey('coverage'), isTrue); 122 expect(range.containsKey('coverage'), isTrue);
123 expect(range.containsKey('possibleBreakpoints'), isTrue);
123 124
124 // missing scriptId with tokenPos. 125 // missing scriptId with tokenPos.
125 bool caughtException = false; 126 bool caughtException = false;
126 try { 127 try {
127 params = { 'reports' : ['Coverage'], 128 params = { 'reports' : ['Coverage'],
128 'tokenPos' : func.location.tokenPos }; 129 'tokenPos' : func.location.tokenPos };
129 coverage = await isolate.invokeRpcNoUpgrade('_getSourceReport', params); 130 coverage = await isolate.invokeRpcNoUpgrade('_getSourceReport', params);
130 } on ServerRpcException catch(e) { 131 } on ServerRpcException catch(e) {
131 caughtException = true; 132 caughtException = true;
132 expect(e.code, equals(ServerRpcException.kInvalidParams)); 133 expect(e.code, equals(ServerRpcException.kInvalidParams));
(...skipping 15 matching lines...) Expand all
148 expect(e.message, 149 expect(e.message,
149 "_getSourceReport: the 'endTokenPos' parameter requires the " 150 "_getSourceReport: the 'endTokenPos' parameter requires the "
150 "\'scriptId\' parameter"); 151 "\'scriptId\' parameter");
151 } 152 }
152 expect(caughtException, isTrue); 153 expect(caughtException, isTrue);
153 }, 154 },
154 155
155 ]; 156 ];
156 157
157 main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction); 158 main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction);
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698