OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 // Dart test program for testing that errors thrown from isolates are | 5 // Dart test program for testing that errors thrown from isolates are |
6 // processed correctly and don't result in crashes. | 6 // processed correctly and don't result in crashes. |
7 | 7 |
8 #library('Isolate3NegativeTest'); | 8 #library('Isolate3NegativeTest'); |
9 #import("TestFramework.dart"); | 9 #import('dart:isolate'); |
| 10 #import('TestFramework.dart'); |
10 | 11 |
11 class TestClass { | 12 class TestClass { |
12 TestClass.named(num this.fld1) : fld2=fld1 { | 13 TestClass.named(num this.fld1) : fld2=fld1 { |
13 TestClass.i = 0; // Should cause a compilation error. | 14 TestClass.i = 0; // Should cause a compilation error. |
14 } | 15 } |
15 num fld1; | 16 num fld1; |
16 num fld2; | 17 num fld2; |
17 } | 18 } |
18 | 19 |
19 class Isolate3NegativeTest extends Isolate { | 20 class Isolate3NegativeTest extends Isolate { |
(...skipping 13 matching lines...) Expand all Loading... |
33 } | 34 } |
34 void spawn_callback(SendPort port) { | 35 void spawn_callback(SendPort port) { |
35 port.call("foo").receive(expect.runs2(msg_callback)); | 36 port.call("foo").receive(expect.runs2(msg_callback)); |
36 } | 37 } |
37 expect.completes(new Isolate3NegativeTest().spawn()).then(spawn_callback); | 38 expect.completes(new Isolate3NegativeTest().spawn()).then(spawn_callback); |
38 } | 39 } |
39 | 40 |
40 main() { | 41 main() { |
41 runTests([test]); | 42 runTests([test]); |
42 } | 43 } |
OLD | NEW |