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

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

Issue 11301046: Restructure pkg/unittest and pkg/webdriver to follow the pub conventions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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/src/test_case.dart ('k') | pkg/unittest/lib/vm_config.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/unittest.dart
===================================================================
--- pkg/unittest/lib/unittest.dart (revision 0)
+++ pkg/unittest/lib/unittest.dart (working copy)
@@ -11,10 +11,10 @@
* dependencies:
* unittest:
* sdk: unittest
- *
+ *
* Then run 'pub install' from your project directory or using
* the DartEditor.
- *
+ *
* Please see [Pub Getting Started](http://pub.dartlang.org/doc)
* for more details about the pub package manager.
*
@@ -148,21 +148,11 @@
library unittest;
import 'dart:isolate';
+import 'matcher.dart';
+export 'matcher.dart';
-part 'collection_matchers.dart';
-part 'config.dart';
-part 'core_matchers.dart';
-part 'description.dart';
-part 'expect.dart';
-part 'future_matchers.dart';
-part 'interfaces.dart';
-part 'map_matchers.dart';
-part 'matcher.dart';
-part 'mock.dart';
-part 'numeric_matchers.dart';
-part 'operator_matchers.dart';
-part 'string_matchers.dart';
-part 'test_case.dart';
+part 'src/config.dart';
+part 'src/test_case.dart';
/** [Configuration] used by the unittest library. */
Configuration _config = null;
@@ -377,7 +367,7 @@
_after() {
if (_isDone()) {
- _handleCallbackFunctionComplete();
+ _handleCallbackFunctionComplete(_testNum);
}
}
@@ -646,7 +636,7 @@
* Called when one of the callback functions is done with all expected
* calls.
*/
-void _handleCallbackFunctionComplete() {
+void _handleCallbackFunctionComplete(testNum) {
// TODO (gram): we defer this to give the nextBatch recursive
// stack a chance to unwind. This is a temporary hack but
// really a bunch of code here needs to be fixed. We have a
@@ -654,6 +644,12 @@
// which is recursively invoked in the case of async tests that
// run synchronously. Bad things can then happen.
_defer(() {
+ if (_currentTest != testNum) {
+ if (_tests[testNum].result == PASS) {
+ _tests[testNum].error("Unexpected extra callbacks", '');
+ }
+ return; // Extraneous callback.
+ }
if (_currentTest < _tests.length) {
final testCase = _tests[_currentTest];
--testCase.callbackFunctionsOutstanding;
@@ -683,7 +679,7 @@
* TODO(gram) remove this when WebKit tests are working with new framework
*/
void callbackDone() {
- _handleCallbackFunctionComplete();
+ _handleCallbackFunctionComplete(_currentTest);
}
/**
@@ -854,6 +850,8 @@
return;
}
_initialized = true;
+ // Hook our async guard into the matcher library.
+ wrapAsync = expectAsync1;
_tests = <TestCase>[];
_testRunner = _nextBatch;
« no previous file with comments | « pkg/unittest/lib/src/test_case.dart ('k') | pkg/unittest/lib/vm_config.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698