|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=512435 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 512435</title> |
|
8 <script type="application/javascript" src="/MochiKit/MochiKit.js"></script> |
|
9 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
10 <script type="text/javascript" src="/tests/image/test/mochitest/imgutils.js"></script> |
|
11 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
12 </head> |
|
13 <body> |
|
14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=512435">Mozilla Bug 512435</a> |
|
15 <img id="img_a"> |
|
16 <img id="img_b"> |
|
17 </div> |
|
18 <pre id="test"> |
|
19 <script type="application/javascript"> |
|
20 |
|
21 // Boilerplate |
|
22 const Ci = SpecialPowers.Ci; |
|
23 const Cc = SpecialPowers.Cc; |
|
24 SimpleTest.waitForExplicitFinish(); |
|
25 |
|
26 // We're relying on very particular behavior for certain images - clear the |
|
27 // image cache, _then_ set src |
|
28 clearImageCache(); |
|
29 document.getElementById("img_a").src = "damon.jpg"; |
|
30 document.getElementById("img_b").src = "shaver.png"; |
|
31 |
|
32 // Our handler |
|
33 function loadHandler() { |
|
34 |
|
35 // The two images should be decoded |
|
36 ok(isFrameDecoded("img_a"), "img_a should be decoded before onload fires"); |
|
37 ok(isFrameDecoded("img_b"), "img_b should be decoded before onload fires"); |
|
38 |
|
39 // All done |
|
40 SimpleTest.finish(); |
|
41 } |
|
42 |
|
43 // Set our onload handler |
|
44 window.onload = loadHandler; |
|
45 |
|
46 </script> |
|
47 </pre> |
|
48 </body> |
|
49 </html> |