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 | <head> |
michael@0 | 4 | <script type="application/javascript"> |
michael@0 | 5 | |
michael@0 | 6 | // Set up the objects for cloning. |
michael@0 | 7 | function setup() { |
michael@0 | 8 | window.testObject = { myNumber: 42, |
michael@0 | 9 | myDomain: window.location.domain }; |
michael@0 | 10 | window.blob = new Blob([], { type: 'text/plain' }); |
michael@0 | 11 | window.fileList = document.getElementById('fileinput').files; |
michael@0 | 12 | } |
michael@0 | 13 | |
michael@0 | 14 | // Called by the chrome parent window. |
michael@0 | 15 | function tryToClone(obj, shouldSucceed, message) { |
michael@0 | 16 | var success = false; |
michael@0 | 17 | var sink = window.frames[0]; |
michael@0 | 18 | try { sink.postMessage(obj, '*'); success = true; } |
michael@0 | 19 | catch (e) { message = message + ' (threw: ' + e.message + ')'; } |
michael@0 | 20 | is(success, shouldSucceed, message); |
michael@0 | 21 | } |
michael@0 | 22 | |
michael@0 | 23 | </script> |
michael@0 | 24 | </head> |
michael@0 | 25 | <body onload="setup()"> |
michael@0 | 26 | <input id="fileinput" type="file"></input> |
michael@0 | 27 | <iframe id="sink"> |
michael@0 | 28 | </body> |
michael@0 | 29 | </html> |