dom/plugins/test/mochitest/test_pluginstream_seek_close.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/plugins/test/mochitest/test_pluginstream_seek_close.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,45 @@
     1.4 +<body>
     1.5 +<head>
     1.6 +  <title>NPAPI Seekable NPStream Test</title>
     1.7 +  <script type="text/javascript" 
     1.8 +          src="/tests/SimpleTest/SimpleTest.js"></script>
     1.9 +  <script type="text/javascript" src="utils.js"></script>
    1.10 +  <link rel="stylesheet" type="text/css" 
    1.11 +        href="/tests/SimpleTest/test.css" />
    1.12 +<script>
    1.13 +  SimpleTest.expectAssertions(0, 1);
    1.14 +
    1.15 +  SimpleTest.waitForExplicitFinish();
    1.16 +  setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
    1.17 +
    1.18 +  function frameLoaded() {
    1.19 +    var testframe = document.getElementById('testframe');
    1.20 +    var content = testframe.contentDocument.body.innerHTML;
    1.21 +    if (!content.length)
    1.22 +      return;
    1.23 +
    1.24 +    ok(true, "We didn't crash");
    1.25 +    SimpleTest.finish();
    1.26 +  }
    1.27 +</script>
    1.28 +</head>
    1.29 +<body>
    1.30 +  <p id="display"></p>
    1.31 +
    1.32 +  <iframe id="testframe" name="testframe" onload="frameLoaded()"></iframe>
    1.33 +
    1.34 +  <!--
    1.35 +   - Tests a seekable stream.  Calls NPN_RequestRead with the specified
    1.36 +   - range, and verifies that an NPP_Write call is made with the correct 
    1.37 +   - parameters, including the buffer data for the byte range.  Once all 
    1.38 +   - calls to NPP_Write have finished, the plugin calls NPN_DestroyStream 
    1.39 +   - and then displays the entire stream's content in a browser frame via 
    1.40 +   - NPN_GetURL.
    1.41 +   -->
    1.42 +  <embed src="neverending.sjs" streammode="seek" closestream
    1.43 +         frame="testframe" streamchunksize="1024" range="100,100"
    1.44 +         id="embedtest" style="width: 400px; height: 100px;"
    1.45 +         type="application/x-test"></embed>
    1.46 +
    1.47 +</body>
    1.48 +</html>

mercurial