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 * conent shell. | 7 * conent shell. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 // Clear the console before every test run - this is Firebug specific code. | 10 // Clear the console before every test run - this is Firebug specific code. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 // messages to the window.opener. | 84 // messages to the window.opener. |
| 85 var driver = getDriverWindow(); | 85 var driver = getDriverWindow(); |
| 86 if (driver) { | 86 if (driver) { |
| 87 driver.postMessage(window.document.body.innerHTML, "*"); | 87 driver.postMessage(window.document.body.innerHTML, "*"); |
| 88 } | 88 } |
| 89 } | 89 } |
| 90 | 90 |
| 91 function processMessage(msg) { | 91 function processMessage(msg) { |
| 92 // TODO(ricow): REMOVE, debug info, see issue 13292 | 92 // TODO(ricow): REMOVE, debug info, see issue 13292 |
| 93 if (!testRunner) { | 93 if (!testRunner) { |
| 94 printMessage('processMessage(): ' + msg); | 94 try { |
| 95 // Filter out ShadowDOM polyfill messages which are random floats. | |
| 96 if (msg != parseFloat(msg)) { | |
| 97 printMessage('processMessage(): ' + msg); | |
| 98 } | |
| 99 } catch(e) {} | |
| 95 } | 100 } |
| 96 if (typeof msg != 'string') return; | 101 if (typeof msg != 'string') return; |
|
Jennifer Messerly
2013/10/23 18:14:32
maybe just move up this check instead?
blois
2013/10/23 18:20:23
Done, removed try/catch.
| |
| 97 if (msg == 'unittest-suite-done') { | 102 if (msg == 'unittest-suite-done') { |
| 98 notifyDone(); | 103 notifyDone(); |
| 99 } else if (msg == 'unittest-suite-wait-for-done') { | 104 } else if (msg == 'unittest-suite-wait-for-done') { |
| 100 waitForDone = true; | 105 waitForDone = true; |
| 101 if (testRunner) { | 106 if (testRunner) { |
| 102 testRunner.startedDartTest = true; | 107 testRunner.startedDartTest = true; |
| 103 } | 108 } |
| 104 } else if (msg == 'dart-calling-main') { | 109 } else if (msg == 'dart-calling-main') { |
| 105 if (testRunner) { | 110 if (testRunner) { |
| 106 testRunner.startedDartTest = true; | 111 testRunner.startedDartTest = true; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 221 try { | 226 try { |
| 222 main(); | 227 main(); |
| 223 } catch (e) { | 228 } catch (e) { |
| 224 dartPrint(e); | 229 dartPrint(e); |
| 225 if (e.stack) dartPrint(e.stack); | 230 if (e.stack) dartPrint(e.stack); |
| 226 window.postMessage('unittest-suite-fail', '*'); | 231 window.postMessage('unittest-suite-fail', '*'); |
| 227 return; | 232 return; |
| 228 } | 233 } |
| 229 dartPrint('dart-main-done'); | 234 dartPrint('dart-main-done'); |
| 230 } | 235 } |
| OLD | NEW |