test_bug777628.html (1209B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=777628 5 --> 6 <head> 7 <meta charset="utf-8"> 8 <title>Test for Bug 743615</title> 9 <script src="/tests/SimpleTest/SimpleTest.js"></script> 10 <script type="application/javascript" src="utils_bug743615.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=777628">Mozilla Bug 777628</a> 15 <p id="display"></p> 16 <div id="content" style="display: none"> 17 <iframe id="ifr"></iframe> 18 </div> 19 <pre id="test"> 20 <script type="application/javascript"> 21 22 /** Test for structured cloning ImageData from another scope. */ 23 24 // Set up an ImageData in another scope. 25 var doc = document.getElementById('ifr').contentDocument; 26 var canvas = doc.createElement('canvas'); 27 canvas.width = 200; 28 canvas.height = 200; 29 doc.body.appendChild(canvas); 30 var ctx = canvas.getContext('2d'); 31 ctx.fillStyle = 'rgb('; 32 ctx.fillRect(30, 30, 50, 50); 33 var imageData = ctx.createImageData(200, 200); 34 35 // Clone it. 36 window.postMessage({ imageData }, '*'); 37 ok(true, "Handled cross-compartment imagedata without throwing/crashing!"); 38 39 </script> 40 </pre> 41 </body> 42 </html>