Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Unified Diff: test/runner/browser/runner_test.dart

Issue 1080103002: Add support for running tests on Dartium. (Closed) Base URL: git@github.com:dart-lang/test@wip.dartium
Patch Set: Code review changes Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/runner/browser/dartium_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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';
« no previous file with comments | « test/runner/browser/dartium_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698