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

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

Issue 1726773002: Refactor service tests in preparation of running on sky_shell (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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=--compile-all --error_on_bad_type --error_on_bad_override 4 // VMOptions=--compile-all --error_on_bad_type --error_on_bad_override
5 5
6 import 'dart:async'; 6 import 'dart:async';
7 import 'dart:developer'; 7 import 'dart:developer';
8 import 'package:observatory/service_io.dart'; 8 import 'package:observatory/service_io.dart';
9 import 'package:unittest/unittest.dart'; 9 import 'package:unittest/unittest.dart';
10 import 'service_test_common.dart';
10 import 'test_helper.dart'; 11 import 'test_helper.dart';
11 12
12 int count = 0; 13 int count = 0;
13 14
14 void test() { 15 void test() {
15 while (true) { 16 while (true) {
16 count++; 17 count++;
17 debugger(); 18 debugger();
18 } 19 }
19 } 20 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 newIsolate.rootLibrary.evaluate('count').then((result) { 63 newIsolate.rootLibrary.evaluate('count').then((result) {
63 expect(result.type, equals('Instance')); 64 expect(result.type, equals('Instance'));
64 expect(result.valueAsString, equals('1')); 65 expect(result.valueAsString, equals('1'));
65 debugSub.cancel(); 66 debugSub.cancel();
66 testCompleter.complete(); 67 testCompleter.complete();
67 }); 68 });
68 }); 69 });
69 } 70 }
70 } 71 }
71 }); 72 });
72 73
73 Completer restartCompleter = new Completer(); 74 Completer restartCompleter = new Completer();
74 var isolateStream = await isolate.vm.getEventStream(VM.kIsolateStream); 75 var isolateStream = await isolate.vm.getEventStream(VM.kIsolateStream);
75 var isolateSub; 76 var isolateSub;
76 bool exit = false; 77 bool exit = false;
77 bool start = false; 78 bool start = false;
78 isolateSub = isolateStream.listen((ServiceEvent event) { 79 isolateSub = isolateStream.listen((ServiceEvent event) {
79 if (event.kind == ServiceEvent.kIsolateExit) { 80 if (event.kind == ServiceEvent.kIsolateExit) {
80 expect(event.isolate, equals(isolate)); 81 expect(event.isolate, equals(isolate));
81 print('Old isolate exited'); 82 print('Old isolate exited');
82 exit = true; 83 exit = true;
(...skipping 11 matching lines...) Expand all
94 95
95 // Restart the vm. 96 // Restart the vm.
96 print("restarting"); 97 print("restarting");
97 await isolate.vm.restart(); 98 await isolate.vm.restart();
98 await restartCompleter.future; 99 await restartCompleter.future;
99 print("restarted"); 100 print("restarted");
100 await testCompleter.future; 101 await testCompleter.future;
101 }, 102 },
102 ]; 103 ];
103 104
104 105
105 main(args) => runIsolateTests(args, tests, testeeConcurrent: test); 106 main(args) => runIsolateTests(args, tests, testeeConcurrent: test);
OLDNEW
« no previous file with comments | « runtime/observatory/tests/service/test_helper.dart ('k') | runtime/observatory/tests/service/vm_timeline_flags_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698