OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:isolate'; | 6 import 'dart:isolate'; |
7 | 7 |
8 import 'package:path/path.dart' as p; | 8 import 'package:path/path.dart' as p; |
9 import 'package:stream_channel/stream_channel.dart'; | 9 import 'package:stream_channel/stream_channel.dart'; |
10 | 10 |
11 import '../../backend/test_platform.dart'; | 11 import '../../backend/test_platform.dart'; |
12 import '../../util/dart.dart' as dart; | 12 import '../../util/dart.dart' as dart; |
13 import '../configuration.dart'; | 13 import '../configuration.dart'; |
14 import '../load_exception.dart'; | 14 import '../load_exception.dart'; |
15 import '../plugin/platform.dart'; | 15 import '../plugin/platform.dart'; |
16 | 16 |
17 /// A platform that loads tests in isolates spawned within this Dart process. | 17 /// A platform that loads tests in isolates spawned within this Dart process. |
18 class VMPlatform extends PlatformPlugin { | 18 class VMPlatform extends PlatformPlugin { |
19 final platforms = [TestPlatform.vm]; | |
20 | |
21 /// The test runner configuration. | 19 /// The test runner configuration. |
22 final Configuration _config; | 20 final Configuration _config; |
23 | 21 |
24 VMPlatform(this._config); | 22 VMPlatform(this._config); |
25 | 23 |
26 StreamChannel loadChannel(String path, TestPlatform platform) { | 24 StreamChannel loadChannel(String path, TestPlatform platform) { |
27 assert(platform == TestPlatform.vm); | 25 assert(platform == TestPlatform.vm); |
28 | 26 |
29 var isolate; | 27 var isolate; |
30 var channel = StreamChannelCompleter.fromFuture(() async { | 28 var channel = StreamChannelCompleter.fromFuture(() async { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 } else if (error.message.contains("404 Not Found")) { | 86 } else if (error.message.contains("404 Not Found")) { |
89 throw new LoadException(path, | 87 throw new LoadException(path, |
90 "Error getting $url: 404 Not Found\n" | 88 "Error getting $url: 404 Not Found\n" |
91 'Make sure "pub serve" is serving the test/ directory.'); | 89 'Make sure "pub serve" is serving the test/ directory.'); |
92 } | 90 } |
93 | 91 |
94 throw new LoadException(path, error); | 92 throw new LoadException(path, error); |
95 } | 93 } |
96 } | 94 } |
97 } | 95 } |
OLD | NEW |