Bug 769117 - Mochitests for youtube flash -> html5 rewriting; r=bz r=hsivonen

This commit is contained in:
Kyle Machulis 2016-01-08 14:20:44 -08:00
parent 6866d33064
commit acd41929a3
3 changed files with 55 additions and 0 deletions

View File

@ -258,3 +258,6 @@ https://sha256ee.example.com:443 privileged,cer
https://ssl3.example.com:443 privileged,ssl3
https://rc4.example.com:443 privileged,rc4
https://ssl3rc4.example.com:443 privileged,ssl3,rc4
# Hosts for youtube rewrite tests
https://mochitest.youtube.com:443

View File

@ -859,3 +859,4 @@ skip-if = buildapp == 'b2g' #no ssl support
[test_performance_translate.html]
[test_bug1198095.html]
[test_bug1187157.html]
[test_bug769117.html]

View File

@ -0,0 +1,51 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=769117
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 769117</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
/** Test for Bug 769117 **/
"use strict";
function onLoad () {
let youtube_url = "https://mochitest.youtube.com/v/Xm5i5kbIXzc";
let youtube_changed_url = "https://mochitest.youtube.com/embed/Xm5i5kbIXzc";
function testEmbed(embed) {
ok (embed, "Embed node exists");
embed = SpecialPowers.wrap(embed);
is (embed.srcURI.spec, youtube_changed_url, "Should have src uri of " + youtube_changed_url);
}
info("Running static embed youtube rewrite test");
testEmbed(document.getElementById("testembed"));
testEmbed(document.getElementById("testobject"));
info("Running dynamic embed youtube rewrite test");
let embed_dynamic = document.createElement("embed");
embed_dynamic.src = "https://mochitest.youtube.com/v/Xm5i5kbIXzc";
embed_dynamic.type = "application/x-shockwave-flash";
document.body.appendChild(embed_dynamic);
SimpleTest.executeSoon(() =>
{
testEmbed(embed_dynamic);
SimpleTest.finish();
});
}
</script>
</head>
<body onload="onLoad()">
<embed id="testembed"
src="https://mochitest.youtube.com/v/Xm5i5kbIXzc"
type="application/x-shockwave-flash"
allowscriptaccess="always"></embed>
<object id="testobject"
data="https://mochitest.youtube.com/v/Xm5i5kbIXzc"></embed>
</body>
</html>