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

Side by Side Diff: runtime/bin/vmservice/observatory/test/gc_test.dart

Issue 434763002: Add VMService GC events (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2014, 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
5 library gc_test;
6
7 import 'test_helper.dart';
8 import 'package:observatory/service_io.dart';
9 import 'package:unittest/unittest.dart';
10
11 import 'dart:io';
12
13 // Expect at least this many GC events.
14 int gcCountdown = 3;
15
16 void onEvent(ServiceEvent event) {
17 if (event.eventType != 'GC') {
18 return;
19 }
20 if (--gcCountdown == 0) {
21 exit(0);
22 }
23 }
24
25 main() {
26 String script = 'gc_script.dart';
27 var process = new TestLauncher(script);
28 process.launch().then((port) {
29 String addr = 'ws://localhost:$port/ws';
30 new WebSocketVM(new WebSocketVMTarget(addr)).get('vm')
31 .then((VM vm) {
32 vm.events.stream.listen(onEvent);
33 });
34 });
35 }
OLDNEW
« no previous file with comments | « runtime/bin/vmservice/observatory/test/gc_script.dart ('k') | runtime/bin/vmservice/server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698