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

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

Issue 3010503002: Avoid to run dart code during paused_on_exit (Closed)
Patch Set: Removed unused import Created 3 years, 3 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
« no previous file with comments | « runtime/observatory/.analysis_options ('k') | runtime/vm/message_handler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
siva 2017/08/28 23:11:31 2017
cbernaschina 2017/08/28 23:21:27 Done.
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 // VMOptions=--error_on_bad_type --error_on_bad_override
5
6 import 'dart:async';
7 import 'dart:developer';
8 import 'package:observatory/service_io.dart';
9 import 'package:unittest/unittest.dart';
10 import 'test_helper.dart';
11
12 import "dart:isolate" as dart;
13
14 void isolate(dart.SendPort port) {
15 dart.RawReceivePort receive = new dart.RawReceivePort((_) {
16 debugger();
17 });
18 port.send(receive.sendPort);
siva 2017/08/28 23:11:31 Maybe move the port send to inside the timer to ma
cbernaschina 2017/08/28 23:21:27 The final logic is changed
19 new Timer.periodic(const Duration(milliseconds: 1), (_) {
20 throw new Exception();
21 });
22 }
23
24 void test() {
25 dart.RawReceivePort receive = new dart.RawReceivePort((port) {
26 port;
siva 2017/08/28 23:11:31 Maybe remove this line as discussed offline.
cbernaschina 2017/08/28 23:21:27 Done.
27 debugger();
28 });
29 dart.Isolate.spawn(isolate, receive.sendPort);
30 }
31
32 var tests = [
33 (VM vm) async {
34 await vm.load();
35 int step = 0;
36 var sub = await vm.listenEventStream("Debug", (c) {
37 print(c);
38 switch (step) {
39 case 0: //Resume
40 break;
41 case 1: //PauseOnStart
42 vm.isolates[1].resume();
43 break;
44 case 2: //Resume
45 break;
46 case 3: //Debugger
47 vm.isolates[0]
48 .evalFrame(vm.isolates[0].topFrame.index, "port.send(null);");
49 break;
50 case 4: //PauseOnExit
51 break;
52 case 5:
53 expect(false, isTrue);
54 break;
55 }
siva 2017/08/28 23:11:31 As discussed offline maybe make these events recor
cbernaschina 2017/08/28 23:21:27 Done.
56 step++;
57 });
58 vm.isolates[0].resume();
59 await new Future.delayed(const Duration(seconds: 2));
60 sub.cancel();
61 }
62 ];
63
64 main(args) async => runVMTests(args, tests,
65 pause_on_start: true, pause_on_exit: true, testeeConcurrent: test);
OLDNEW
« no previous file with comments | « runtime/observatory/.analysis_options ('k') | runtime/vm/message_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698