Backed out changeset 3d7da5a9c91d (bug 1352559)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Wed, 12 Jul 2017 19:10:55 +0200
changeset 607715 f239f27f8a3b764b76cf1ac394e74e52cc953c44
parent 607714 28f351ecb49b91cba62b4be6ed222657a4b01143
child 607716 0ca01a17858c522f78a6ebe1c6db4dd09819c8da
push id68095
push userbmo:rbarker@mozilla.com
push dateWed, 12 Jul 2017 20:01:47 +0000
bugs1352559
milestone56.0a1
backs out3d7da5a9c91dbd2cbc0cccae600774700d7649d5
Backed out changeset 3d7da5a9c91d (bug 1352559)
dom/plugins/test/mochitest/mochitest.ini
dom/plugins/test/mochitest/test_fullpage.html
dom/plugins/test/mochitest/test_pluginstream_newstream.html
dom/plugins/test/mochitest/test_pluginstream_seek.html
dom/plugins/test/mochitest/test_pluginstream_seek_close.html
--- a/dom/plugins/test/mochitest/mochitest.ini
+++ b/dom/plugins/test/mochitest/mochitest.ini
@@ -79,16 +79,17 @@ skip-if = !crashreporter
 [test_crashing2.html]
 skip-if = (!crashreporter) || true # Bug 566049
 [test_CrashService_crash.html]
 skip-if = !crashreporter || e10s
 [test_CrashService_hang.html]
 skip-if = !crashreporter || e10s
 [test_defaultValue.html]
 [test_enumerate.html]
+[test_fullpage.html]
 [test_GCrace.html]
 [test_hanging.html]
 skip-if = !crashreporter || e10s
 [test_hidden_plugin.html]
 [test_instance_re-parent.html]
 skip-if = release_or_beta # Bug 1172627
 [test_instance_unparent1.html]
 [test_instance_unparent2.html]
@@ -118,19 +119,22 @@ support-files = plugin_scroll_invalidati
 skip-if = true # Bug 596491
 [test_pluginstream_asfile.html]
 [test_pluginstream_asfileonly.html]
 [test_pluginstream_err.html]
 [test_pluginstream_geturl.html]
 skip-if = true # Bug 1267432
 [test_pluginstream_geturlnotify.html]
 skip-if = true # Bug 1267432
+[test_pluginstream_newstream.html]
 [test_pluginstream_post.html]
 [test_pluginstream_poststream.html]
 [test_pluginstream_referer.html]
+[test_pluginstream_seek.html]
+[test_pluginstream_seek_close.html]
 [test_pluginstream_src.html]
 [test_pluginstream_src_dynamic.html]
 [test_pluginstream_src_referer.html]
 [test_positioning.html]
 skip-if = true # disabled due to oddness, perhaps scrolling of the mochitest window?
 [test_propertyAndMethod.html]
 [test_queryCSSZoomFactor.html]
 [test_queryContentsScaleFactor.html]
new file mode 100644
--- /dev/null
+++ b/dom/plugins/test/mochitest/test_fullpage.html
@@ -0,0 +1,35 @@
+<head>
+  <title>Full-page seekable stream</title>
+
+  <script type="text/javascript"
+          src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="plugin-utils.js"></script>
+  <link rel="stylesheet" type="text/css"
+        href="/tests/SimpleTest/test.css">
+
+<body>
+  <p id="display"></p>
+
+  <script type="application/javascript">
+    SimpleTest.waitForExplicitFinish();
+    setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
+
+    function frameLoaded() {
+      var testframe = document.getElementById('testframe');
+      var content = testframe.contentDocument.body.innerHTML;
+      if (!content.length)
+        return;
+
+      var req = new XMLHttpRequest();
+      req.open('GET', 'loremipsum.xtest', false);
+      req.overrideMimeType('text/plain; charset=x-user-defined');
+      req.send(null);
+      is(req.status, 200, "bad XMLHttpRequest");
+      is(content, req.responseText.replace(/\r\n/g, "\n"),
+         "content doesn't match");
+      SimpleTest.finish();
+    }
+  </script>
+
+  <iframe src="loremipsum.xtest" streamtype="seek"></iframe>
+  <iframe id="testframe" name="testframe" onload="frameLoaded()"></iframe>
new file mode 100644
--- /dev/null
+++ b/dom/plugins/test/mochitest/test_pluginstream_newstream.html
@@ -0,0 +1,32 @@
+<html>
+<head>
+  <title>NPAPI NPN_NewStream NPStream Test</title>
+  <script type="text/javascript" 
+          src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="text/javascript" 
+          src="pluginstream.js"></script>
+  <script type="text/javascript" src="plugin-utils.js"></script>
+  <script type="text/javascript">
+    setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
+  </script>
+  <link rel="stylesheet" type="text/css" 
+        href="/tests/SimpleTest/test.css" />
+</head>
+<body>
+  <p id="display"></p>
+
+  <iframe id="testframe" name="testframe" onload="frameLoaded()"></iframe>
+
+  <!--
+   - A stream is sent to the browser via NPP_NewStream, NP_NORMAL.
+   - When NPP_DestroyStream is called, the plugin sends the stream
+   - content back to the browser by calling NPN_NewStream and 
+   - NPN_Write.  The stream content should be displayed in the specified
+   - frame.
+   -->
+  <embed src="loremipsum.txt" streammode="normal"
+         newstream="true" frame="testframe"
+         id="embedtest" style="width: 400px; height: 100px;"
+         type="application/x-test"></embed>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/plugins/test/mochitest/test_pluginstream_seek.html
@@ -0,0 +1,33 @@
+<body>
+<head>
+  <title>NPAPI Seekable NPStream Test</title>
+  <script type="text/javascript" 
+          src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="text/javascript" 
+          src="pluginstream.js"></script>
+  <script type="text/javascript" src="plugin-utils.js"></script>
+  <script type="text/javascript">
+    setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
+  </script>
+  <link rel="stylesheet" type="text/css" 
+        href="/tests/SimpleTest/test.css" />
+</head>
+<body>
+  <p id="display"></p>
+
+  <iframe id="testframe" name="testframe" onload="frameLoaded()"></iframe>
+
+  <!--
+   - Tests a seekable stream.  Calls NPN_RequestRead with the specified
+   - range, and verifies that an NPP_Write call is made with the correct 
+   - parameters, including the buffer data for the byte range.  Once all 
+   - calls to NPP_Write have finished, the plugin calls NPN_DestroyStream 
+   - and then displays the entire stream's content in a browser frame via 
+   - NPN_GetURL.
+   -->
+  <embed src="loremipsum.txt" streammode="seek"
+         frame="testframe" streamchunksize="1024" range="100,100"
+         id="embedtest" style="width: 400px; height: 100px;"
+         type="application/x-test"></embed>
+</body>
+</html>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/dom/plugins/test/mochitest/test_pluginstream_seek_close.html
@@ -0,0 +1,45 @@
+<body>
+<head>
+  <title>NPAPI Seekable NPStream Test</title>
+  <script type="text/javascript" 
+          src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="text/javascript" src="plugin-utils.js"></script>
+  <link rel="stylesheet" type="text/css" 
+        href="/tests/SimpleTest/test.css" />
+<script>
+  SimpleTest.expectAssertions(0, 1);
+
+  SimpleTest.waitForExplicitFinish();
+  setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
+
+  function frameLoaded() {
+    var testframe = document.getElementById('testframe');
+    var content = testframe.contentDocument.body.innerHTML;
+    if (!content.length)
+      return;
+
+    ok(true, "We didn't crash");
+    SimpleTest.finish();
+  }
+</script>
+</head>
+<body>
+  <p id="display"></p>
+
+  <iframe id="testframe" name="testframe" onload="frameLoaded()"></iframe>
+
+  <!--
+   - Tests a seekable stream.  Calls NPN_RequestRead with the specified
+   - range, and verifies that an NPP_Write call is made with the correct 
+   - parameters, including the buffer data for the byte range.  Once all 
+   - calls to NPP_Write have finished, the plugin calls NPN_DestroyStream 
+   - and then displays the entire stream's content in a browser frame via 
+   - NPN_GetURL.
+   -->
+  <embed src="neverending.sjs" streammode="seek" closestream
+         frame="testframe" streamchunksize="1024" range="100,100"
+         id="embedtest" style="width: 400px; height: 100px;"
+         type="application/x-test"></embed>
+
+</body>
+</html>