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

Unified Diff: client/testing/unittest/shared.dart

Issue 9369006: First prototype of import map generator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix path to JSON. Created 8 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 | client/testing/unittest/unittest_vm.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/testing/unittest/shared.dart
diff --git a/client/testing/unittest/shared.dart b/client/testing/unittest/shared.dart
index 4f633785614714142337438112251665d409ab61..56923021565821db5392d78b712f11406aecee19 100644
--- a/client/testing/unittest/shared.dart
+++ b/client/testing/unittest/shared.dart
@@ -11,9 +11,9 @@ String _currentGroup = '';
/** Tests executed in this suite. */
List<TestCase> _tests;
-/**
+/**
* Callback used to run tests. Entrypoints can replace this with their own
- * if they want.
+ * if they want.
*/
Function _testRunner;
@@ -99,7 +99,7 @@ void serialInvokeAsync(List closures) {
}
window.setTimeout(invokeNext, 0);
}
-}
+}
/**
* Creates a new named group of tests. Calls to group() or test() within the
@@ -244,7 +244,7 @@ _ensureInitialized() {
_currentGroup = '';
_state = _READY;
_testRunner = _nextBatch;
-
+
_platformInitialize();
// Immediately queue the suite up. It will run after a timeout (i.e. after
@@ -263,8 +263,14 @@ class Expectation {
/** Asserts that the value is equivalent to [expected]. */
void equals(expected) {
+ // Use the type-specialized versions when appropriate to give better
+ // error messages.
if (_value is String && expected is String) {
Expect.stringEquals(expected, _value);
+ } else if (_value is Map && expected is Map) {
+ Expect.mapEquals(expected, _value);
+ } else if (_value is Set && expected is Set) {
+ Expect.setEquals(expected, _value);
} else {
Expect.equals(expected, _value);
}
@@ -338,13 +344,13 @@ class TestCase {
/** Stack trace associated with this test, or null if it succeeded. */
String stackTrace;
-
+
Date startTime;
-
+
Duration runningTime;
TestCase(this.id, this.description, this.test, this.callbacks);
-
+
bool get isComplete() => result != null;
void pass() {
« no previous file with comments | « no previous file | client/testing/unittest/unittest_vm.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698