1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/image/test/mochitest/test_bug552605-1.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,56 @@ 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 first, second; 1.23 + 1.24 +SimpleTest.waitForExplicitFinish(); 1.25 + 1.26 +function checkFirst() 1.27 +{ 1.28 + var testimage = document.getElementById('test-image'); 1.29 + first = document.createElement('canvas') 1.30 + var ctx = first.getContext('2d'); 1.31 + ctx.drawImage(testimage, 0, 0); 1.32 + 1.33 + var newimg = new Image(); 1.34 + newimg.onload = checkSecond; 1.35 + newimg.src = "bug552605.sjs"; 1.36 + document.body.appendChild(newimg); 1.37 +} 1.38 + 1.39 +function checkSecond() 1.40 +{ 1.41 + var testimage = document.getElementById('test-image'); 1.42 + second = document.createElement('canvas') 1.43 + var ctx = second.getContext('2d'); 1.44 + ctx.drawImage(testimage, 0, 0); 1.45 + 1.46 + // Check that the images are the same, since they're in the same document. 1.47 + [correct, val1, val2] = compareSnapshots(first, second, true); 1.48 + ok(correct, "Image should be the same for all loads."); 1.49 + 1.50 + SimpleTest.finish(); 1.51 +} 1.52 + 1.53 +</script> 1.54 +</pre> 1.55 +<div id="content"> <!-- style="display: none" --> 1.56 +<img src="bug552605.sjs" onload="checkFirst()" id="test-image"></iframe> 1.57 +</div> 1.58 +</body> 1.59 +</html>