OLD | NEW |
1 <p>This tests that the onload handler for an iframe is delayed by a pending SVGF
ont load.</p> | 1 <p>This tests that the onload handler for an iframe is delayed by a pending SVGF
ont load.</p> |
2 <pre id="console"></pre> | 2 <pre id="console"></pre> |
3 <script> | 3 <script> |
4 if (window.testRunner) | 4 if (window.testRunner) |
5 testRunner.dumpAsText(); | 5 testRunner.dumpAsText(); |
6 | 6 |
7 function log(msg) | 7 function log(msg) |
8 { | 8 { |
9 document.getElementById('console').appendChild(document.createTextNode(m
sg + "\n")); | 9 document.getElementById('console').appendChild(document.createTextNode(m
sg + "\n")); |
10 } | 10 } |
11 | 11 |
12 var onloadFired = false; | 12 var onloadFired = false; |
13 | 13 |
14 iframe = document.createElement('iframe'); | 14 iframe = document.createElement('iframe'); |
15 iframe.onload = function() { | 15 iframe.onload = function() { |
16 onloadFired = true; | 16 onloadFired = true; |
17 }; | 17 }; |
18 iframe.src = "resources/SVGFont-delayed-loader.svg"; | 18 iframe.src = "resources/SVGFont-delayed-loader.svg"; |
19 document.body.appendChild(iframe); | 19 document.body.appendChild(iframe); |
20 | 20 |
21 function contentLoaded() | 21 function contentLoaded() |
22 { | 22 { |
23 if (onloadFired) | 23 if (onloadFired) |
24 log("FAIL: the onload event fired before the SVGFont load finished")
; | 24 log("FAIL: the onload event fired before the SVGFont load finished")
; |
25 else | 25 else |
26 log("PASS: the onload event did not fire."); | 26 log("PASS: the onload event did not fire."); |
27 | 27 |
28 // Stop the infinite load. | 28 // Stop the infinite load. |
29 iframe.contentWindow.stop(); | 29 stop(); |
30 } | 30 } |
31 </script> | 31 </script> |
OLD | NEW |