| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 if (navigator.webkitStartDart) { | |
| 6 navigator.webkitStartDart(); | |
| 7 } | |
| 8 | |
| 9 if (window.layoutTestController) { | 5 if (window.layoutTestController) { |
| 6 window.layoutTestController.dumpAsText(); |
| 10 window.layoutTestController.waitUntilDone(); | 7 window.layoutTestController.waitUntilDone(); |
| 11 } | 8 } |
| 12 | 9 |
| 13 function messageHandler(e) { | 10 function messageHandler(e) { |
| 14 if (e.data == 'done') { | 11 if (e.data == 'done' && window.layoutTestController) { |
| 15 // TODO(sigmund): use && in this condition, issue #41 | 12 window.layoutTestController.notifyDone(); |
| 16 if (window.layoutTestController) { | |
| 17 window.layoutTestController.notifyDone(); | |
| 18 } | |
| 19 } | 13 } |
| 20 } | 14 } |
| 21 | 15 |
| 22 window.addEventListener('message', messageHandler, false); | 16 window.addEventListener('message', messageHandler, false); |
| 23 | 17 |
| 24 function errorHandler(e) { | 18 function errorHandler(e) { |
| 25 if (window.layoutTestController) { | 19 if (window.layoutTestController) { |
| 26 window.layoutTestController.notifyDone(); | 20 window.layoutTestController.notifyDone(); |
| 27 } | 21 } |
| 28 window.console.log('FAIL'); | 22 window.console.log('FAIL'); |
| 29 } | 23 } |
| 30 | 24 |
| 31 window.addEventListener('error', errorHandler, false); | 25 window.addEventListener('error', errorHandler, false); |
| OLD | NEW |