dom/plugins/test/mochitest/test_pluginstream_src_dynamic.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_src_dynamic.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,43 @@
     1.4 +<html>
     1.5 +<head>
     1.6 +  <title>NPAPI src="" NPStream Test</title>
     1.7 +  <script type="text/javascript" 
     1.8 +          src="/tests/SimpleTest/SimpleTest.js"></script>
     1.9 +  <script type="text/javascript" 
    1.10 +          src="pluginstream.js"></script>
    1.11 +  <script type="text/javascript" src="utils.js"></script>
    1.12 +  <script type="text/javascript">
    1.13 +    setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
    1.14 +  </script>
    1.15 +  <link rel="stylesheet" type="text/css" 
    1.16 +        href="/tests/SimpleTest/test.css" />
    1.17 +</head>
    1.18 +<body>
    1.19 +  <p id="display"></p>
    1.20 +
    1.21 +  <iframe id="testframe" name="testframe" onload="frameLoaded()"></iframe>
    1.22 +
    1.23 +  <!--
    1.24 +   - A stream is sent to the browser via NPP_NewStream, NP_NORMAL.
    1.25 +   - The plugin reports that data can only be sent to it in 100-byte
    1.26 +   - chunks.  When NPP_DestroyStream is called, the plugin sends the stream
    1.27 +   - content back to the browser by passing it as a data: url to
    1.28 +   - NPN_GetURL, using a frame, so that the stream content should 
    1.29 +   - be displayed in the frame in the browser.
    1.30 +   -
    1.31 +   - We create the object element dynamically, which in some cases has caused us to deliver the data=""
    1.32 +   - stream twice. This verifies that we only deliver the data="" stream once.
    1.33 +   -->
    1.34 +
    1.35 +  <script type="text/javascript">
    1.36 +    var e = document.createElement('object');
    1.37 +    e.setAttribute('data', 'loremipsum.xtest');
    1.38 +    e.setAttribute('type', 'application/x-test');
    1.39 +    e.setAttribute('streammode', 'normal');
    1.40 +    e.setAttribute('streamchunksize', '100');
    1.41 +    e.setAttribute('frame', 'testframe');
    1.42 +    e.setAttribute('style', 'width: 400px; height: 100px;');
    1.43 +    document.body.appendChild(e);
    1.44 +  </script>
    1.45 +</body>
    1.46 +</html>

mercurial