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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/observatory/.analysis_options ('k') | runtime/vm/message_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/tests/service/issue_30555_test.dart
diff --git a/runtime/observatory/tests/service/issue_30555_test.dart b/runtime/observatory/tests/service/issue_30555_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..2e5d5069b1e1dffb37846d15c093d4d77254c45a
--- /dev/null
+++ b/runtime/observatory/tests/service/issue_30555_test.dart
@@ -0,0 +1,65 @@
+// 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.
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// VMOptions=--error_on_bad_type --error_on_bad_override
+
+import 'dart:async';
+import 'dart:developer';
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'test_helper.dart';
+
+import "dart:isolate" as dart;
+
+void isolate(dart.SendPort port) {
+ dart.RawReceivePort receive = new dart.RawReceivePort((_) {
+ debugger();
+ });
+ 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
+ new Timer.periodic(const Duration(milliseconds: 1), (_) {
+ throw new Exception();
+ });
+}
+
+void test() {
+ dart.RawReceivePort receive = new dart.RawReceivePort((port) {
+ port;
siva 2017/08/28 23:11:31 Maybe remove this line as discussed offline.
cbernaschina 2017/08/28 23:21:27 Done.
+ debugger();
+ });
+ dart.Isolate.spawn(isolate, receive.sendPort);
+}
+
+var tests = [
+ (VM vm) async {
+ await vm.load();
+ int step = 0;
+ var sub = await vm.listenEventStream("Debug", (c) {
+ print(c);
+ switch (step) {
+ case 0: //Resume
+ break;
+ case 1: //PauseOnStart
+ vm.isolates[1].resume();
+ break;
+ case 2: //Resume
+ break;
+ case 3: //Debugger
+ vm.isolates[0]
+ .evalFrame(vm.isolates[0].topFrame.index, "port.send(null);");
+ break;
+ case 4: //PauseOnExit
+ break;
+ case 5:
+ expect(false, isTrue);
+ break;
+ }
siva 2017/08/28 23:11:31 As discussed offline maybe make these events recor
cbernaschina 2017/08/28 23:21:27 Done.
+ step++;
+ });
+ vm.isolates[0].resume();
+ await new Future.delayed(const Duration(seconds: 2));
+ sub.cancel();
+ }
+];
+
+main(args) async => runVMTests(args, tests,
+ pause_on_start: true, pause_on_exit: true, testeeConcurrent: test);
« 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