| 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:io'; | 7 import 'dart:io'; |
| 8 | 8 |
| 9 import 'package:path/path.dart' as p; | 9 import 'package:path/path.dart' as p; |
| 10 import 'package:test/src/util/io.dart'; | 10 import 'package:test/src/util/io.dart'; |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 var result = _runUnittest(["-p", "phantomjs", "test.dart"]); | 131 var result = _runUnittest(["-p", "phantomjs", "test.dart"]); |
| 132 expect(result.exitCode, equals(0)); | 132 expect(result.exitCode, equals(0)); |
| 133 }); | 133 }); |
| 134 | 134 |
| 135 test("on Firefox", () { | 135 test("on Firefox", () { |
| 136 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_success); | 136 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_success); |
| 137 var result = _runUnittest(["-p", "firefox", "test.dart"]); | 137 var result = _runUnittest(["-p", "firefox", "test.dart"]); |
| 138 expect(result.exitCode, equals(0)); | 138 expect(result.exitCode, equals(0)); |
| 139 }); | 139 }); |
| 140 | 140 |
| 141 test("on Safari", () { |
| 142 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_success); |
| 143 var result = _runUnittest(["-p", "safari", "test.dart"]); |
| 144 expect(result.exitCode, equals(0)); |
| 145 }, testOn: "mac-os"); |
| 146 |
| 141 test("on Dartium", () { | 147 test("on Dartium", () { |
| 142 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_success); | 148 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_success); |
| 143 var result = _runUnittest(["-p", "dartium", "test.dart"]); | 149 var result = _runUnittest(["-p", "dartium", "test.dart"]); |
| 144 expect(result.stdout, isNot(contains("Compiling"))); | 150 expect(result.stdout, isNot(contains("Compiling"))); |
| 145 expect(result.exitCode, equals(0)); | 151 expect(result.exitCode, equals(0)); |
| 146 }); | 152 }); |
| 147 | 153 |
| 148 test("on content shell", () { | 154 test("on content shell", () { |
| 149 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_success); | 155 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_success); |
| 150 var result = _runUnittest(["-p", "content-shell", "test.dart"]); | 156 var result = _runUnittest(["-p", "content-shell", "test.dart"]); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 var result = _runUnittest(["-p", "phantomjs", "test.dart"]); | 192 var result = _runUnittest(["-p", "phantomjs", "test.dart"]); |
| 187 expect(result.exitCode, equals(1)); | 193 expect(result.exitCode, equals(1)); |
| 188 }); | 194 }); |
| 189 | 195 |
| 190 test("on Firefox", () { | 196 test("on Firefox", () { |
| 191 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_failure); | 197 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_failure); |
| 192 var result = _runUnittest(["-p", "firefox", "test.dart"]); | 198 var result = _runUnittest(["-p", "firefox", "test.dart"]); |
| 193 expect(result.exitCode, equals(1)); | 199 expect(result.exitCode, equals(1)); |
| 194 }); | 200 }); |
| 195 | 201 |
| 202 test("on Safari", () { |
| 203 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_failure); |
| 204 var result = _runUnittest(["-p", "safari", "test.dart"]); |
| 205 expect(result.exitCode, equals(1)); |
| 206 }, testOn: "mac-os"); |
| 207 |
| 196 test("on Dartium", () { | 208 test("on Dartium", () { |
| 197 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_failure); | 209 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_failure); |
| 198 var result = _runUnittest(["-p", "dartium", "test.dart"]); | 210 var result = _runUnittest(["-p", "dartium", "test.dart"]); |
| 199 expect(result.exitCode, equals(1)); | 211 expect(result.exitCode, equals(1)); |
| 200 }); | 212 }); |
| 201 | 213 |
| 202 test("on content-shell", () { | 214 test("on content-shell", () { |
| 203 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_failure); | 215 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_failure); |
| 204 var result = _runUnittest(["-p", "content-shell", "test.dart"]); | 216 var result = _runUnittest(["-p", "content-shell", "test.dart"]); |
| 205 expect(result.exitCode, equals(1)); | 217 expect(result.exitCode, equals(1)); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 '''); | 285 '''); |
| 274 | 286 |
| 275 var result = _runUnittest(["-p", "chrome", "test.dart"]); | 287 var result = _runUnittest(["-p", "chrome", "test.dart"]); |
| 276 expect(result.stdout, contains("Test timed out after 0 seconds.")); | 288 expect(result.stdout, contains("Test timed out after 0 seconds.")); |
| 277 expect(result.stdout, contains("-1: Some tests failed.")); | 289 expect(result.stdout, contains("-1: Some tests failed.")); |
| 278 }); | 290 }); |
| 279 } | 291 } |
| 280 | 292 |
| 281 ProcessResult _runUnittest(List<String> args) => | 293 ProcessResult _runUnittest(List<String> args) => |
| 282 runUnittest(args, workingDirectory: _sandbox); | 294 runUnittest(args, workingDirectory: _sandbox); |
| OLD | NEW |