| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 await firefox.close(); | 147 await firefox.close(); |
| 148 } finally { | 148 } finally { |
| 149 server.close(); | 149 server.close(); |
| 150 } | 150 } |
| 151 }); | 151 }); |
| 152 | 152 |
| 153 test("reports an error in onExit", () { | 153 test("reports an error in onExit", () { |
| 154 var firefox = new Firefox("http://dart-lang.org", | 154 var firefox = new Firefox("http://dart-lang.org", |
| 155 executable: "_does_not_exist"); | 155 executable: "_does_not_exist"); |
| 156 expect(firefox.onExit, throwsA(isApplicationException(startsWith( | 156 expect(firefox.onExit, throwsA(isApplicationException(startsWith( |
| 157 "Failed to start Firefox: $noSuchFileMessage")))); | 157 "Failed to run Firefox: $noSuchFileMessage")))); |
| 158 }); | 158 }); |
| 159 | 159 |
| 160 group("can run successful tests", () { | 160 group("can run successful tests", () { |
| 161 setUp(() { | 161 setUp(() { |
| 162 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(""" | 162 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(""" |
| 163 import 'package:test/test.dart'; | 163 import 'package:test/test.dart'; |
| 164 | 164 |
| 165 void main() { | 165 void main() { |
| 166 test("success", () {}); | 166 test("success", () {}); |
| 167 } | 167 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 189 } | 189 } |
| 190 """); | 190 """); |
| 191 | 191 |
| 192 var result = _runTest(["-p", "firefox", "test.dart"]); | 192 var result = _runTest(["-p", "firefox", "test.dart"]); |
| 193 expect(result.exitCode, equals(1)); | 193 expect(result.exitCode, equals(1)); |
| 194 }); | 194 }); |
| 195 } | 195 } |
| 196 | 196 |
| 197 ProcessResult _runTest(List<String> args) => | 197 ProcessResult _runTest(List<String> args) => |
| 198 runTest(args, workingDirectory: _sandbox); | 198 runTest(args, workingDirectory: _sandbox); |
| OLD | NEW |