Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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>