test_bug552605-2.html (1419B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=552605 5 --> 6 <head> 7 <title>Test for Bug 552605</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <script src="/tests/SimpleTest/WindowSnapshot.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 11 </head> 12 <body> 13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=552605">Mozilla Bug 552605</a> 14 <p id="display"></p> 15 <pre id="test"> 16 <script type="application/javascript"> 17 18 var count = 0; 19 20 SimpleTest.waitForExplicitFinish(); 21 22 function check() 23 { 24 count++; 25 if (count != 2) 26 return; 27 28 var image1 = document.getElementById('test-image1'); 29 var image2 = document.getElementById('test-image2'); 30 var first = document.createElement('canvas') 31 var ctx = first.getContext('2d'); 32 ctx.drawImage(image1, 0, 0); 33 34 var second = document.createElement('canvas'); 35 ctx = second.getContext('2d'); 36 ctx.drawImage(image2, 0, 0); 37 38 // Check that the images are the same, since they're in the same document. 39 var values = compareSnapshots(first, second, true); 40 ok(values[0], "Image should be the same for all loads."); 41 42 SimpleTest.finish(); 43 } 44 45 </script> 46 </pre> 47 <div id="content"> <!-- style="display: none" --> 48 <img src="bug552605.sjs" onload="check()" id="test-image1"></iframe> 49 <img src="bug552605.sjs" onload="check()" id="test-image2"></iframe> 50 </div> 51 </body> 52 </html>