dom/plugins/test/mochitest/test_pluginstream_seek_close.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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);
    12   SimpleTest.waitForExplicitFinish();
    13   setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
    15   function frameLoaded() {
    16     var testframe = document.getElementById('testframe');
    17     var content = testframe.contentDocument.body.innerHTML;
    18     if (!content.length)
    19       return;
    21     ok(true, "We didn't crash");
    22     SimpleTest.finish();
    23   }
    24 </script>
    25 </head>
    26 <body>
    27   <p id="display"></p>
    29   <iframe id="testframe" name="testframe" onload="frameLoaded()"></iframe>
    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>
    44 </body>
    45 </html>

mercurial