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

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

Issue 12328090: unittest: Updates to Configuration, one deprecation (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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/unittest/lib/src/core_matchers.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/src/config.dart
diff --git a/pkg/unittest/lib/src/config.dart b/pkg/unittest/lib/src/config.dart
index 2cd2334b07d6a3569404f59aeb5048b90f2070d6..1711b866ea8cc60dcb2ad13d81995dadc6112123 100644
--- a/pkg/unittest/lib/src/config.dart
+++ b/pkg/unittest/lib/src/config.dart
@@ -15,19 +15,22 @@ class Configuration {
// The VM won't shut down if a receive port is open. Use this to make sure
// we correctly wait for asynchronous tests.
ReceivePort _receivePort;
- TestCase currentTestCase = null;
+ TestCase _currentTestCase;
+
+ TestCase get currentTestCase => _currentTestCase;
/**
* Subclasses can override this with something useful for diagnostics.
* Particularly useful in cases where we have parent/child configurations
* such as layout tests.
*/
- get name => 'Configuration';
+ String get name => 'Configuration';
+
/**
* If true, then tests are started automatically (otherwise [runTests]
* must be called explicitly after the tests are set up.
*/
- get autoStart => true;
+ bool get autoStart => true;
/**
* Called as soon as the unittest framework becomes initialized. This is done
@@ -49,7 +52,9 @@ class Configuration {
* a test suite.
*/
void onTestStart(TestCase testCase) {
- currentTestCase = testCase;
+ assert(testCase != null);
+ assert(_currentTestCase == null);
+ _currentTestCase = testCase;
}
/**
@@ -57,7 +62,9 @@ class Configuration {
* a test suite.
*/
void onTestResult(TestCase testCase) {
- currentTestCase = null;
+ assert(testCase != null);
+ assert(_currentTestCase == testCase);
+ _currentTestCase = null;
}
/**
@@ -155,21 +162,6 @@ class Configuration {
handleExternalError(e, String message) =>
_reportTestError('$message\nCaught $e', '');
- /**
- * Send messages to the test controller code (see 'test_controller.js'). This
- * is only needed to support browser tests with dart2js. Note: we could wrap
- * tests and send the appropriate messages to the controller through the
- * wrapper, but using wrappers has a noticeable overhead in the testing bots,
- * so we use this approach instead.
- *
- * Configurations that will not run in DRT (such as vm_config and
- * compact_vm_config), can safely override this method to avoid printing extra
- * mesages in the console.
- */
- // TODO(sigmund): find a way to unify notifyController and _postMessage
- void notifyController(String message) {
- }
gram 2013/02/25 21:51:53 I think it is okay to remove this but I would want
Siggi Cherem (dart-lang) 2013/02/25 23:20:49 yeah - it's fine to remove this, but please remove
-
_postMessage(String message) {
// In dart2js browser tests, the JavaScript-based test controller
// intercepts calls to print and listens for "secret" messages.
« no previous file with comments | « no previous file | pkg/unittest/lib/src/core_matchers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698