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

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

Issue 16374007: First rev of Safe DOM (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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
« no previous file with comments | « pkg/mdv/test/template_element_test.dart ('k') | sdk/lib/html/dart2js/html_dart2js.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 /** 5 /**
6 * A simple unit test library for running tests in a browser. 6 * A simple unit test library for running tests in a browser.
7 * 7 *
8 * Provides enhanced HTML output with collapsible group headers 8 * Provides enhanced HTML output with collapsible group headers
9 * and other at-a-glance information about the test results. 9 * and other at-a-glance information about the test results.
10 */ 10 */
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 } 61 }
62 } 62 }
63 63
64 void onInit() { 64 void onInit() {
65 _installHandlers(); 65 _installHandlers();
66 //initialize and load CSS 66 //initialize and load CSS
67 final String _CSSID = '_unittestcss_'; 67 final String _CSSID = '_unittestcss_';
68 68
69 var cssElement = document.head.query('#${_CSSID}'); 69 var cssElement = document.head.query('#${_CSSID}');
70 if (cssElement == null){ 70 if (cssElement == null){
71 document.head.children.add(new Element.html( 71 cssElement = new StyleElement();
72 '<style id="${_CSSID}"></style>')); 72 cssElement.id = _CSSID;
73 cssElement = document.head.query('#${_CSSID}'); 73 document.head.append(cssElement);
74 } 74 }
75 75
76 cssElement.innerHtml = _htmlTestCSS; 76 cssElement.text = _htmlTestCSS;
77 window.postMessage('unittest-suite-wait-for-done', '*'); 77 window.postMessage('unittest-suite-wait-for-done', '*');
78 } 78 }
79 79
80 void onStart() { 80 void onStart() {
81 // Listen for uncaught errors. 81 // Listen for uncaught errors.
82 _installOnErrorHandler(); 82 _installOnErrorHandler();
83 } 83 }
84 84
85 void onSummary(int passed, int failed, int errors, List<TestCase> results, 85 void onSummary(int passed, int failed, int errors, List<TestCase> results,
86 String uncaughtError) { 86 String uncaughtError) {
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 417
418 '''; 418 ''';
419 } 419 }
420 420
421 void useHtmlEnhancedConfiguration([bool isLayoutTest = false]) { 421 void useHtmlEnhancedConfiguration([bool isLayoutTest = false]) {
422 unittestConfiguration = isLayoutTest ? _singletonLayout : _singletonNotLayout; 422 unittestConfiguration = isLayoutTest ? _singletonLayout : _singletonNotLayout;
423 } 423 }
424 424
425 final _singletonLayout = new HtmlEnhancedConfiguration(true); 425 final _singletonLayout = new HtmlEnhancedConfiguration(true);
426 final _singletonNotLayout = new HtmlEnhancedConfiguration(false); 426 final _singletonNotLayout = new HtmlEnhancedConfiguration(false);
OLDNEW
« no previous file with comments | « pkg/mdv/test/template_element_test.dart ('k') | sdk/lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698