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

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

Issue 1584173003: Use getSourceReport for coverage/callsites in Observatory. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: cleanups 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
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'],
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 123
(...skipping 24 matching lines...) Expand all
148 expect(e.message, 148 expect(e.message,
149 "_getSourceReport: the 'endTokenPos' parameter requires the " 149 "_getSourceReport: the 'endTokenPos' parameter requires the "
150 "\'scriptId\' parameter"); 150 "\'scriptId\' parameter");
151 } 151 }
152 expect(caughtException, isTrue); 152 expect(caughtException, isTrue);
153 }, 153 },
154 154
155 ]; 155 ];
156 156
157 main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction); 157 main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698