dom/plugins/test/mochitest/test_streamatclose.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 <html>
     2 <head>
     3   <title>Stream open at NPP_Destroy</title>
     4   <script type="text/javascript"
     5 	  src="/tests/SimpleTest/SimpleTest.js"></script>
     6   <script type="text/javascript" src="utils.js"></script>
     7   <link rel="stylesheet" type="text/css"
     8 	href="/tests/SimpleTest/test.css">
    10 <body onload="startTest()">
    11   <script type="text/javascript">
    12   SimpleTest.waitForExplicitFinish();
    13   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
    15   var urlnotified = false;
    17   var p = null;
    19   function startTest() {
    20     p = document.getElementById('embedtest');
    21     ok(p.streamTest("neverending.sjs", false, null, null,
    22                     function(r, t) {
    23                       is(r, 2, "Stream should have failed");
    24                       urlnotified = true;
    25                     }, null, true), "neverending.sjs started successfully");
    27     setTimeout(removePlugin, 500);
    28   }
    30   function removePlugin() {
    31     document.body.removeChild(p); // Fires NPP_Destroy immediately
    32     SimpleTest.executeSoon(done);
    33   }
    35   function done() {
    36     ok(urlnotified, "NPP_URLNotify should be called if streams are active at NPP_Destroy");
    37     SimpleTest.finish();
    38   }
    40   </script>
    42   <p id="display"></p>
    44   <embed id="embedtest"
    45    style="width: 400px; height: 100px;" type="application/x-test"></embed>

mercurial