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

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

Issue 1589643002: Source positions for constructors and lots of async machinery (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 | « runtime/observatory/tests/service/coverage_test.dart ('k') | runtime/vm/ast.h » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 4
5 library test_helper; 5 library test_helper;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 import 'dart:io'; 9 import 'dart:io';
10 import 'package:observatory/service_io.dart'; 10 import 'package:observatory/service_io.dart';
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 print("Checking we are at line $line"); 248 print("Checking we are at line $line");
249 249
250 ServiceMap stack = await isolate.getStack(); 250 ServiceMap stack = await isolate.getStack();
251 expect(stack.type, equals('Stack')); 251 expect(stack.type, equals('Stack'));
252 252
253 List<Frame> frames = stack['frames']; 253 List<Frame> frames = stack['frames'];
254 expect(frames.length, greaterThanOrEqualTo(1)); 254 expect(frames.length, greaterThanOrEqualTo(1));
255 255
256 Frame top = frames[0]; 256 Frame top = frames[0];
257 Script script = await top.location.script.load(); 257 Script script = await top.location.script.load();
258 if (script.tokenToLine(top.location.tokenPos) != line) { 258 int actualLine = script.tokenToLine(top.location.tokenPos);
259 if (actualLine != line) {
259 var sb = new StringBuffer(); 260 var sb = new StringBuffer();
260 sb.write("Expected to be at line $line, but got stack trace:\n"); 261 sb.write("Expected to be at line $line but actually at line $actualLine");
262 sb.write("\nFull stack trace:\n");
261 for (Frame f in stack['frames']) { 263 for (Frame f in stack['frames']) {
262 sb.write(" $f\n"); 264 sb.write(" $f\n");
263 } 265 }
264 throw sb.toString(); 266 throw sb.toString();
265 } 267 }
266 }; 268 };
267 } 269 }
268 270
269 271
270 Future<Isolate> resumeIsolate(Isolate isolate) { 272 Future<Isolate> resumeIsolate(Isolate isolate) {
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 }, onError: (e, st) { 382 }, onError: (e, st) {
381 process.requestExit(); 383 process.requestExit();
382 if (!_isWebSocketDisconnect(e)) { 384 if (!_isWebSocketDisconnect(e)) {
383 print('Unexpected exception in service tests: $e $st'); 385 print('Unexpected exception in service tests: $e $st');
384 throw e; 386 throw e;
385 } 387 }
386 }); 388 });
387 }); 389 });
388 } 390 }
389 } 391 }
OLDNEW
« no previous file with comments | « runtime/observatory/tests/service/coverage_test.dart ('k') | runtime/vm/ast.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698