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

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

Issue 12217142: Unit test improvements: (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
Index: pkg/unittest/lib/unittest.dart
===================================================================
--- pkg/unittest/lib/unittest.dart (revision 18360)
+++ pkg/unittest/lib/unittest.dart (working copy)
@@ -9,8 +9,7 @@
* Create a pubspec.yaml file in your project and add
* a dependency on unittest with the following lines:
* dependencies:
- * unittest:
- * sdk: unittest
+ * unittest: any
*
* Then run 'pub install' from your project directory or using
* the DartEditor.
@@ -354,6 +353,18 @@
_testCase.callbackFunctionsOutstanding++;
}
_id = '';
+ // If the callback is not an anonymous closure, try to get the
+ // name.
+ var fname = callback.toString();
+ var prefix = "Function '";
+ var pos = fname.indexOf(prefix);
+ if (pos > 0) {
+ pos += prefix.length;
+ var epos = fname.indexOf("'", pos);
+ if (epos > 0) {
+ _id = "${fname.substring(pos, epos)} ";
+ }
+ }
}
_SpreadArgsHelper(callback, shouldCallBack, isDone) {

Powered by Google App Engine
This is Rietveld 408576698