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

Side by Side Diff: pkg/unittest/lib/interactive_html_config.dart

Issue 12770017: pkg/unittest: config refactor (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: per siggi's recomendations 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 unified diff | Download patch | Annotate | Revision Log
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 /** 5 /**
6 * This configuration can be used to rerun selected tests, as well 6 * This configuration can be used to rerun selected tests, as well
7 * as see diagnostic output from tests. It runs each test in its own 7 * as see diagnostic output from tests. It runs each test in its own
8 * IFrame, so the configuration consists of two parts - a 'parent' 8 * IFrame, so the configuration consists of two parts - a 'parent'
9 * config that manages all the tests, and a 'child' config for the 9 * config that manages all the tests, and a 'child' config for the
10 * IFrame that runs the individual tests. 10 * IFrame that runs the individual tests.
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 if (document.query('#child') == null) { 459 if (document.query('#child') == null) {
460 document.body.nodes.add(new Element.html("<div id='child'></div>")); 460 document.body.nodes.add(new Element.html("<div id='child'></div>"));
461 } 461 }
462 } 462 }
463 463
464 /** 464 /**
465 * Allocate a Configuration. We allocate either a parent or 465 * Allocate a Configuration. We allocate either a parent or
466 * child, depending on whether the URL has a search part. 466 * child, depending on whether the URL has a search part.
467 */ 467 */
468 void useInteractiveHtmlConfiguration() { 468 void useInteractiveHtmlConfiguration() {
469 if (config != null) return;
470 if (window.location.search == '') { // This is the parent. 469 if (window.location.search == '') { // This is the parent.
471 _prepareDom(); 470 _prepareDom();
472 configure(new ParentInteractiveHtmlConfiguration()); 471 config = _singletonParent;
473 } else { 472 } else {
474 configure(new ChildInteractiveHtmlConfiguration()); 473 config = _singletonChild;
475 } 474 }
476 } 475 }
477 476
477 final _singletonParent = new ParentInteractiveHtmlConfiguration();
478 final _singletonChild = new ChildInteractiveHtmlConfiguration();
479
478 String _CSS = """ 480 String _CSS = """
479 body { 481 body {
480 font-family: Arial, sans-serif; 482 font-family: Arial, sans-serif;
481 margin: 0; 483 margin: 0;
482 font-size: 14px; 484 font-size: 14px;
483 } 485 }
484 486
485 #application h2, 487 #application h2,
486 #specs h2 { 488 #specs h2 {
487 margin: 0; 489 margin: 0;
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 display: block; 669 display: block;
668 list-style-type: disc; 670 list-style-type: disc;
669 -webkit-margin-before: 1em; 671 -webkit-margin-before: 1em;
670 -webkit-margin-after: 1em; 672 -webkit-margin-after: 1em;
671 -webkit-margin-start: 0px; 673 -webkit-margin-start: 0px;
672 -webkit-margin-end: 0px; 674 -webkit-margin-end: 0px;
673 -webkit-padding-start: 40px; 675 -webkit-padding-start: 40px;
674 } 676 }
675 677
676 """; 678 """;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698