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

Side by Side Diff: lib/html_individual_config.dart

Issue 934413002: Replace the existing unittest APIs with the new runner infrastructure. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Code review changes Created 5 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 unified diff | Download patch
« no previous file with comments | « lib/html_enhanced_config.dart ('k') | lib/src/configuration.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// A unit test library for running groups of tests in a browser, instead of the 5 @deprecated
6 /// entire test file. This is especially used for large tests files that have
7 /// many subtests, so we can mark groups as failing at a finer granularity than
8 /// the entire test file.
9 ///
10 /// To use, import this file, and call [useHtmlIndividualConfiguration] at the
11 /// start of your set sequence. Important constraint: your group descriptions
12 /// MUST NOT contain spaces.
13 library unittest.html_individual_config; 6 library unittest.html_individual_config;
14 7
15 import 'dart:html'; 8 import 'html_config.dart';
16 import 'unittest.dart' as unittest;
17 import 'html_config.dart' as htmlconfig;
18 9
19 class HtmlIndividualConfiguration extends htmlconfig.HtmlConfiguration { 10 /// This is a stub class used to preserve compatibility with unittest 0.11.*.
11 ///
12 /// It will be removed before the next version is released.
13 @deprecated
14 class HtmlIndividualConfiguration extends HtmlConfiguration {
20 HtmlIndividualConfiguration(bool isLayoutTest) : super(isLayoutTest); 15 HtmlIndividualConfiguration(bool isLayoutTest) : super(isLayoutTest);
21
22 void onStart() {
23 var search = window.location.search;
24 if (search != '') {
25 var groups = search
26 .substring(1)
27 .split('&')
28 .where((p) => p.startsWith('group='))
29 .toList();
30
31 if (!groups.isEmpty) {
32 if (groups.length > 1) {
33 throw new ArgumentError('More than one "group" parameter provided.');
34 }
35
36 var testGroupName = groups.single.split('=')[1];
37 var startsWith = "$testGroupName${unittest.groupSep}";
38 unittest.filterTests(
39 (unittest.TestCase tc) => tc.description.startsWith(startsWith));
40 }
41 }
42 super.onStart();
43 }
44 } 16 }
45 17
46 void useHtmlIndividualConfiguration([bool isLayoutTest = false]) { 18 @deprecated
47 unittest.unittestConfiguration = 19 void useHtmlIndividualConfiguration([bool isLayoutTest]) {}
48 isLayoutTest ? _singletonLayout : _singletonNotLayout;
49 }
50
51 final _singletonLayout = new HtmlIndividualConfiguration(true);
52 final _singletonNotLayout = new HtmlIndividualConfiguration(false);
OLDNEW
« no previous file with comments | « lib/html_enhanced_config.dart ('k') | lib/src/configuration.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698