| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 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 | 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 /** Configuration for running tests in a browser using dart:dom. */ | 5 /** Configuration for running tests in a browser using dart:dom. */ |
| 6 #library('dom_config'); | 6 #library('dom_config'); |
| 7 | 7 |
| 8 #import('dart:dom'); | 8 #import('dart:dom'); |
| 9 #import('unittest.dart'); | 9 #import('unittest.dart'); |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 } | 28 } |
| 29 | 29 |
| 30 void onStart() { | 30 void onStart() { |
| 31 window.postMessage('unittest-suite-wait-for-done', '*'); | 31 window.postMessage('unittest-suite-wait-for-done', '*'); |
| 32 // Listen for uncaught errors. | 32 // Listen for uncaught errors. |
| 33 window.addEventListener('error', _onErrorClosure, true); | 33 window.addEventListener('error', _onErrorClosure, true); |
| 34 } | 34 } |
| 35 | 35 |
| 36 void onTestResult(TestCase testCase) {} | 36 void onTestResult(TestCase testCase) {} |
| 37 | 37 |
| 38 void onDone(int passed, int failed, int errors, List<TestCase> results) { | 38 void onDone(int passed, int failed, int errors, List<TestCase> results, |
| 39 String uncaughtError) { |
| 39 window.removeEventListener('error', _onErrorClosure); | 40 window.removeEventListener('error', _onErrorClosure); |
| 40 _showResultsInPage(passed, failed, errors, results, _isLayoutTest); | 41 _showResultsInPage(passed, failed, errors, results, _isLayoutTest, |
| 42 uncaughtError); |
| 41 window.postMessage('unittest-suite-done', '*'); | 43 window.postMessage('unittest-suite-done', '*'); |
| 42 } | 44 } |
| 43 } | 45 } |
| 44 | 46 |
| 45 void useDomConfiguration([bool isLayoutTest = false]) { | 47 void useDomConfiguration([bool isLayoutTest = false]) { |
| 46 configure(new DomConfiguration(isLayoutTest)); | 48 configure(new DomConfiguration(isLayoutTest)); |
| 47 } | 49 } |
| OLD | NEW |