1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/image/test/mochitest/test_bug552605-2.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,53 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=552605 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 552605</title> 1.11 + <script type="application/javascript" src="/MochiKit/MochiKit.js"></script> 1.12 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.13 + <script type="application/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script> 1.14 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.15 +</head> 1.16 +<body> 1.17 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=552605">Mozilla Bug 552605</a> 1.18 +<p id="display"></p> 1.19 +<pre id="test"> 1.20 +<script type="application/javascript"> 1.21 + 1.22 +var count = 0; 1.23 + 1.24 +SimpleTest.waitForExplicitFinish(); 1.25 + 1.26 +function check() 1.27 +{ 1.28 + count++; 1.29 + if (count != 2) 1.30 + return; 1.31 + 1.32 + var image1 = document.getElementById('test-image1'); 1.33 + var image2 = document.getElementById('test-image2'); 1.34 + var first = document.createElement('canvas') 1.35 + var ctx = first.getContext('2d'); 1.36 + ctx.drawImage(image1, 0, 0); 1.37 + 1.38 + var second = document.createElement('canvas'); 1.39 + ctx = second.getContext('2d'); 1.40 + ctx.drawImage(image2, 0, 0); 1.41 + 1.42 + // Check that the images are the same, since they're in the same document. 1.43 + [correct, val1, val2] = compareSnapshots(first, second, true); 1.44 + ok(correct, "Image should be the same for all loads."); 1.45 + 1.46 + SimpleTest.finish(); 1.47 +} 1.48 + 1.49 +</script> 1.50 +</pre> 1.51 +<div id="content"> <!-- style="display: none" --> 1.52 +<img src="bug552605.sjs" onload="check()" id="test-image1"></iframe> 1.53 +<img src="bug552605.sjs" onload="check()" id="test-image2"></iframe> 1.54 +</div> 1.55 +</body> 1.56 +</html>