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

Unified Diff: pkg/unittest/lib/src/test_case.dart

Issue 142543005: pkg/unittest: remove interactive html configuration (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
« no previous file with comments | « pkg/unittest/lib/interactive_html_config.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/src/test_case.dart
diff --git a/pkg/unittest/lib/src/test_case.dart b/pkg/unittest/lib/src/test_case.dart
index 95068bd8b76176ba780b494fd8aba6de7e5e719f..50274637aa57ab27a766ee62e5c0b8c5c795b7a8 100644
--- a/pkg/unittest/lib/src/test_case.dart
+++ b/pkg/unittest/lib/src/test_case.dart
@@ -17,13 +17,13 @@ class TestCase {
final String description;
/** The setup function to call before the test, if any. */
- Function setUp;
+ final Function _setUp;
/** The teardown function to call after the test, if any. */
- Function tearDown;
+ final Function _tearDown;
/** The body of the test case. */
- TestFunction testFunction;
+ final TestFunction _testFunction;
/**
* Remaining number of callbacks functions that must reach a 'done' state
@@ -63,10 +63,10 @@ class TestCase {
Completer _testComplete;
- TestCase._internal(this.id, this.description, this.testFunction)
+ TestCase._internal(this.id, this.description, this._testFunction)
: currentGroup = _currentContext.fullName,
- setUp = _currentContext.testSetup,
- tearDown = _currentContext.testTeardown;
+ _setUp = _currentContext.testSetup,
+ _tearDown = _currentContext.testTeardown;
bool get isComplete => !enabled || result != null;
@@ -97,7 +97,7 @@ class TestCase {
// Avoid calling [new Future] to avoid issue 11911.
return new Future.value().then((_) {
- if (setUp != null) return setUp();
+ if (_setUp != null) return _setUp();
}).catchError(_errorHandler('Setup'))
.then((_) {
// Skip the test if setup failed.
@@ -106,7 +106,7 @@ class TestCase {
_startTime = new DateTime.now();
_runningTime = null;
++_callbackFunctionsOutstanding;
- return testFunction();
+ return _testFunction();
})
.catchError(_errorHandler('Test'))
.then((_) {
@@ -115,12 +115,12 @@ class TestCase {
// Outstanding callbacks exist; we need to return a Future.
_testComplete = new Completer();
return _testComplete.future.whenComplete(() {
- if (tearDown != null) {
- return tearDown();
+ if (_tearDown != null) {
+ return _tearDown();
}
}).catchError(_errorHandler('Teardown'));
- } else if (tearDown != null) {
- return tearDown();
+ } else if (_tearDown != null) {
+ return _tearDown();
}
})
.catchError(_errorHandler('Teardown'));
« no previous file with comments | « pkg/unittest/lib/interactive_html_config.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698