OLD | NEW |
1 <script> | 1 <script> |
2 function LayoutTestController() { | 2 function LayoutTestController() { |
| 3 this.wait_until_done_ = false; |
3 this.dumpAsText = function () { }; | 4 this.dumpAsText = function () { }; |
4 this.waitUntilDone = function () { }; | 5 this.waitUntilDone = function () { |
| 6 this.wait_until_done_ = true; |
| 7 }; |
5 this.notifyDone = function () { | 8 this.notifyDone = function () { |
6 var cookie = "%COOKIE%=" + encodeURIComponent(document.firstChild.innerText)
; | 9 var cookie = "%COOKIE%=" + encodeURIComponent(document.firstChild.innerText)
; |
7 document.cookie = cookie; | 10 document.cookie = cookie; |
8 }; | 11 }; |
| 12 this.OnTimerEvent = function () { |
| 13 // Some layout tests do not call waitUntilDone. If this is true, we should |
| 14 // assume the test is done when it's finished loading. |
| 15 if (!this.wait_until_done_) |
| 16 layoutTestController.notifyDone(); |
| 17 }; |
| 18 this.OnLoadEvent = function (event) { |
| 19 // Do a timeout to ensure that we run after all other onload handlers have |
| 20 // finished. |
| 21 setTimeout(layoutTestController.OnTimerEvent, 0); |
| 22 }; |
9 } | 23 } |
10 var layoutTestController = new LayoutTestController(); | 24 window.layoutTestController = new LayoutTestController(); |
11 window.layoutTestController = layoutTestController; | 25 window.addEventListener('load', layoutTestController.OnLoadEvent, false); |
12 </script> | 26 </script> |
OLD | NEW |