OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 (function() { | 5 (function() { |
6 // The Mozilla DHTML performance tests need to explicitly call a function to | 6 // The Mozilla DHTML performance tests need to explicitly call a function to |
7 // trigger the next page visit, rather than directly using the onload handler. | 7 // trigger the next page visit, rather than directly using the onload handler. |
8 // To meet needs of the DHTML performance tests without forking this head.js | 8 // To meet needs of the DHTML performance tests without forking this head.js |
9 // file, use a variable |__install_onload_handler| to indicate whether the | 9 // file, use a variable |__install_onload_handler| to indicate whether the |
10 // |__onload| handler should be added to onload event listener. | 10 // |__onload| handler should be added to onload event listener. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // The function |__eval_later| now is only used by the DHTML tests. | 51 // The function |__eval_later| now is only used by the DHTML tests. |
52 window.__eval_later = function(expression) { | 52 window.__eval_later = function(expression) { |
53 setTimeout(expression, __test_timeout); | 53 setTimeout(expression, __test_timeout); |
54 }; | 54 }; |
55 | 55 |
56 if (window.parent == window) { // Ignore subframes. | 56 if (window.parent == window) { // Ignore subframes. |
57 addEventListener("load", __onload); | 57 addEventListener("load", __onload); |
58 addEventListener("beforeunload", __onbeforeunload); | 58 addEventListener("beforeunload", __onbeforeunload); |
59 } | 59 } |
60 })(); | 60 })(); |
OLD | NEW |