| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 await dartium.close(); | 149 await dartium.close(); |
| 150 } finally { | 150 } finally { |
| 151 server.close(); | 151 server.close(); |
| 152 } | 152 } |
| 153 }); | 153 }); |
| 154 | 154 |
| 155 test("reports an error in onExit", () { | 155 test("reports an error in onExit", () { |
| 156 var dartium = new Dartium("http://dart-lang.org", | 156 var dartium = new Dartium("http://dart-lang.org", |
| 157 executable: "_does_not_exist"); | 157 executable: "_does_not_exist"); |
| 158 expect(dartium.onExit, throwsA(isApplicationException(startsWith( | 158 expect(dartium.onExit, throwsA(isApplicationException(startsWith( |
| 159 "Failed to start Dartium: $noSuchFileMessage")))); | 159 "Failed to run Dartium: $noSuchFileMessage")))); |
| 160 }); | 160 }); |
| 161 | 161 |
| 162 test("can run successful tests", () { | 162 test("can run successful tests", () { |
| 163 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(""" | 163 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(""" |
| 164 import 'package:test/test.dart'; | 164 import 'package:test/test.dart'; |
| 165 | 165 |
| 166 void main() { | 166 void main() { |
| 167 test("success", () {}); | 167 test("success", () {}); |
| 168 } | 168 } |
| 169 """); | 169 """); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 182 } | 182 } |
| 183 """); | 183 """); |
| 184 | 184 |
| 185 var result = _runTest(["-p", "dartium", "test.dart"]); | 185 var result = _runTest(["-p", "dartium", "test.dart"]); |
| 186 expect(result.exitCode, equals(1)); | 186 expect(result.exitCode, equals(1)); |
| 187 }); | 187 }); |
| 188 } | 188 } |
| 189 | 189 |
| 190 ProcessResult _runTest(List<String> args) => | 190 ProcessResult _runTest(List<String> args) => |
| 191 runTest(args, workingDirectory: _sandbox); | 191 runTest(args, workingDirectory: _sandbox); |
| OLD | NEW |