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

Unified Diff: pkg/scheduled_test/lib/scheduled_process.dart

Issue 12678011: Miscellaneous small improvements for scheduled_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Guard against issue 9151 more thoroughly. Created 7 years, 9 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 | « no previous file | pkg/scheduled_test/lib/src/descriptor/directory_descriptor.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/scheduled_test/lib/scheduled_process.dart
diff --git a/pkg/scheduled_test/lib/scheduled_process.dart b/pkg/scheduled_test/lib/scheduled_process.dart
index 0e277da124b740bbdd3214d9fb99cc57f4726420..57af0b6155fe2531ba8523d721eed07cc244a08d 100644
--- a/pkg/scheduled_test/lib/scheduled_process.dart
+++ b/pkg/scheduled_test/lib/scheduled_process.dart
@@ -21,10 +21,13 @@ import 'src/value_future.dart';
/// If the test fails, this will automatically print out any stdout and stderr
/// from the process to aid debugging.
class ScheduledProcess {
- // A description of the process. Used for error reporting.
+ /// A description of the process. Used for error reporting.
String get description => _description;
String _description;
+ /// Whether a description was passed explicitly by the user.
+ bool _explicitDescription;
+
/// The encoding used for the process's input and output streams.
final Encoding _encoding;
@@ -78,7 +81,9 @@ class ScheduledProcess {
/// containing a mix of strings and [Future]s.
ScheduledProcess.start(executable, arguments,
{options, String description, Encoding encoding: Encoding.UTF_8})
- : _encoding = encoding {
+ : _encoding = encoding,
+ _explicitDescription = description != null,
+ _description = description {
assert(currentSchedule.state == ScheduleState.SET_UP);
_updateDescription(executable, arguments);
@@ -105,6 +110,7 @@ class ScheduledProcess {
/// Updates [_description] to reflect [executable] and [arguments], which are
/// the same values as in [start].
void _updateDescription(executable, arguments) {
+ if (_explicitDescription) return;
if (executable is Future) {
_description = "future process";
} else if (arguments is Future || arguments.any((e) => e is Future)) {
« no previous file with comments | « no previous file | pkg/scheduled_test/lib/src/descriptor/directory_descriptor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698