Chromium Code Reviews| 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 /** | 5 /** |
| 6 * Test controller logic - used by unit test harness to embed tests in | 6 * Test controller logic - used by unit test harness to embed tests in |
| 7 * DumpRenderTree. | 7 * DumpRenderTree. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 // Clear the console before every test run - this is Firebug specific code. | |
| 11 if (typeof console == "object" && typeof console.clear == "function") { | |
| 12 console.clear(); | |
| 13 } | |
| 14 // Set window onerror to make sure that we catch test harness errors across all | |
| 15 // browsers. | |
| 16 window.onerror = function (message, url, lineNumber) { | |
|
Siggi Cherem (dart-lang)
2012/10/30 17:36:53
could this be problematic in non-firefox browsers?
ricow1
2012/10/31 10:17:53
This is not firefox only:
http://www.w3.org/wiki/D
| |
| 17 showErrorAndExit("\n\n" + url + ":" + lineNumber + ":\n" + message + "\n\n"); | |
| 18 window.postMessage('unittest-suite-external-error', '*'); | |
| 19 }; | |
| 20 | |
| 10 if (navigator.webkitStartDart) { | 21 if (navigator.webkitStartDart) { |
| 11 navigator.webkitStartDart(); | 22 navigator.webkitStartDart(); |
| 12 } | 23 } |
| 13 | 24 |
| 14 // testRunner is provided by DRT or WebKit's layout tests. | 25 // testRunner is provided by DRT or WebKit's layout tests. |
| 15 // It is not available in selenium tests. | 26 // It is not available in selenium tests. |
| 16 var testRunner = window.testRunner || window.layoutTestController; | 27 var testRunner = window.testRunner || window.layoutTestController; |
| 17 | 28 |
| 18 var waitForDone = false; | 29 var waitForDone = false; |
| 19 | 30 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 function dartMainRunner(main) { | 123 function dartMainRunner(main) { |
| 113 window.postMessage('dart-calling-main', '*'); | 124 window.postMessage('dart-calling-main', '*'); |
| 114 try { | 125 try { |
| 115 main(); | 126 main(); |
| 116 } catch (e) { | 127 } catch (e) { |
| 117 window.postMessage('unittest-suite-fail', '*'); | 128 window.postMessage('unittest-suite-fail', '*'); |
| 118 return; | 129 return; |
| 119 } | 130 } |
| 120 window.postMessage('dart-main-done', '*'); | 131 window.postMessage('dart-main-done', '*'); |
| 121 } | 132 } |
| OLD | NEW |