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

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

Issue 2647573006: Fix service test script to avoid unhandled exception. (Closed)
Patch Set: Created 3 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 | no next file » | 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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 import 'dart:async'; 5 import 'dart:async';
6 import 'test_helper.dart'; 6 import 'test_helper.dart';
7 import 'service_test_common.dart'; 7 import 'service_test_common.dart';
8 import 'package:observatory/service_io.dart'; 8 import 'package:observatory/service_io.dart';
9 import 'package:unittest/unittest.dart'; 9 import 'package:unittest/unittest.dart';
10 10
(...skipping 13 matching lines...) Expand all
24 vmService = new VMServiceClient(uri); 24 vmService = new VMServiceClient(uri);
25 await new Future.microtask(() => throw new TimeoutException("here")); 25 await new Future.microtask(() => throw new TimeoutException("here"));
26 } on dynamic { 26 } on dynamic {
27 vmService.close(); 27 vmService.close();
28 rethrow; // LINE_A 28 rethrow; // LINE_A
29 } 29 }
30 }); 30 });
31 } 31 }
32 32
33 test_code() async { // LINE_B 33 test_code() async { // LINE_B
34 await collect(); 34 try {
35 await collect();
36 } on TimeoutException {
37 print("ok");
38 }
35 } 39 }
36 40
37 Future<Isolate> stepThroughProgram(Isolate isolate) async { 41 Future<Isolate> stepThroughProgram(Isolate isolate) async {
38 Completer completer = new Completer(); 42 Completer completer = new Completer();
39 int pauseEventsSeen = 0; 43 int pauseEventsSeen = 0;
40 44
41 await subscribeToStream(isolate.vm, VM.kDebugStream, 45 await subscribeToStream(isolate.vm, VM.kDebugStream,
42 (ServiceEvent event) async { 46 (ServiceEvent event) async {
43 if (event.kind == ServiceEvent.kPauseBreakpoint) { 47 if (event.kind == ServiceEvent.kPauseBreakpoint) {
44 // We are paused: Step further. 48 // We are paused: Step further.
(...skipping 17 matching lines...) Expand all
62 hasStoppedAtBreakpoint, 66 hasStoppedAtBreakpoint,
63 setBreakpointAtLine(LINE_A), 67 setBreakpointAtLine(LINE_A),
64 resumeIsolate, 68 resumeIsolate,
65 hasStoppedAtBreakpoint, 69 hasStoppedAtBreakpoint,
66 stepOut, 70 stepOut,
67 stoppedAtLine(LINE_B), 71 stoppedAtLine(LINE_B),
68 resumeIsolate]; 72 resumeIsolate];
69 73
70 main(args) => runIsolateTestsSynchronous(args, tests, 74 main(args) => runIsolateTestsSynchronous(args, tests,
71 testeeConcurrent: test_code, pause_on_start: true, pause_on_exit: false); 75 testeeConcurrent: test_code, pause_on_start: true, pause_on_exit: false);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698