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

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

Issue 1285643004: Allow stepping when paused at isolate start. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
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.
4 // VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
5
6 import 'package:observatory/service_io.dart';
7 import 'package:unittest/unittest.dart';
8 import 'test_helper.dart';
9 import 'dart:async';
10
11 void testMain() {
12 print('Hello');
13 }
14
15 var tests = [
16
17 (Isolate isolate) async {
18 Completer completer = new Completer();
19 var stream = await isolate.vm.getEventStream(VM.kDebugStream);
20 var subscription;
21 subscription = stream.listen((ServiceEvent event) {
22 if (event.kind == ServiceEvent.kPauseStart) {
23 print('Received PauseStart');
24 subscription.cancel();
25 completer.complete();
26 }
27 });
28
29 if (isolate.pauseEvent != null &&
30 isolate.pauseEvent.kind == ServiceEvent.kPauseStart) {
31 // Wait for the isolate to hit PauseStart.
32 subscription.cancel();
33 } else {
34 await completer.future;
35 }
36
37 completer = new Completer();
38 stream = await isolate.vm.getEventStream(VM.kDebugStream);
39 subscription = stream.listen((ServiceEvent event) {
40 if (event.kind == ServiceEvent.kPauseExit) {
41 print('Received PauseExit');
42 subscription.cancel();
43 completer.complete();
44 }
45 });
46
47 print('Resuming...');
48 isolate.resume();
49
50 // Wait for the isolate to hit PauseExit.
51 await completer.future;
52 },
53
54 ];
55
56 main(args) => runIsolateTests(args, tests,
57 testeeConcurrent: testMain,
58 pause_on_start: true, pause_on_exit: true);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698