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

Side by Side Diff: runtime/observatory/test/coverage_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/code_test.dart ('k') | runtime/observatory/test/debugging_test.dart » ('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:unittest/unittest.dart'; 6 import 'package:unittest/unittest.dart';
7 import 'test_helper.dart'; 7 import 'test_helper.dart';
8 import 'dart:async'; 8 import 'dart:async';
9 9
10 int globalVar = 100; 10 int globalVar = 100;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 var tests = [ 52 var tests = [
53 53
54 // Go to breakpoint at line 14. 54 // Go to breakpoint at line 14.
55 (Isolate isolate) { 55 (Isolate isolate) {
56 return isolate.rootLib.load().then((_) { 56 return isolate.rootLib.load().then((_) {
57 // Set up a listener to wait for breakpoint events. 57 // Set up a listener to wait for breakpoint events.
58 Completer completer = new Completer(); 58 Completer completer = new Completer();
59 List events = []; 59 List events = [];
60 isolate.vm.events.stream.listen((ServiceEvent event) { 60 isolate.vm.events.stream.listen((ServiceEvent event) {
61 if (event.eventType == 'BreakpointReached') { 61 if (event.eventType == ServiceEvent.kPauseBreakpoint) {
62 print('Breakpoint reached'); 62 print('Breakpoint reached');
63 completer.complete(); 63 completer.complete();
64 } 64 }
65 }); 65 });
66 66
67 // Create a timer to set a breakpoint with a short delay. 67 // Create a timer to set a breakpoint with a short delay.
68 new Timer(new Duration(milliseconds: 2000), () { 68 new Timer(new Duration(milliseconds: 2000), () {
69 // Add the breakpoint. 69 // Add the breakpoint.
70 print('Setting breakpoint.'); 70 print('Setting breakpoint.');
71 var script = isolate.rootLib.scripts[0]; 71 var script = isolate.rootLib.scripts[0];
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 expect(coverage['coverage'].length, greaterThan(100)); 145 expect(coverage['coverage'].length, greaterThan(100));
146 }); 146 });
147 })); 147 }));
148 return Future.wait(tests); 148 return Future.wait(tests);
149 }); 149 });
150 }, 150 },
151 151
152 ]; 152 ];
153 153
154 main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction); 154 main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction);
OLDNEW
« no previous file with comments | « runtime/observatory/test/code_test.dart ('k') | runtime/observatory/test/debugging_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698