dom/tests/mochitest/general/file_clonewrapper.html

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

mercurial