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

Unified Diff: pkg/scheduled_test/lib/src/descriptor/file_descriptor.dart

Issue 24276010: Change package scheduled_test to throw TestFailures rather than strings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove checks and comments on type of exception thrown. Created 7 years, 3 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: pkg/scheduled_test/lib/src/descriptor/file_descriptor.dart
diff --git a/pkg/scheduled_test/lib/src/descriptor/file_descriptor.dart b/pkg/scheduled_test/lib/src/descriptor/file_descriptor.dart
index eca863ae772dadbe669266d36fe3715e57f422b3..9111b3dd656824a6a479bfd1610d70727fe21d7b 100644
--- a/pkg/scheduled_test/lib/src/descriptor/file_descriptor.dart
+++ b/pkg/scheduled_test/lib/src/descriptor/file_descriptor.dart
@@ -59,7 +59,7 @@ abstract class FileDescriptor extends Descriptor implements ReadableDescriptor {
if (parent == null) parent = defaultRoot;
var fullPath = path.join(parent, name);
if (!new File(fullPath).existsSync()) {
- throw "File not found: '$fullPath'.";
+ fail("File not found: '$fullPath'.");
}
return new File(fullPath).readAsBytes().then(_validateNow);
@@ -84,7 +84,7 @@ class _BinaryFileDescriptor extends FileDescriptor {
Future _validateNow(List<int> actualContents) {
if (orderedIterableEquals(contents, actualContents)) return null;
// TODO(nweiz): show a hex dump here if the data is small enough.
- throw "File '$name' didn't contain the expected binary data.";
+ fail("File '$name' didn't contain the expected binary data.");
}
}

Powered by Google App Engine
This is Rietveld 408576698