|
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"> |
|
9 |
|
10 <body onload="startTest()"> |
|
11 <script type="text/javascript"> |
|
12 SimpleTest.waitForExplicitFinish(); |
|
13 setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED); |
|
14 |
|
15 var urlnotified = false; |
|
16 |
|
17 var p = null; |
|
18 |
|
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"); |
|
26 |
|
27 setTimeout(removePlugin, 500); |
|
28 } |
|
29 |
|
30 function removePlugin() { |
|
31 document.body.removeChild(p); // Fires NPP_Destroy immediately |
|
32 SimpleTest.executeSoon(done); |
|
33 } |
|
34 |
|
35 function done() { |
|
36 ok(urlnotified, "NPP_URLNotify should be called if streams are active at NPP_Destroy"); |
|
37 SimpleTest.finish(); |
|
38 } |
|
39 |
|
40 </script> |
|
41 |
|
42 <p id="display"></p> |
|
43 |
|
44 <embed id="embedtest" |
|
45 style="width: 400px; height: 100px;" type="application/x-test"></embed> |