Index: test/runner/browser/runner_test.dart |
diff --git a/test/runner/browser/runner_test.dart b/test/runner/browser/runner_test.dart |
index 7fd8c48906d45800c14da122cf5ecfd4dc820cfd..e8573b8afa48c100d686200149aa835e4d969a2a 100644 |
--- a/test/runner/browser/runner_test.dart |
+++ b/test/runner/browser/runner_test.dart |
@@ -24,6 +24,16 @@ void main() { |
} |
"""; |
+final _failure = """ |
+import 'dart:async'; |
+ |
+import 'package:test/test.dart'; |
+ |
+void main() { |
+ test("failure", () => throw new TestFailure("oh no")); |
+} |
+"""; |
+ |
void main() { |
setUp(() { |
_sandbox = createTempDir(); |
@@ -122,6 +132,13 @@ void main() { |
expect(result.exitCode, equals(0)); |
}); |
+ test("on Dartium", () { |
+ new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_success); |
+ var result = _runUnittest(["-p", "dartium", "test.dart"]); |
+ expect(result.stdout, isNot(contains("Compiling"))); |
+ expect(result.exitCode, equals(0)); |
+ }); |
+ |
test("on multiple browsers", () { |
new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_success); |
var result = _runUnittest(["-p", "firefox", "-p", "chrome", "test.dart"]); |
@@ -129,6 +146,13 @@ void main() { |
expect(result.exitCode, equals(0)); |
}); |
+ test("on a JS and non-JS browser", () { |
+ new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_success); |
+ var result = _runUnittest(["-p", "dartium", "-p", "chrome", "test.dart"]); |
+ expect("Compiling".allMatches(result.stdout), hasLength(1)); |
+ expect(result.exitCode, equals(0)); |
+ }); |
+ |
test("on the browser and the VM", () { |
new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_success); |
var result = _runUnittest(["-p", "chrome", "-p", "vm", "test.dart"]); |
@@ -138,33 +162,23 @@ void main() { |
group("runs failing tests", () { |
test("on Chrome", () { |
- new File(p.join(_sandbox, "test.dart")).writeAsStringSync(""" |
-import 'dart:async'; |
- |
-import 'package:test/test.dart'; |
- |
-void main() { |
- test("failure", () => throw new TestFailure("oh no")); |
-} |
-"""); |
+ new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_failure); |
var result = _runUnittest(["-p", "chrome", "test.dart"]); |
expect(result.exitCode, equals(1)); |
}); |
test("on Firefox", () { |
- new File(p.join(_sandbox, "test.dart")).writeAsStringSync(""" |
-import 'dart:async'; |
- |
-import 'package:test/test.dart'; |
- |
-void main() { |
- test("failure", () => throw new TestFailure("oh no")); |
-} |
-"""); |
+ new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_failure); |
var result = _runUnittest(["-p", "firefox", "test.dart"]); |
expect(result.exitCode, equals(1)); |
}); |
+ test("on Dartium", () { |
+ new File(p.join(_sandbox, "test.dart")).writeAsStringSync(_failure); |
+ var result = _runUnittest(["-p", "dartium", "test.dart"]); |
+ expect(result.exitCode, equals(1)); |
+ }); |
+ |
test("that fail only on the browser", () { |
new File(p.join(_sandbox, "test.dart")).writeAsStringSync(""" |
import 'dart:async'; |