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

Unified Diff: lib/src/backend/declarer.dart

Issue 1369613002: setUp/tearDown may be called repeatedly in a group. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 5 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
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/backend/group.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/backend/declarer.dart
diff --git a/lib/src/backend/declarer.dart b/lib/src/backend/declarer.dart
index 55c7ea79252799424b25146c45803d6930e897d4..df2ec06ee47b600e9a1b9a5baad65a326091e43f 100644
--- a/lib/src/backend/declarer.dart
+++ b/lib/src/backend/declarer.dart
@@ -46,8 +46,8 @@ class Declarer {
// TODO(nweiz): Use async/await here once issue 23497 has been fixed in
// two stable versions.
return Invoker.current.waitForOutstandingCallbacks(() {
- return group.runSetUp().then((_) => body());
- }).then((_) => group.runTearDown());
+ return group.runSetUps().then((_) => body());
+ }).then((_) => group.runTearDowns());
}));
}
@@ -75,21 +75,11 @@ class Declarer {
/// Registers a function to be run before tests.
void setUp(callback()) {
- if (_group.setUp != null) {
- throw new StateError("setUp() may not be called multiple times for the "
- "same group.");
- }
-
- _group.setUp = callback;
+ _group.setUps.add(callback);
}
/// Registers a function to be run after tests.
void tearDown(callback()) {
- if (_group.tearDown != null) {
- throw new StateError("tearDown() may not be called multiple times for "
- "the same group.");
- }
-
- _group.tearDown = callback;
+ _group.tearDowns.add(callback);
}
}
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/backend/group.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698