2008-12-12 00:17:57 -08:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<!--
|
|
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=448600
|
|
|
|
-->
|
|
|
|
<head>
|
|
|
|
<title>Test for Bug 448600</title>
|
|
|
|
<script type="application/javascript" src="/MochiKit/MochiKit.js"></script>
|
|
|
|
<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=448600">Mozilla Bug 448600</a>
|
|
|
|
<p id="display"></p>
|
|
|
|
<div id="content" style="display: none">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<pre id="test">
|
|
|
|
<script type="application/javascript">
|
|
|
|
|
|
|
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
|
|
|
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
|
|
|
|
.getService(Components.interfaces.nsIPrefService);
|
|
|
|
var branch = prefService.getBranch("media.");
|
|
|
|
var gOldOggPref = branch.getBoolPref("ogg.enabled");
|
|
|
|
var gOldWavePref = branch.getBoolPref("wave.enabled");
|
|
|
|
|
|
|
|
branch.setBoolPref("ogg.enabled", false);
|
|
|
|
branch.setBoolPref("wave.enabled", false);
|
|
|
|
|
2009-02-15 08:26:32 -08:00
|
|
|
var gLoadError = new Object();
|
2008-12-12 00:17:57 -08:00
|
|
|
|
2009-02-15 08:26:32 -08:00
|
|
|
gLoadError['video1'] = 0;
|
|
|
|
gLoadError['video2'] = 0;
|
|
|
|
gLoadError['video3'] = 0;
|
2008-12-12 00:17:57 -08:00
|
|
|
|
2009-02-15 08:26:32 -08:00
|
|
|
var gErrorCount = 0;
|
2008-12-12 00:17:57 -08:00
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
|
2009-02-15 08:26:32 -08:00
|
|
|
function finishTest() {
|
|
|
|
is(document.getElementById('video1').currentSrc, "", 'video1.currentSrc==""');
|
|
|
|
is(document.getElementById('video2').currentSrc, "", 'video2.currentSrc==""');
|
|
|
|
is(document.getElementById('video3').currentSrc, "", 'video3.currentSrc==""');
|
2008-12-12 00:17:57 -08:00
|
|
|
|
2009-02-15 08:26:32 -08:00
|
|
|
is(gLoadError['video1'], 1, "Load error on video1");
|
|
|
|
is(gLoadError['video2'], 1, "Load error on video2");
|
|
|
|
is(gLoadError['video3'], 1, "Load error on video3");
|
|
|
|
|
2008-12-12 00:17:57 -08:00
|
|
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
|
|
|
|
|
|
|
branch.setBoolPref("ogg.enabled", gOldOggPref);
|
|
|
|
branch.setBoolPref("wave.enabled", gOldWavePref);
|
|
|
|
|
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
|
2009-02-15 08:26:32 -08:00
|
|
|
function videoError(event, id) {
|
|
|
|
event.stopPropagation();
|
|
|
|
gLoadError[id]++;
|
|
|
|
gErrorCount++;
|
|
|
|
if (gErrorCount == 3) {
|
|
|
|
finishTest();
|
|
|
|
}
|
|
|
|
}
|
2008-12-12 00:17:57 -08:00
|
|
|
|
|
|
|
</script>
|
2009-02-15 08:26:32 -08:00
|
|
|
|
|
|
|
<video id="video1" onerror="videoError(event, 'video1');">
|
|
|
|
<source type="video/ogg" src="320x240.ogv"/>
|
|
|
|
<source type="audio/wave" src="r11025_u8_c1.wav"/>
|
|
|
|
</video>
|
|
|
|
|
|
|
|
<video id="video2" src="320x240.ogv" onerror="videoError(event, 'video2');"></video>
|
|
|
|
<video id="video3" src="r11025_u8_c1.wav" onerror="videoError(event, 'video3');"></video>
|
|
|
|
|
2008-12-12 00:17:57 -08:00
|
|
|
</pre>
|
2009-02-15 08:26:32 -08:00
|
|
|
|
2008-12-12 00:17:57 -08:00
|
|
|
</body>
|
|
|
|
</html>
|