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

Side by Side Diff: pkg/unittest/html_individual_config.dart

Issue 11293019: Run large html tests individually. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/html/element_test.dart » ('j') | tools/testing/dart/status_file_parser.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
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.
4
5 /**
6 * A unit test library for running subtests one at a time in a browser,
7 * especially used for large tests files that have many subtests, so we can mark
8 * subtests as failing at a finer granularity than the entire test file.
9 *
10 * To use, import this file, and call [useHtmlIndividualConfiguration] at the
11 * start of your set sequence.
12 */
13 #library('unittest');
14
15 #import('unittest.dart', prefix: 'unittest_file');
16 #import('html_config.dart', prefix: 'htmlconfig');
17 #import('dart:html');
18
19 class HtmlIndividualConfiguration extends htmlconfig.HtmlConfiguration {
20
21 String _noSuchTest = '';
22 HtmlIndividualConfiguration(isLayoutTest): super(isLayoutTest);
23
24 void onStart() {
25 var testName = window.location.hash;
26 if (testName != '') {
27 try {
28 testName = testName.substring(1); // cut off the #
29 unittest_file.filterTests('$testName\$');
30 } catch (e) {
31 print('tried to match "$testName"');
32 for (TestCase c in unittest_file.testCases)
33 print('test case ${c.description}');
34 print('NO_SUCH_TEST');
35 exit(1);
36 }
37 }
38 super.onStart();
39 }
40 }
41
42 void useHtmlIndividualConfiguration([bool isLayoutTest = false]) {
43 unittest_file.configure(new HtmlIndividualConfiguration(isLayoutTest));
44 }
OLDNEW
« no previous file with comments | « no previous file | tests/html/element_test.dart » ('j') | tools/testing/dart/status_file_parser.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698