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

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

Issue 983573002: Add support for running browser tests to the test runner. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Created 5 years, 10 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
Index: test/runner/browser/compact_reporter_test.dart
diff --git a/test/runner/browser/compact_reporter_test.dart b/test/runner/browser/compact_reporter_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..6af92fe5fd14846734899aba7c792babb97e7980
--- /dev/null
+++ b/test/runner/browser/compact_reporter_test.dart
@@ -0,0 +1,43 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:io';
+
+import 'package:path/path.dart' as p;
+import 'package:unittest/unittest.dart';
+
+import '../../io.dart';
+
+String _sandbox;
+
+void main() {
+ setUp(() {
+ _sandbox = Directory.systemTemp.createTempSync('unittest_').path;
+ });
+
+ tearDown(() {
+ new Directory(_sandbox).deleteSync(recursive: true);
+ });
+
+ test("prints the platform name when running on multiple platforms", () {
+ new File(p.join(_sandbox, "test.dart")).writeAsStringSync("""
+import 'dart:async';
+
+import 'package:path/path.dart' as p;
+import 'package:unittest/unittest.dart';
+
+void main() {
+ test("success", () {});
+}
+""");
+
+ var result = _runUnittest(["-p", "chrome", "-p", "vm", "test.dart"]);
+ expect(result.stdout, contains("[VM]"));
+ expect(result.stdout, contains("[Chrome]"));
+ expect(result.exitCode, equals(0));
+ });
+}
+
+ProcessResult _runUnittest(List<String> args) =>
+ runUnittest(args, workingDirectory: _sandbox);

Powered by Google App Engine
This is Rietveld 408576698