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

Unified Diff: utils/tests/pub/test_pub.dart

Issue 11943005: Make integration tests a bit cleaner. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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: utils/tests/pub/test_pub.dart
diff --git a/utils/tests/pub/test_pub.dart b/utils/tests/pub/test_pub.dart
index 87053b9a3f1b4ae0e6e09a2e6c44b570b8d27f5b..975e36f60c54caf8fa6654c255dd19d12c72889b 100644
--- a/utils/tests/pub/test_pub.dart
+++ b/utils/tests/pub/test_pub.dart
@@ -443,9 +443,18 @@ bool _abortScheduled = false;
/// complete.
final _TIMEOUT = 30000;
+/// Defines an integration test. The [body] should schedule a series of
+/// operations which will be run asynchronously.
+integration(String description, body()) {
+ test(description, () {
+ body();
+ _run();
+ });
+}
+
/// Runs all the scheduled events for a test case. This should only be called
/// once per test case.
-void run() {
+void _run() {
var createdSandboxDir;
var asyncDone = expectAsync0(() {});
@@ -525,7 +534,7 @@ void schedulePub({List args, Pattern output, Pattern error,
/// Any futures in [args] will be resolved before the process is started.
void runPub({List args, Pattern output, Pattern error, int exitCode: 0}) {
schedulePub(args: args, output: output, error: error, exitCode: exitCode);
- run();
+ _run();
}
/// Starts a Pub process and returns a [ScheduledProcess] that supports
« no previous file with comments | « utils/tests/pub/pub_uploader_test.dart ('k') | utils/tests/pub/update/git/do_not_update_if_unneeded_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698