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

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

Issue 2680303002: Kernel debugging; service tests (Closed)
Patch Set: New failing test Created 3 years, 10 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
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 // VMOptions=--error_on_bad_type --error_on_bad_override --vm-name=Walter 4 // VMOptions=--error_on_bad_type --error_on_bad_override --vm-name=Walter
5 5
6 import 'package:observatory/service_io.dart'; 6 import 'package:observatory/service_io.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
11 var tests = [ 11 var tests = [
12 (Isolate isolate) async { 12 (Isolate isolate) async {
13 expect(isolate.name, equals('set_name_rpc_test.dart\$main')); 13 if (isKernel(isolate)) {
Cutch 2017/02/08 16:48:20 dito
14 expect(isolate.name, equals('out.dill\$main'));
15 } else {
16 expect(isolate.name, equals('set_name_rpc_test.dart\$main'));
17 }
14 18
15 Completer completer = new Completer(); 19 Completer completer = new Completer();
16 var stream = await isolate.vm.getEventStream(VM.kIsolateStream); 20 var stream = await isolate.vm.getEventStream(VM.kIsolateStream);
17 var subscription; 21 var subscription;
18 subscription = stream.listen((ServiceEvent event) { 22 subscription = stream.listen((ServiceEvent event) {
19 if (event.kind == ServiceEvent.kIsolateUpdate) { 23 if (event.kind == ServiceEvent.kIsolateUpdate) {
20 expect(event.owner.type, equals('Isolate')); 24 expect(event.owner.type, equals('Isolate'));
21 expect(event.owner.name, equals('Barbara')); 25 expect(event.owner.name, equals('Barbara'));
22 subscription.cancel(); 26 subscription.cancel();
23 completer.complete(); 27 completer.complete();
24 } 28 }
25 }); 29 });
26 30
27 var result = await isolate.setName('Barbara'); 31 var result = await isolate.setName('Barbara');
28 expect(result.type, equals('Success')); 32 expect(result.type, equals('Success'));
29 33
30 await completer.future; 34 await completer.future;
31 expect(isolate.name, equals('Barbara')); 35 expect(isolate.name, equals('Barbara'));
32
33 } 36 }
34 ]; 37 ];
35 38
36 main(args) async => runIsolateTests(args, tests); 39 main(args) async => runIsolateTests(args, tests);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698