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

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

Issue 1088453004: Move browser tests that require installation into their own files. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: 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/compact_reporter_test.dart ('k') | test/runner/browser/firefox_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/runner/browser/dartium_test.dart
diff --git a/test/runner/browser/dartium_test.dart b/test/runner/browser/dartium_test.dart
index 77d66e5c2acd0498dad4b03c2e011c47965b56ba..49aedf09c52bf8905ee4bf9b8399a827479b15d8 100644
--- a/test/runner/browser/dartium_test.dart
+++ b/test/runner/browser/dartium_test.dart
@@ -5,7 +5,9 @@
@TestOn("vm")
import 'dart:async';
+import 'dart:io';
+import 'package:path/path.dart' as p;
import 'package:shelf/shelf.dart' as shelf;
import 'package:shelf/shelf_io.dart' as shelf_io;
import 'package:shelf_web_socket/shelf_web_socket.dart';
@@ -14,9 +16,20 @@ import 'package:test/src/util/io.dart';
import 'package:test/src/utils.dart';
import 'package:test/test.dart';
+import '../../io.dart';
import '../../utils.dart';
+String _sandbox;
+
void main() {
+ setUp(() {
+ _sandbox = createTempDir();
+ });
+
+ tearDown(() {
+ new Directory(_sandbox).deleteSync(recursive: true);
+ });
+
group("running Dart", () {
// The Dart to serve in the server.
var dart;
@@ -139,4 +152,34 @@ webSocket.onOpen.first.then((_) =>
expect(dartium.onExit, throwsA(isApplicationException(startsWith(
"Failed to start Dartium: No such file or directory"))));
});
+
+ test("can run successful tests", () {
+ new File(p.join(_sandbox, "test.dart")).writeAsStringSync("""
+import 'package:test/test.dart';
+
+void main() {
+ test("success", () {});
+}
+""");
+
+ var result = _runTest(["-p", "dartium", "test.dart"]);
+ expect(result.stdout, isNot(contains("Compiling")));
+ expect(result.exitCode, equals(0));
+ });
+
+ test("can run failing tests", () {
+ new File(p.join(_sandbox, "test.dart")).writeAsStringSync("""
+import 'package:test/test.dart';
+
+void main() {
+ test("failure", () => throw new TestFailure("oh no"));
+}
+""");
+
+ var result = _runTest(["-p", "dartium", "test.dart"]);
+ expect(result.exitCode, equals(1));
+ });
}
+
+ProcessResult _runTest(List<String> args) =>
+ runTest(args, workingDirectory: _sandbox);
« no previous file with comments | « test/runner/browser/compact_reporter_test.dart ('k') | test/runner/browser/firefox_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698