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

Unified Diff: lib/src/runner/runner_suite.dart

Issue 1263503008: Add an Environment class that's exposed through RunnerSuite. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 5 years, 5 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: lib/src/runner/runner_suite.dart
diff --git a/lib/src/runner/runner_suite.dart b/lib/src/runner/runner_suite.dart
index 10064afe244a84c8fcda7b4e9f23c07c8307297a..2407f69fd267702c984fed1a95b159aa24fb7acc 100644
--- a/lib/src/runner/runner_suite.dart
+++ b/lib/src/runner/runner_suite.dart
@@ -14,6 +14,7 @@ import '../backend/suite.dart';
import '../backend/test.dart';
import '../backend/test_platform.dart';
import '../utils.dart';
+import 'environment.dart';
/// A suite produced and consumed by the test runner that has runner-specific
/// logic and lifecycle management.
@@ -22,33 +23,27 @@ import '../utils.dart';
/// eventually become its own package) is primarily for test code itself to use,
/// for which the [RunnerSuite] APIs don't make sense.
class RunnerSuite extends Suite {
+ final Environment environment;
+
/// The memoizer for running [close] exactly once.
final _closeMemo = new AsyncMemoizer();
/// The function to call when the suite is closed.
final AsyncFunction _onClose;
- RunnerSuite(Iterable<Test> tests, {String path, TestPlatform platform,
- OperatingSystem os, Metadata metadata, AsyncFunction onClose})
+ RunnerSuite(this.environment, Iterable<Test> tests, {String path,
+ TestPlatform platform, OperatingSystem os, Metadata metadata,
+ AsyncFunction onClose})
: super(tests,
path: path, platform: platform, os: os, metadata: metadata),
_onClose = onClose;
- /// Creates a new [RunnerSuite] with the same properties as [suite].
- RunnerSuite.fromSuite(Suite suite)
- : super(suite.tests,
- path: suite.path,
- platform: suite.platform,
- os: suite.os,
- metadata: suite.metadata),
- _onClose = null;
-
RunnerSuite change({String path, Metadata metadata, Iterable<Test> tests}) {
if (path == null) path = this.path;
if (metadata == null) metadata = this.metadata;
if (tests == null) tests = this.tests;
- return new RunnerSuite(tests, platform: platform, os: os, path: path,
- metadata: metadata, onClose: this.close);
+ return new RunnerSuite(environment, tests, platform: platform, os: os,
+ path: path, metadata: metadata, onClose: close);
}
/// Closes the suite and releases any resources associated with it.

Powered by Google App Engine
This is Rietveld 408576698