content/base/test/test_bug578096.html

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=578096
     5 -->
     6 <head>
     7   <title>Test for Bug 578096</title>
     8   <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
     9   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    10   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    11 </head>
    12 <body>
    13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=578096">Mozilla Bug 578096</a>
    14 <p id="display"></p>
    15 <div id="content">
    16    <input type="file" id="file" onchange="fireXHR()">
    17 </div>
    18 <pre id="test">
    19 <script class="testbody" type="text/javascript">
    20 SimpleTest.waitForExplicitFinish();
    22 var url = SimpleTest.getTestFileURL("bug578096LoadChromeScript.js");
    23 var script = SpecialPowers.loadChromeScript(url);
    25 script.addMessageListener("file.path", function (message) {
    26   SpecialPowers.wrap(document.getElementById('file')).value = message;
    28   var xhr = new XMLHttpRequest();
    29   xhr.onreadystatechange = function(event) {
    30     if (xhr.readyState == 4) {
    31       script.sendAsyncMessage("file.remove", {});
    32     }
    33   }
    35   xhr.open('POST', window.location, true);
    36   xhr.send(document.getElementById('file').files[0]);
    37 });
    39 script.addMessageListener("file.removed", function (message) {
    40   ok(true, "We didn't throw! Yay!");
    41   script.destroy();
    42   SimpleTest.finish();
    43 });
    45 script.sendAsyncMessage("file.create", {});
    46 </script>
    47 </pre>
    48 </body>
    49 </html>

mercurial