dom/tests/mochitest/general/file_clonewrapper.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <!doctype html>
     2 <html>
     3 <head>
     4 <script type="application/javascript">
     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   }
    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   }
    23 </script>
    24 </head>
    25 <body onload="setup()">
    26 <input id="fileinput" type="file"></input>
    27 <iframe id="sink">
    28 </body>
    29 </html>

mercurial