dom/tests/mochitest/general/file_clonewrapper.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/tests/mochitest/general/file_clonewrapper.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,29 @@
     1.4 +<!doctype html>
     1.5 +<html>
     1.6 +<head>
     1.7 +<script type="application/javascript">
     1.8 +
     1.9 +  // Set up the objects for cloning.
    1.10 +  function setup() {
    1.11 +    window.testObject = { myNumber: 42,
    1.12 +                          myDomain: window.location.domain };
    1.13 +    window.blob = new Blob([], { type: 'text/plain' });
    1.14 +    window.fileList = document.getElementById('fileinput').files;
    1.15 +  }
    1.16 +
    1.17 +  // Called by the chrome parent window.
    1.18 +  function tryToClone(obj, shouldSucceed, message) {
    1.19 +    var success = false;
    1.20 +    var sink = window.frames[0];
    1.21 +    try { sink.postMessage(obj, '*'); success = true; }
    1.22 +    catch (e) { message = message + ' (threw: ' + e.message + ')'; }
    1.23 +    is(success, shouldSucceed, message);
    1.24 +  }
    1.25 +
    1.26 +</script>
    1.27 +</head>
    1.28 +<body onload="setup()">
    1.29 +<input id="fileinput" type="file"></input>
    1.30 +<iframe id="sink">
    1.31 +</body>
    1.32 +</html>

mercurial