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

Side by Side Diff: runtime/observatory/test/source_location_test.dart

Issue 979823003: Major rework of vm service events. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « runtime/observatory/test/isolate_lifecycle_test.dart ('k') | runtime/vm/dart_api_impl.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) 2015, the Dart project authors. Please see the AUTHORS file 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 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 'package:observatory/service_io.dart'; 5 import 'package:observatory/service_io.dart';
6 import 'package:observatory/debugger.dart'; 6 import 'package:observatory/debugger.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:async'; 9 import 'dart:async';
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } 47 }
48 48
49 var tests = [ 49 var tests = [
50 50
51 // Bring the isolate to a breakpoint at line 14. 51 // Bring the isolate to a breakpoint at line 14.
52 (Isolate isolate) { 52 (Isolate isolate) {
53 return isolate.rootLib.load().then((_) { 53 return isolate.rootLib.load().then((_) {
54 // Listen for breakpoint event. 54 // Listen for breakpoint event.
55 Completer completer = new Completer(); 55 Completer completer = new Completer();
56 isolate.vm.events.stream.listen((ServiceEvent event) { 56 isolate.vm.events.stream.listen((ServiceEvent event) {
57 if (event.eventType == 'BreakpointReached') { 57 if (event.eventType == ServiceEvent.kPauseBreakpoint) {
58 completer.complete(); 58 completer.complete();
59 } 59 }
60 }); 60 });
61 61
62 // Add the breakpoint. 62 // Add the breakpoint.
63 var script = isolate.rootLib.scripts[0]; 63 var script = isolate.rootLib.scripts[0];
64 return isolate.addBreakpoint(script, 14).then((ServiceObject bpt) { 64 return isolate.addBreakpoint(script, 14).then((ServiceObject bpt) {
65 return completer.future; // Wait for breakpoint events. 65 return completer.future; // Wait for breakpoint events.
66 }); 66 });
67 }); 67 });
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 return SourceLocation.complete(debugger, 'SourceLocationTestFoo.q') 269 return SourceLocation.complete(debugger, 'SourceLocationTestFoo.q')
270 .then((List<String> completions) { 270 .then((List<String> completions) {
271 expect(completions.toString(), equals('[]')); 271 expect(completions.toString(), equals('[]'));
272 }); 272 });
273 }); 273 });
274 }, 274 },
275 275
276 ]; 276 ];
277 277
278 main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction); 278 main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction);
OLDNEW
« no previous file with comments | « runtime/observatory/test/isolate_lifecycle_test.dart ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698