dom/plugins/test/mochitest/test_newstreamondestroy.html

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:45e424416578
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>
5
6 <link rel="stylesheet" type="text/css"
7 href="/tests/SimpleTest/test.css">
8
9 <body onload="runTest()">
10 <script class="testbody" type="application/javascript">
11 SimpleTest.waitForExplicitFinish();
12 setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
13
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);
25
26 setTimeout(function() {
27 ok(destroyed, "callback was fired as expected");
28 SimpleTest.finish();
29 }, 1000);
30 }
31 </script>
32
33 <p id="display"></p>
34
35 <embed id="plugin1" type="application/x-test"></embed>

mercurial