|
1 <body> |
|
2 <head> |
|
3 <title>NPAPI Seekable NPStream Test</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 <script> |
|
10 SimpleTest.expectAssertions(0, 1); |
|
11 |
|
12 SimpleTest.waitForExplicitFinish(); |
|
13 setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED); |
|
14 |
|
15 function frameLoaded() { |
|
16 var testframe = document.getElementById('testframe'); |
|
17 var content = testframe.contentDocument.body.innerHTML; |
|
18 if (!content.length) |
|
19 return; |
|
20 |
|
21 ok(true, "We didn't crash"); |
|
22 SimpleTest.finish(); |
|
23 } |
|
24 </script> |
|
25 </head> |
|
26 <body> |
|
27 <p id="display"></p> |
|
28 |
|
29 <iframe id="testframe" name="testframe" onload="frameLoaded()"></iframe> |
|
30 |
|
31 <!-- |
|
32 - Tests a seekable stream. Calls NPN_RequestRead with the specified |
|
33 - range, and verifies that an NPP_Write call is made with the correct |
|
34 - parameters, including the buffer data for the byte range. Once all |
|
35 - calls to NPP_Write have finished, the plugin calls NPN_DestroyStream |
|
36 - and then displays the entire stream's content in a browser frame via |
|
37 - NPN_GetURL. |
|
38 --> |
|
39 <embed src="neverending.sjs" streammode="seek" closestream |
|
40 frame="testframe" streamchunksize="1024" range="100,100" |
|
41 id="embedtest" style="width: 400px; height: 100px;" |
|
42 type="application/x-test"></embed> |
|
43 |
|
44 </body> |
|
45 </html> |