Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <!-- |
michael@0 | 4 | https://bugzilla.mozilla.org/show_bug.cgi?id=553982 |
michael@0 | 5 | --> |
michael@0 | 6 | <head> |
michael@0 | 7 | <title>Test for Bug 553982</title> |
michael@0 | 8 | <script type="application/javascript" src="/MochiKit/MochiKit.js"></script> |
michael@0 | 9 | <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 10 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
michael@0 | 11 | </head> |
michael@0 | 12 | <body> |
michael@0 | 13 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=553982">Mozilla Bug 553982</a> |
michael@0 | 14 | <pre id="test"> |
michael@0 | 15 | <script type="application/javascript"> |
michael@0 | 16 | |
michael@0 | 17 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 18 | var success = false; |
michael@0 | 19 | |
michael@0 | 20 | // This should fire |
michael@0 | 21 | function doError() { |
michael@0 | 22 | success = true; |
michael@0 | 23 | } |
michael@0 | 24 | |
michael@0 | 25 | // This should not fire |
michael@0 | 26 | function doLoad() { |
michael@0 | 27 | ok(false, "onload should not fire"); |
michael@0 | 28 | } |
michael@0 | 29 | |
michael@0 | 30 | window.onload = function() { |
michael@0 | 31 | ok(success, "onerror should fire"); |
michael@0 | 32 | SimpleTest.finish(); |
michael@0 | 33 | } |
michael@0 | 34 | |
michael@0 | 35 | </script> |
michael@0 | 36 | </pre> |
michael@0 | 37 | <img src="data:text/html," onerror="doError()" onload="doLoad()" /> |
michael@0 | 38 | </body> |
michael@0 | 39 | </html> |