Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / content / media / video / test / test_decoder_disable.html
blob1f2b65b5c037589e8103b669676342431893fdb9
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=448600
5 -->
6 <head>
7 <title>Test for Bug 448600</title>
8 <script type="application/javascript" src="/MochiKit/MochiKit.js"></script>
9 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
11 </head>
12 <body>
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=448600">Mozilla Bug 448600</a>
14 <p id="display"></p>
15 <div id="content" style="display: none">
16 </div>
18 <pre id="test">
19 <script type="application/javascript">
21 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
22 var prefService = Components.classes["@mozilla.org/preferences-service;1"]
23 .getService(Components.interfaces.nsIPrefService);
24 var branch = prefService.getBranch("media.");
25 var gOldOggPref = branch.getBoolPref("ogg.enabled");
26 var gOldWavePref = branch.getBoolPref("wave.enabled");
28 branch.setBoolPref("ogg.enabled", false);
29 branch.setBoolPref("wave.enabled", false);
31 </script>
33 <video id="video1">
34 <source type="video/ogg" src="320x240.ogg"/>
35 <source type="audio/wave" src="r11025_u8_c1.wav"/>
36 </video>
38 <video id="video2" src="320x240.ogg"></video>
39 <video id="video3" src="r11025_u8_c1.wav"></video>
41 <script>
43 SimpleTest.waitForExplicitFinish();
45 function doTest() {
46 is(document.getElementById('video1').currentSrc, "");
47 is(document.getElementById('video2').currentSrc, "");
48 is(document.getElementById('video3').currentSrc, "");
50 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
52 branch.setBoolPref("ogg.enabled", gOldOggPref);
53 branch.setBoolPref("wave.enabled", gOldWavePref);
55 SimpleTest.finish();
58 // Using a timeout here sucks, but we currently have no way
59 // to be notified that the element couldn't load. At least if this timeout
60 // happens "too early", the test will pass instead of failing.
61 setTimeout(doTest, 1000);
63 </script>
64 </pre>
65 </body>
66 </html>