| OLD | NEW |
| 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. |
| 11 * |
| 12 * Note: this unit test configuration will not work with the debugger (the tests |
| 13 * are executed in a separate IFrame). |
| 11 */ | 14 */ |
| 12 library unittest_interactive_html_config; | 15 library unittest_interactive_html_config; |
| 13 | 16 |
| 14 // TODO(gram) - add options for: remove IFrame on done/keep | 17 // TODO(gram) - add options for: remove IFrame on done/keep |
| 15 // IFrame for failed tests/keep IFrame for all tests. | 18 // IFrame for failed tests/keep IFrame for all tests. |
| 16 | 19 |
| 17 import 'dart:html'; | 20 import 'dart:html'; |
| 18 import 'dart:async'; | 21 import 'dart:async'; |
| 19 import 'dart:math'; | 22 import 'dart:math'; |
| 20 import 'unittest.dart'; | 23 import 'unittest.dart'; |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 document.body.nodes.add(new Element.html( | 458 document.body.nodes.add(new Element.html( |
| 456 "<div id='busy' style='display:none'><img src='googleballs.gif'>" | 459 "<div id='busy' style='display:none'><img src='googleballs.gif'>" |
| 457 "</img></div>")); | 460 "</img></div>")); |
| 458 } | 461 } |
| 459 if (document.query('#child') == null) { | 462 if (document.query('#child') == null) { |
| 460 document.body.nodes.add(new Element.html("<div id='child'></div>")); | 463 document.body.nodes.add(new Element.html("<div id='child'></div>")); |
| 461 } | 464 } |
| 462 } | 465 } |
| 463 | 466 |
| 464 /** | 467 /** |
| 465 * Allocate a Configuration. We allocate either a parent or | 468 * Allocate a Configuration. We allocate either a parent or child, depending on |
| 466 * child, depending on whether the URL has a search part. | 469 * whether the URL has a search part. |
| 470 * |
| 471 * Note: this unit test configuration will not work with the debugger (the tests |
| 472 * are executed in a separate IFrame). |
| 467 */ | 473 */ |
| 468 void useInteractiveHtmlConfiguration() { | 474 void useInteractiveHtmlConfiguration() { |
| 469 if (window.location.search == '') { // This is the parent. | 475 if (window.location.search == '') { // This is the parent. |
| 470 _prepareDom(); | 476 _prepareDom(); |
| 471 unittestConfiguration = _singletonParent; | 477 unittestConfiguration = _singletonParent; |
| 472 } else { | 478 } else { |
| 473 unittestConfiguration = _singletonChild; | 479 unittestConfiguration = _singletonChild; |
| 474 } | 480 } |
| 475 } | 481 } |
| 476 | 482 |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 display: block; | 675 display: block; |
| 670 list-style-type: disc; | 676 list-style-type: disc; |
| 671 -webkit-margin-before: 1em; | 677 -webkit-margin-before: 1em; |
| 672 -webkit-margin-after: 1em; | 678 -webkit-margin-after: 1em; |
| 673 -webkit-margin-start: 0px; | 679 -webkit-margin-start: 0px; |
| 674 -webkit-margin-end: 0px; | 680 -webkit-margin-end: 0px; |
| 675 -webkit-padding-start: 40px; | 681 -webkit-padding-start: 40px; |
| 676 } | 682 } |
| 677 | 683 |
| 678 """; | 684 """; |
| OLD | NEW |