| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 // | 4 // |
| 5 // This is the original dart program that was used to generate the snapshot | 5 // This is the original dart program that was used to generate the snapshot |
| 6 // in file issue14236_test.dart | 6 // in file issue14236_test.dart |
| 7 // The original test/main has been commented out and we have a test/main which | 7 // The original test/main has been commented out and we have a test/main which |
| 8 // throws an error to ensure that this file is not executed as part of the | 8 // throws an error to ensure that this file is not executed as part of the |
| 9 // test. | 9 // test. |
| 10 // | 10 // |
| 11 // When issue14236_test.dart fails, you must regenerate it using the VM | 11 // When issue14236_test.dart fails, you must regenerate it using the VM |
| 12 // with your changes. You should understand what in your change makes | 12 // with your changes. You should understand what in your change makes |
| 13 // regeneration of the snapshot necessary. | 13 // regeneration of the snapshot necessary. |
| 14 // Steps for regenerating: | 14 // Steps for regenerating: |
| 15 // 1) Swap the test functions below. | 15 // 1) Swap the test functions below. |
| 16 // 2) $ ./xcodebuild/DebugIA32/dart --package-root=./xcodebuild/DebugIA32/packag
es --snapshot=tests/standalone/issue14236_test.dart tests/standalone/issue14236_
source.dart | 16 // 2) $ ./xcodebuild/DebugIA32/dart --package-root=./xcodebuild/DebugIA32/packag
es --snapshot=tests/standalone/issue14236_test.dart tests/standalone/issue14236_
source.dart |
| 17 // OR: |
| 18 // 2) $ ./out/DebugIA32/dart --package-root=./out/DebugIA32/packages --snapshot=
tests/standalone/issue14236_test.dart tests/standalone/issue14236_source.dart |
| 17 // 3) Undo changes in 1. | 19 // 3) Undo changes in 1. |
| 18 | 20 |
| 19 library test.issue14236; | 21 library test.issue14236; |
| 20 import "dart:isolate"; | 22 import "dart:isolate"; |
| 21 import "package:expect/expect.dart"; | 23 import "package:expect/expect.dart"; |
| 22 import "package:async_helper/async_helper.dart"; | 24 import "package:async_helper/async_helper.dart"; |
| 23 | 25 |
| 24 | 26 |
| 25 /* | 27 /* |
| 26 test(SendPort replyTo) { | 28 test(SendPort replyTo) { |
| 27 replyTo.send("from Isolate"); | 29 replyTo.send("from Isolate"); |
| 28 } | 30 } |
| 29 */ | 31 */ |
| 30 | 32 |
| 31 test(dummy) { | 33 test(dummy) { |
| 32 Expect.fail("Don't expect this to run at all"); | 34 Expect.fail("Don't expect this to run at all"); |
| 33 } | 35 } |
| 34 | 36 |
| 35 main() { | 37 main() { |
| 36 asyncStart(); | 38 asyncStart(); |
| 37 ReceivePort port = new ReceivePort(); | 39 ReceivePort port = new ReceivePort(); |
| 38 Isolate.spawn(test, port.sendPort); | 40 Isolate.spawn(test, port.sendPort); |
| 39 port.first.then((msg) { | 41 port.first.then((msg) { |
| 40 Expect.equals("from Isolate", msg); | 42 Expect.equals("from Isolate", msg); |
| 41 asyncEnd(); | 43 asyncEnd(); |
| 42 }); | 44 }); |
| 43 } | 45 } |
| OLD | NEW |