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