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

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

Issue 12703019: "Reverting 20457" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/html_individual_config.dart
diff --git a/pkg/unittest/lib/html_individual_config.dart b/pkg/unittest/lib/html_individual_config.dart
index 7a52242026c1dff65b8902ad39f79703809e5dae..39a9d0ef8d4176e474fe016957b66425a06f00ed 100644
--- a/pkg/unittest/lib/html_individual_config.dart
+++ b/pkg/unittest/lib/html_individual_config.dart
@@ -19,28 +19,23 @@ import 'unittest.dart' as unittest;
import 'html_config.dart' as htmlconfig;
class HtmlIndividualConfiguration extends htmlconfig.HtmlConfiguration {
- HtmlIndividualConfiguration(bool isLayoutTest): super(isLayoutTest);
+
+ String _noSuchTest = '';
+ HtmlIndividualConfiguration(isLayoutTest): super(isLayoutTest);
void onStart() {
var search = window.location.search;
if (search != '') {
- var groups = search.substring(1).split('&')
- .where((p) => p.startsWith('group='))
- .toList();
-
- if(!groups.isEmpty) {
- if(groups.length > 1) {
- throw 'More than one "group" parameter provided.';
- }
-
- var testGroupName = groups.single.split('=')[1];
- var startsWith = "$testGroupName${unittest.groupSep}";
- unittest.filterTests((unittest.TestCase tc) =>
- tc.description.startsWith(startsWith));
-
- if(unittest.testCases.isEmpty) {
- throw 'No tests match group "$testGroupName".';
+ try {
+ for (var parameter in search.substring(1).split('&')) {
+ if (parameter.startsWith('group=')) {
+ var testGroupName = parameter.split('=')[1];
+ unittest.filterTests('^$testGroupName${unittest.groupSep}');
+ }
}
+ } catch (e) {
+ print('tried to match "$testGroupName"');
+ print('NO_SUCH_TEST');
}
}
super.onStart();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698