Fix tests and analysis warnings and release 0.12.0-beta.9.
R=kevmoo@google.com
Review URL: https://codereview.chromium.org//1094993002
diff --git a/lib/src/runner/loader.dart b/lib/src/runner/loader.dart
index 1b4aafa..4b1f3d7 100644
--- a/lib/src/runner/loader.dart
+++ b/lib/src/runner/loader.dart
@@ -127,7 +127,7 @@
var controller = new StreamController();
Future.forEach(_platforms, (platform) {
if (!metadata.testOn.evaluate(platform, os: currentOS)) {
- return;
+ return null;
}
// Don't load a skipped suite.
@@ -135,7 +135,7 @@
controller.add(new Suite([
new LocalTest(path, metadata, () {})
], path: path, platform: platform.name, metadata: metadata));
- return;
+ return null;
}
return new Future.sync(() {
diff --git a/pubspec.yaml b/pubspec.yaml
index 3aedd58..3e75b4c 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: test
-version: 0.12.0-dev
+version: 0.12.0-beta.9
author: Dart Team <misc@dartlang.org>
description: A library for writing dart unit tests.
homepage: https://github.com/dart-lang/test
diff --git a/test/runner/browser/chrome_test.dart b/test/runner/browser/chrome_test.dart
index 25b86b3..6e2275d 100644
--- a/test/runner/browser/chrome_test.dart
+++ b/test/runner/browser/chrome_test.dart
@@ -14,6 +14,8 @@
import 'package:shelf/shelf_io.dart' as shelf_io;
import 'package:shelf_web_socket/shelf_web_socket.dart';
+import '../../utils.dart';
+
void main() {
group("running JavaScript", () {
// The JavaScript to serve in the server. We use actual JavaScript here to
@@ -80,7 +82,10 @@
return webSocket.first.then(
(message) => expect(message, equals("loaded!")));
}).whenComplete(chrome.close);
- });
+ },
+ // It's not clear why, but this test in particular seems to time out
+ // when run in parallel with many other tests.
+ timeout: new Timeout.factor(2));
test("doesn't preserve state across runs", () {
javaScript = '''
@@ -135,6 +140,7 @@
test("reports an error in onExit", () {
var chrome = new Chrome("http://dart-lang.org",
executable: "_does_not_exist");
- expect(chrome.onExit, throwsA(new isInstanceOf<ProcessException>()));
+ expect(chrome.onExit, throwsA(isApplicationException(startsWith(
+ "Failed to start Chrome: No such file or directory"))));
});
}
diff --git a/test/runner/browser/content_shell_test.dart b/test/runner/browser/content_shell_test.dart
index 6d19209..f176ca8 100644
--- a/test/runner/browser/content_shell_test.dart
+++ b/test/runner/browser/content_shell_test.dart
@@ -15,6 +15,8 @@
import 'package:test/src/utils.dart';
import 'package:test/test.dart';
+import '../../utils.dart';
+
void main() {
group("running Dart", () {
// The Dart to serve in the server.
@@ -141,6 +143,7 @@
test("reports an error in onExit", () {
var contentShell = new ContentShell("http://dart-lang.org",
executable: "_does_not_exist");
- expect(contentShell.onExit, throwsA(new isInstanceOf<ProcessException>()));
+ expect(contentShell.onExit, throwsA(isApplicationException(startsWith(
+ "Failed to start content shell: No such file or directory"))));
});
}
diff --git a/test/runner/browser/dartium_test.dart b/test/runner/browser/dartium_test.dart
index b83e424..4da48ec 100644
--- a/test/runner/browser/dartium_test.dart
+++ b/test/runner/browser/dartium_test.dart
@@ -15,6 +15,8 @@
import 'package:test/src/utils.dart';
import 'package:test/test.dart';
+import '../../utils.dart';
+
void main() {
group("running Dart", () {
// The Dart to serve in the server.
@@ -135,6 +137,7 @@
test("reports an error in onExit", () {
var dartium = new Dartium("http://dart-lang.org",
executable: "_does_not_exist");
- expect(dartium.onExit, throwsA(new isInstanceOf<ProcessException>()));
+ expect(dartium.onExit, throwsA(isApplicationException(startsWith(
+ "Failed to start Dartium: No such file or directory"))));
});
}
diff --git a/test/runner/browser/firefox_test.dart b/test/runner/browser/firefox_test.dart
index 6453f0d..437171b 100644
--- a/test/runner/browser/firefox_test.dart
+++ b/test/runner/browser/firefox_test.dart
@@ -14,6 +14,8 @@
import 'package:shelf/shelf_io.dart' as shelf_io;
import 'package:shelf_web_socket/shelf_web_socket.dart';
+import '../../utils.dart';
+
void main() {
group("running JavaScript", () {
// The JavaScript to serve in the server. We use actual JavaScript here to
@@ -135,6 +137,7 @@
test("reports an error in onExit", () {
var firefox = new Firefox("http://dart-lang.org",
executable: "_does_not_exist");
- expect(firefox.onExit, throwsA(new isInstanceOf<ProcessException>()));
+ expect(firefox.onExit, throwsA(isApplicationException(startsWith(
+ "Failed to start Firefox: No such file or directory"))));
});
}
diff --git a/test/runner/browser/phantom_js_test.dart b/test/runner/browser/phantom_js_test.dart
index 09a5c6b..fd4ec18 100644
--- a/test/runner/browser/phantom_js_test.dart
+++ b/test/runner/browser/phantom_js_test.dart
@@ -14,6 +14,8 @@
import 'package:shelf/shelf_io.dart' as shelf_io;
import 'package:shelf_web_socket/shelf_web_socket.dart';
+import '../../utils.dart';
+
void main() {
group("running JavaScript", () {
// The JavaScript to serve in the server. We use actual JavaScript here to
@@ -139,6 +141,7 @@
test("reports an error in onExit", () {
var phantomJS = new PhantomJS("http://dart-lang.org",
executable: "_does_not_exist");
- expect(phantomJS.onExit, throwsA(new isInstanceOf<ProcessException>()));
+ expect(phantomJS.onExit, throwsA(isApplicationException(startsWith(
+ "Failed to start PhantomJS: No such file or directory"))));
});
}
diff --git a/test/runner/browser/safari_test.dart b/test/runner/browser/safari_test.dart
index f042241..4aa58fc 100644
--- a/test/runner/browser/safari_test.dart
+++ b/test/runner/browser/safari_test.dart
@@ -14,6 +14,8 @@
import 'package:shelf/shelf_io.dart' as shelf_io;
import 'package:shelf_web_socket/shelf_web_socket.dart';
+import '../../utils.dart';
+
void main() {
group("running JavaScript", () {
// The JavaScript to serve in the server. We use actual JavaScript here to
@@ -135,6 +137,7 @@
test("reports an error in onExit", () {
var safari = new Safari("http://dart-lang.org",
executable: "_does_not_exist");
- expect(safari.onExit, throwsA(new isInstanceOf<ProcessException>()));
+ expect(safari.onExit, throwsA(isApplicationException(startsWith(
+ "Failed to start Safari: No such file or directory"))));
});
}