Bug 981470. Combine test_audioDocumentTitle and test_videoDocumentTitle and avoid testing WAV files, which aren't supposed to load properly in <iframe>s. r=cpearce

--HG--
rename : content/media/test/test_audioDocumentTitle.html => content/media/test/test_documentTitle.html
extra : rebase_source : 27016e8c3a15dcbfeb9462a17f27b043ac977d75
This commit is contained in:
Robert O'Callahan 2014-03-10 10:45:14 +08:00
parent 293334dacc
commit 121f4a711d
3 changed files with 27 additions and 74 deletions

View File

@ -344,6 +344,7 @@ skip-if = buildapp == 'b2g' || e10s
[test_defaultMuted.html]
[test_delay_load.html]
skip-if = buildapp == 'b2g' # b2g(6 failures) b2g-debug(6 failures) b2g-desktop(6 failures)
[test_documentTitle.html]
[test_error_on_404.html]
skip-if = buildapp == 'b2g' && (toolkit != 'gonk' || debug)) # b2g-debug(timed out) b2g-desktop(timed out)
[test_framebuffer.html]
@ -452,14 +453,12 @@ skip-if = buildapp == 'b2g'
[test_VideoPlaybackQuality_disabled.html]
[test_webvtt_disabled.html]
# [test_audioDocumentTitle.html] # disabled - See bug 475110
# [test_error_in_video_document.html] # disabled - See bug 608634
# [test_mixed_principals.html] # disabled - See bug 567954 and 574586
# [test_playback_rate_playpause.html] # disabled - See bug 897108
# [test_played.html] # disabled - See bug 751539
# [test_preload_suspend.html] # disabled - See bug 493692
# [test_resume.html] # disabled - No bug :-(
# [test_videoDocumentTitle.html] # disabled - See bug 492821
# [test_playback_rate.html] # disabled - See bug 921622
# Disabled since it causes random memory corruption, bug 921622, so

View File

@ -6,6 +6,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=463830
<head>
<title>Test for Bug 463830</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="manifest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
@ -13,39 +14,49 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=463830
<p id="display"></p>
<iframe id="i"></iframe>
<div id="content" style="display: none">
</div>
<audio id="dummy"></audio>
<pre id="test">
<script type="application/javascript">
/** Test for Bug 463830 **/
var gTests = [
{ file: "r11025_s16_c1.wav", title: "r11025_s16_c1.wav" }
];
var gTestNum = 0;
addLoadEvent(runTest);
var title;
var title = "WRONG";
var i = document.getElementById("i");
function runTest() {
if (gTestNum == gTests.length) {
i.addEventListener("load", function() {
dump(title + " " + i.contentDocument.title + "\n");
is(i.contentDocument.title, title, "Checking doc title for " + title);
setTimeout(nextTest, 0);
}, false);
nextTest();
}
function nextTest() {
if (gTestNum == gSmallTests.length) {
SimpleTest.finish();
return;
}
if (gTestNum == 0) {
i.addEventListener("load", function() {
is(i.contentDocument.title, title, "Doc title incorrect");
setTimeout(runTest, 0);
}, false);
var test = gSmallTests[gTestNum];
gTestNum++;
if (!dummy.canPlayType(test.type) ||
test.type == "audio/x-wav") {
// Skip WAVE files since we deliberately don't treat WAVE files as a type
// we can handle in an <object> or <iframe> (bug 475110)
return nextTest();
}
title = gTests[gTestNum].title;
i.src = gTests[gTestNum].file;
gTestNum++;
dump("Setting i.src to " + test.name + "\n");
title = test.name;
i.src = test.name;
}
SimpleTest.waitForExplicitFinish();

View File

@ -1,57 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=463830
-->
<head>
<title>Test for Bug 463830</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=463830">Mozilla Bug 463830</a>
<p id="display"></p>
<iframe id="i"></iframe>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
/** Test for Bug 463830 **/
var gTests = [
{ file: "320x240.ogv", title: "320x240.ogv" },
{ file: "bug461281.ogg", title: "bug461281.ogg" },
];
var gTestNum = 0;
addLoadEvent(runTest);
var title;
var i = document.getElementById("i");
function runTest() {
if (gTestNum == gTests.length) {
SimpleTest.finish();
return;
}
if (gTestNum == 0) {
i.addEventListener("load", function() {
is(i.contentDocument.title, title, "Doc title incorrect");
setTimeout(runTest, 0);
}, false);
}
title = gTests[gTestNum].title;
i.src = gTests[gTestNum].file;
gTestNum++;
}
SimpleTest.waitForExplicitFinish();
</script>
</pre>
</body>
</html>