summaryrefslogtreecommitdiffstats
path: root/dom/plugins/test/mochitest/test_pluginstream_3rdparty.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /dom/plugins/test/mochitest/test_pluginstream_3rdparty.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/plugins/test/mochitest/test_pluginstream_3rdparty.html')
-rw-r--r--dom/plugins/test/mochitest/test_pluginstream_3rdparty.html76
1 files changed, 76 insertions, 0 deletions
diff --git a/dom/plugins/test/mochitest/test_pluginstream_3rdparty.html b/dom/plugins/test/mochitest/test_pluginstream_3rdparty.html
new file mode 100644
index 000000000..aa7dbb5a1
--- /dev/null
+++ b/dom/plugins/test/mochitest/test_pluginstream_3rdparty.html
@@ -0,0 +1,76 @@
+<!-- Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ -->
+<html>
+<head>
+ <title>NPAPI NPN_GetURL NPStream Test</title>
+ <meta charset=UTF-8>
+ <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" src="/tests/SimpleTest/SpawnTask.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"></iframe>
+
+ <script>
+ /**
+ * Tests that we still properly do or don't send cookies for requests from
+ * plugins when the user has disabled 3rd-party cookies. See
+ * pluginstream.js where we verify that we get the same content as for XHR
+ * requests.
+ */
+ SimpleTest.waitForExplicitFinish();
+ function get_embed_elt() {
+ var e = document.createElement("embed");
+ e.setAttribute("streammode", "normal");
+ e.setAttribute("streamchunksize", "1024");
+ e.setAttribute("frame", "testframe");
+ e.setAttribute("id", "embedtest");
+ e.setAttribute("style", "width: 400px; height: 100px;");
+ e.setAttribute("type", "application/x-test");
+ return e;
+ }
+
+ function* test_runner() {
+ function create_embed(host) {
+ var e = get_embed_elt();
+
+ const url =
+ `http://${host}/tests/dom/plugins/test/mochitest/file_checkcookie.sjs`;
+ e.setAttribute('geturl', url);
+ document.body.appendChild(e);
+
+ return new Promise(resolve => {
+ $('testframe').addEventListener("load", function loaded() {
+ $('testframe').removeEventListener("load", loaded);
+ resolve();
+ });
+ });
+ }
+
+ // Same origin
+ yield create_embed("mochi.test:8888");
+ yield create_embed("example.org");
+ }
+
+ document.cookie = "found=a_cookie";
+ var example_iframe = document.createElement("iframe");
+ example_iframe.src = "http://example.org/tests/dom/plugins/test/mochitest/file_setcookie.html";
+ example_iframe.addEventListener("load", () => {
+ $('testframe').addEventListener("load", () => frameLoaded(false, true));
+ SpecialPowers.pushPrefEnv({ set: [[ 'network.cookie.cookieBehavior', 1 ]] },
+ () => (spawn_task(test_runner).then(SimpleTest.finish)));
+ });
+ document.body.appendChild(example_iframe);
+ </script>
+ </body>
+ </html>