dom/plugins/test/mochitest/test_newstreamondestroy.html

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     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