summaryrefslogtreecommitdiffstats
path: root/dom/base/test/file_youtube_flash_embed.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/base/test/file_youtube_flash_embed.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/base/test/file_youtube_flash_embed.html')
-rw-r--r--dom/base/test/file_youtube_flash_embed.html65
1 files changed, 65 insertions, 0 deletions
diff --git a/dom/base/test/file_youtube_flash_embed.html b/dom/base/test/file_youtube_flash_embed.html
new file mode 100644
index 000000000..47bf52ede
--- /dev/null
+++ b/dom/base/test/file_youtube_flash_embed.html
@@ -0,0 +1,65 @@
+<!DOCTYPE HTML>
+<html>
+ <!--
+ https://bugzilla.mozilla.org/show_bug.cgi?id=1240471
+ -->
+ <head>
+ <meta charset="utf-8">
+ <title>Test for Bug 1240471</title>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+ <script type="application/javascript">
+ let SimpleTest = {
+ finish: function() {
+ parent.postMessage(JSON.stringify({fn: "finish"}), "*");
+ }
+ };
+ ["ok", "is", "info"].forEach(fn => {
+ self[fn] = function (...args) {
+ parent.postMessage(JSON.stringify({fn: fn, args: args}), "*");
+ }
+ });
+ "use strict";
+ function onLoad() {
+ let youtube_changed_url_query = "https://mochitest.youtube.com/embed/Xm5i5kbIXzc?start=10&end=20";
+
+ function testEmbed(embed, expected_url, expected_fullscreen) {
+ ok (!!embed, "Embed node exists");
+ // getSVGDocument will return HTMLDocument if the content is HTML
+ let doc = embed.getSVGDocument();
+ // doc must be unprivileged because privileged doc will always be
+ // allowed to use fullscreen.
+ is (doc.fullscreenEnabled, expected_fullscreen,
+ "fullscreen should be " + (expected_fullscreen ? "enabled" : "disabled"));
+ embed = SpecialPowers.wrap(embed);
+ is (embed.srcURI.spec, expected_url, "Should have src uri of " + expected_url);
+ }
+ info("Running youtube rewrite query test");
+ testEmbed(document.getElementById("testembed-correct"), youtube_changed_url_query, false);
+ testEmbed(document.getElementById("testembed-correct-fs"), youtube_changed_url_query, true);
+ testEmbed(document.getElementById("testembed-wrong"), youtube_changed_url_query, false);
+ testEmbed(document.getElementById("testembed-whywouldyouevendothat"), youtube_changed_url_query, true);
+ SimpleTest.finish();
+ }
+ </script>
+ </head>
+ <body onload="onLoad()">
+ <embed id="testembed-correct"
+ src="https://mochitest.youtube.com/v/Xm5i5kbIXzc?start=10&end=20"
+ type="application/x-shockwave-flash"
+ allowscriptaccess="always"></embed>
+ <embed id="testembed-correct-fs"
+ src="https://mochitest.youtube.com/v/Xm5i5kbIXzc?start=10&end=20"
+ type="application/x-shockwave-flash"
+ allowfullscreen
+ allowscriptaccess="always"></embed>
+ <embed id="testembed-wrong"
+ src="https://mochitest.youtube.com/v/Xm5i5kbIXzc&start=10&end=20"
+ type="application/x-shockwave-flash"
+ allowscriptaccess="always"></embed>
+ <embed id="testembed-whywouldyouevendothat"
+ src="https://mochitest.youtube.com/v/Xm5i5kbIXzc&start=10?end=20"
+ type="application/x-shockwave-flash"
+ allowfullscreen
+ allowscriptaccess="always"></embed>
+ </body>
+</html>