dom/plugins/test/mochitest/test_newstreamondestroy.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 <head>
     2   <title>NPN_GetURL called from NPP_Destroy</title>
     3   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     4   <script type="application/javascript" src="utils.js"></script>
     6   <link rel="stylesheet" type="text/css"
     7 	href="/tests/SimpleTest/test.css">
     9 <body onload="runTest()">
    10   <script class="testbody" type="application/javascript">
    11   SimpleTest.waitForExplicitFinish();
    12   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
    14   function runTest() {
    15     var p = document.getElementById('plugin1');
    16     var destroyed = false;
    17     p.callOnDestroy(function() {
    18       destroyed = true;
    19       ok(!p.streamTest('loremipsum.txt', false, null, null,
    20                        function(r, t) {
    21                          ok(false, "get-during-destroy should have failed");
    22                        }, null, true), "NPN_GetURLNotify should fail during NPP_Destroy");
    23     });
    24     document.body.removeChild(p);
    26     setTimeout(function() {
    27       ok(destroyed, "callback was fired as expected");
    28       SimpleTest.finish();
    29     }, 1000);
    30   }
    31   </script>
    33   <p id="display"></p>
    35   <embed id="plugin1" type="application/x-test"></embed>

mercurial