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

Unified Diff: lib/html_individual_config.dart

Issue 1128383002: pkg/(unit)test: Enable group names containing spaces in HtmlIndividualConfiguration (Closed) Base URL: https://github.com/dart-lang/test.git@stable
Patch Set: nits Created 5 years, 7 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 | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/html_individual_config.dart
diff --git a/lib/html_individual_config.dart b/lib/html_individual_config.dart
index 263adf983aabefcaca194ade515c79bc27902752..b9ec4e6d25151e34fffcbda6121cd50e8befd013 100644
--- a/lib/html_individual_config.dart
+++ b/lib/html_individual_config.dart
@@ -20,24 +20,20 @@ class HtmlIndividualConfiguration extends htmlconfig.HtmlConfiguration {
HtmlIndividualConfiguration(bool 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 new ArgumentError('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));
- }
+ var uri = Uri.parse(window.location.href);
+
+ var groups = 'group='.allMatches(uri.query).toList();
+
+ if (groups.length > 1) {
+ throw new ArgumentError('More than one "group" parameter provided.');
+ }
+
+ var testGroupName = uri.queryParameters['group'];
+
+ if (testGroupName != null) {
+ var startsWith = "$testGroupName${unittest.groupSep}";
+ unittest.filterTests(
+ (unittest.TestCase tc) => tc.description.startsWith(startsWith));
}
super.onStart();
}
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698