OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 @TestOn("vm") | 5 @TestOn("vm") |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 | 9 |
10 import 'package:path/path.dart' as p; | 10 import 'package:path/path.dart' as p; |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 .then((server) { | 143 .then((server) { |
144 var dartium = new Dartium(baseUrlForAddress(server.address, server.port)); | 144 var dartium = new Dartium(baseUrlForAddress(server.address, server.port)); |
145 return dartium.close().whenComplete(server.close); | 145 return dartium.close().whenComplete(server.close); |
146 }); | 146 }); |
147 }); | 147 }); |
148 | 148 |
149 test("reports an error in onExit", () { | 149 test("reports an error in onExit", () { |
150 var dartium = new Dartium("http://dart-lang.org", | 150 var dartium = new Dartium("http://dart-lang.org", |
151 executable: "_does_not_exist"); | 151 executable: "_does_not_exist"); |
152 expect(dartium.onExit, throwsA(isApplicationException(startsWith( | 152 expect(dartium.onExit, throwsA(isApplicationException(startsWith( |
153 "Failed to start Dartium: No such file or directory")))); | 153 "Failed to start Dartium: $noSuchFileMessage")))); |
154 }); | 154 }); |
155 | 155 |
156 test("can run successful tests", () { | 156 test("can run successful tests", () { |
157 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(""" | 157 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(""" |
158 import 'package:test/test.dart'; | 158 import 'package:test/test.dart'; |
159 | 159 |
160 void main() { | 160 void main() { |
161 test("success", () {}); | 161 test("success", () {}); |
162 } | 162 } |
163 """); | 163 """); |
(...skipping 12 matching lines...) Expand all Loading... |
176 } | 176 } |
177 """); | 177 """); |
178 | 178 |
179 var result = _runTest(["-p", "dartium", "test.dart"]); | 179 var result = _runTest(["-p", "dartium", "test.dart"]); |
180 expect(result.exitCode, equals(1)); | 180 expect(result.exitCode, equals(1)); |
181 }); | 181 }); |
182 } | 182 } |
183 | 183 |
184 ProcessResult _runTest(List<String> args) => | 184 ProcessResult _runTest(List<String> args) => |
185 runTest(args, workingDirectory: _sandbox); | 185 runTest(args, workingDirectory: _sandbox); |
OLD | NEW |