mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
0d460e3432
This is split from the previous changeset since if we include dom/ the file size is too large for phabricator to handle. This is an autogenerated commit to handle scripts loading mochitest harness files, in the simple case where the script src is on the same line as the tag. This was generated with https://bug1544322.bmoattachments.org/attachment.cgi?id=9058170 using the `--part 2` argument. Differential Revision: https://phabricator.services.mozilla.com/D27457 --HG-- extra : moz-landing-system : lando
62 lines
1.6 KiB
HTML
62 lines
1.6 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<title>Media test: standalone video documents</title>
|
|
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
|
<script type="text/javascript" src="manifest.js"></script>
|
|
</head>
|
|
<body onload="doTest()">
|
|
|
|
<pre id="test">
|
|
<script class="testbody" type="text/javascript">
|
|
|
|
var iframes = [];
|
|
|
|
for (var i=0; i<gSmallTests.length; ++i) {
|
|
var test = gSmallTests[i];
|
|
|
|
// We can't play WAV files in stand alone documents, so just don't
|
|
// run the test on non-video content types.
|
|
var tag = getMajorMimeType(test.type);
|
|
if (tag != "video" || !document.createElement("video").canPlayType(test.type))
|
|
continue;
|
|
|
|
var f = document.createElement("iframe");
|
|
f.src = test.name;
|
|
f._test = test;
|
|
f.id = "frame" + i;
|
|
iframes.push(f);
|
|
document.body.appendChild(f);
|
|
}
|
|
|
|
|
|
function filename(uri) {
|
|
return uri.substr(uri.lastIndexOf("/")+1);
|
|
}
|
|
|
|
function doTest()
|
|
{
|
|
for (var i=0; i<iframes.length; ++i) {
|
|
var f = document.getElementById(iframes[i].id);
|
|
var v = f.contentDocument.body.firstChild;
|
|
is(v.tagName.toLowerCase(), "video", "Is video element");
|
|
var src = filename(v.currentSrc);
|
|
is(src, iframes[i]._test.name, "Name ("+src+") should match ("+iframes[i]._test.name+")");
|
|
is(v.controls, true, "Controls set (" + src + ")");
|
|
is(v.autoplay, true, "Autoplay set (" + src + ")");
|
|
}
|
|
SimpleTest.finish();
|
|
}
|
|
|
|
if (iframes.length == 0) {
|
|
todo(false, "No types supported");
|
|
} else {
|
|
SimpleTest.waitForExplicitFinish();
|
|
}
|
|
|
|
</script>
|
|
</pre>
|
|
</body>
|
|
</html>
|