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

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

Issue 2304463002: Converted Observatory vm-view && isolate-view elements (Closed)
Patch Set: Fixed typo Created 4 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
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 4 // VMOptions=--error_on_bad_type --error_on_bad_override
5 5
6 import 'dart:developer'; 6 import 'dart:developer';
7 import 'dart:io'; 7 import 'dart:io';
8 import 'dart:isolate' show ReceivePort; 8 import 'dart:isolate' show ReceivePort;
9 import 'package:observatory/models.dart' as M;
9 import 'package:observatory/service_io.dart'; 10 import 'package:observatory/service_io.dart';
10 import 'package:unittest/unittest.dart'; 11 import 'package:unittest/unittest.dart';
11 import 'service_test_common.dart'; 12 import 'service_test_common.dart';
12 import 'test_helper.dart'; 13 import 'test_helper.dart';
13 14
14 var receivePort; 15 var receivePort;
15 16
16 void testMain() { 17 void testMain() {
17 receivePort = new ReceivePort(); 18 receivePort = new ReceivePort();
18 debugger(); 19 debugger();
(...skipping 11 matching lines...) Expand all
30 // the stack until it becomes empty. 31 // the stack until it becomes empty.
31 var frameCount; 32 var frameCount;
32 do { 33 do {
33 var stack = await isolate.getStack(); 34 var stack = await isolate.getStack();
34 frameCount = stack['frames'].length; 35 frameCount = stack['frames'].length;
35 print('Frames: $frameCount'); 36 print('Frames: $frameCount');
36 sleep(const Duration(milliseconds:10)); 37 sleep(const Duration(milliseconds:10));
37 } while (frameCount > 0); 38 } while (frameCount > 0);
38 print('Isolate is idle.'); 39 print('Isolate is idle.');
39 await isolate.reload(); 40 await isolate.reload();
40 expect(isolate.pauseEvent.kind, equals(ServiceEvent.kResume)); 41 expect(isolate.pauseEvent is M.ResumeEvent, isTrue);
41 42
42 // Make sure that the isolate receives an interrupt even when it is 43 // Make sure that the isolate receives an interrupt even when it is
43 // idle. (https://github.com/dart-lang/sdk/issues/24349) 44 // idle. (https://github.com/dart-lang/sdk/issues/24349)
44 var interruptFuture = hasPausedFor(isolate, ServiceEvent.kPauseInterrupted); 45 var interruptFuture = hasPausedFor(isolate, ServiceEvent.kPauseInterrupted);
45 print('Pausing...'); 46 print('Pausing...');
46 await isolate.pause(); 47 await isolate.pause();
47 await interruptFuture; 48 await interruptFuture;
48 }, 49 },
49 50
50 ]; 51 ];
51 52
52 main(args) => runIsolateTests(args, tests, 53 main(args) => runIsolateTests(args, tests,
53 testeeConcurrent: testMain, 54 testeeConcurrent: testMain,
54 trace_service: true, 55 trace_service: true,
55 verbose_vm: true); 56 verbose_vm: true);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698