| OLD | NEW |
| 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 /// Used for testing compiler/debugger session when VM socket is closed | 5 /// Used for testing compiler/debugger session when VM socket is closed |
| 6 /// unexpectedly. | 6 /// unexpectedly. |
| 7 library fletchc.test.client.test_vm_connection; | 7 library dartino_compiler.test.client.test_vm_connection; |
| 8 | 8 |
| 9 import 'dart:async' show | 9 import 'dart:async' show |
| 10 Future; | 10 Future; |
| 11 | 11 |
| 12 import 'dart:io' show | 12 import 'dart:io' show |
| 13 InternetAddress; | 13 InternetAddress; |
| 14 | 14 |
| 15 import 'dart:isolate' show | 15 import 'dart:isolate' show |
| 16 SendPort; | 16 SendPort; |
| 17 | 17 |
| 18 import 'package:expect/expect.dart' show | 18 import 'package:expect/expect.dart' show |
| 19 Expect; | 19 Expect; |
| 20 | 20 |
| 21 import 'package:fletchc/src/hub/session_manager.dart' show | 21 import 'package:dartino_compiler/src/hub/session_manager.dart' show |
| 22 SessionState; | 22 SessionState; |
| 23 | 23 |
| 24 import 'package:fletchc/src/worker/developer.dart' show | 24 import 'package:dartino_compiler/src/worker/developer.dart' show |
| 25 attachToVm; | 25 attachToVm; |
| 26 | 26 |
| 27 import 'package:fletchc/vm_commands.dart' show | 27 import 'package:dartino_compiler/vm_commands.dart' show |
| 28 VmCommandCode; | 28 VmCommandCode; |
| 29 | 29 |
| 30 import '../run.dart' show | 30 import '../run.dart' show |
| 31 FletchRunner; | 31 DartinoRunner; |
| 32 | 32 |
| 33 import 'mock_vm.dart' show | 33 import 'mock_vm.dart' show |
| 34 MockVm; | 34 MockVm; |
| 35 | 35 |
| 36 class MockVmRunner extends FletchRunner { | 36 class MockVmRunner extends DartinoRunner { |
| 37 final bool closeImmediately; | 37 final bool closeImmediately; |
| 38 final VmCommandCode closeAfterFirst; | 38 final VmCommandCode closeAfterFirst; |
| 39 | 39 |
| 40 MockVm vm; | 40 MockVm vm; |
| 41 | 41 |
| 42 MockVmRunner({this.closeImmediately: false, this.closeAfterFirst}); | 42 MockVmRunner({this.closeImmediately: false, this.closeAfterFirst}); |
| 43 | 43 |
| 44 Future<Null> attach(SessionState state) async { | 44 Future<Null> attach(SessionState state) async { |
| 45 vm = await MockVm.spawn( | 45 vm = await MockVm.spawn( |
| 46 closeImmediately: closeImmediately, closeAfterFirst: closeAfterFirst); | 46 closeImmediately: closeImmediately, closeAfterFirst: closeAfterFirst); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 75 // TODO(ahe): The actual exit code is TBD. | 75 // TODO(ahe): The actual exit code is TBD. |
| 76 Expect.equals(1, result); | 76 Expect.equals(1, result); |
| 77 } | 77 } |
| 78 | 78 |
| 79 Future<Null> testCloseAfterProcessRun() async { | 79 Future<Null> testCloseAfterProcessRun() async { |
| 80 int result = await new MockVmRunner(closeAfterFirst: VmCommandCode.ProcessRun) | 80 int result = await new MockVmRunner(closeAfterFirst: VmCommandCode.ProcessRun) |
| 81 .run(<String>['tests/language/application_test.dart']); | 81 .run(<String>['tests/language/application_test.dart']); |
| 82 // TODO(ahe): The actual exit code is TBD. | 82 // TODO(ahe): The actual exit code is TBD. |
| 83 Expect.equals(1, result); | 83 Expect.equals(1, result); |
| 84 } | 84 } |
| OLD | NEW |