Bug 896582 - Implement a workaround to bug 838726 to get a bunch of content/media mochitests running on B2G. r=jgriffin

This commit is contained in:
Martijn Wargers 2013-07-25 22:32:17 +02:00
parent a4a5e87045
commit a14788acd3
3 changed files with 78 additions and 16 deletions

View File

@ -149,8 +149,6 @@ function nextTest() {
}
function done() {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
mediaTestCleanup();
opener.done();
}

View File

@ -216,7 +216,7 @@ var gInvalidTests = [
// we've specified.
function fileUriToSrc(path, mustExist) {
// android mochitest doesn't support file://
if (navigator.appVersion.indexOf("Android") != -1)
if (navigator.appVersion.indexOf("Android") != -1 || SpecialPowers.Services.appinfo.name == "B2G")
return path;
const Ci = SpecialPowers.Ci;
@ -691,25 +691,25 @@ function mediaTestCleanup() {
var oldGStreamer = undefined;
var oldOpus = undefined;
try { oldGStreamer = branch.getBoolPref("gstreamer.enabled"); } catch(ex) { }
try { oldDefault = branch.getIntPref("preload.default"); } catch(ex) { }
try { oldAuto = branch.getIntPref("preload.auto"); } catch(ex) { }
try { oldOpus = branch.getBoolPref("opus.enabled"); } catch(ex) { }
try { oldGStreamer = SpecialPowers.getBoolPref("media.gstreamer.enabled"); } catch(ex) { }
try { oldDefault = SpecialPowers.getIntPref("media.preload.default"); } catch(ex) { }
try { oldAuto = SpecialPowers.getIntPref("media.preload.auto"); } catch(ex) { }
try { oldOpus = SpecialPowers.getBoolPref("media.opus.enabled"); } catch(ex) { }
branch.setIntPref("preload.default", 2); // preload_metadata
branch.setIntPref("preload.auto", 3); // preload_enough
SpecialPowers.setIntPref("media.preload.default", 2); // preload_metadata
SpecialPowers.setIntPref("media.preload.auto", 3); // preload_enough
// test opus playback iff the pref exists
if (oldOpus !== undefined)
branch.setBoolPref("opus.enabled", true);
SpecialPowers.setBoolPref("media.opus.enabled", true);
if (oldGStreamer !== undefined)
branch.setBoolPref("gstreamer.enabled", true);
SpecialPowers.setBoolPref("media.gstreamer.enabled", true);
window.addEventListener("unload", function() {
if (oldGStreamer !== undefined)
branch.setBoolPref("gstreamer.enabled", oldGStreamer);
branch.setIntPref("preload.default", oldDefault);
branch.setIntPref("preload.auto", oldAuto);
SpecialPowers.setBoolPref("media.gstreamer.enabled", oldGStreamer);
SpecialPowers.setIntPref("media.preload.default", oldDefault);
SpecialPowers.setIntPref("media.preload.auto", oldAuto);
if (oldOpus !== undefined)
branch.setBoolPref("opus.enabled", oldOpus);
SpecialPowers.setBoolPref("media.opus.enabled", oldOpus);
}, false);
})();

View File

@ -9,7 +9,71 @@
"excludetests": {
"content/xbl/":"",
"content/xul":"",
"content/media/":"",
"content/media/test/test_bug448534.html": "",
"content/media/test/test_bug495300.html":"",
"content/media/test/test_bug495300.html":"",
"content/media/test/test_bug463162.xhtml":"",
"content/media/test/test_bug495145.html": "timed out",
"content/media/test/test_bug686942.html": "timed out",
"content/media/test/test_bug686137.html": "TIMED_OUT",
"content/media/test/test_can_play_type.html":"timed out",
"content/media/test/test_chaining.html": "timed out",
"content/media/test/test_contentDuration1.html": "TIMED_OUT",
"content/media/test/test_contentDuration2.html": "TIMED_OUT",
"content/media/test/test_contentDuration3.html": "TIMED_OUT",
"content/media/test/test_contentDuration4.html": "TIMED_OUT",
"content/media/test/test_contentDuration5.html": "TIMED_OUT",
"content/media/test/test_contentDuration6.html": "TIMED_OUT",
"content/media/test/test_contentDuration7.html": "timed out",
"content/media/test/test_decoder_disable.html":"timed out",
"content/media/test/test_error_on_404.html": "timed out",
"content/media/test/test_fragment_noplay.html": "timed out",
"content/media/test/test_fragment_play.html": "",
"content/media/test/test_load.html": "Timed out after gizmo.mp4",
"content/media/test/test_load_candidates.html": "timed out",
"content/media/test/test_load_same_resource.html": "",
"content/media/test/test_media_selection.html": "",
"content/media/test/test_metadata.html": "",
"content/media/test/test_mozHasAudio.html": "",
"content/media/test/test_playback_rate_playpause.html": "",
"content/media/test/test_reactivate.html": "timed out in small-shot.mp3",
"content/media/test/test_referer.html":"",
"content/media/test/test_replay_metadata.html": "",
"content/media/test/test_seekable1.html": "",
"content/media/test/test_seek_out_of_range.html": "",
"content/media/test/test_seekLies.html": "",
"content/media/test/test_wave_data_s16.html": "",
"content/media/test/test_source.html": "",
"content/media/test/test_source_media.html": "",
"content/media/test/test_wave_data_u8.html": "",
"content/media/mediasource/test/test_MediaSource.html": " ReferenceError: MediaSource is not defined",
"content/media/test/test_bug654550.html": "timed out",
"content/media/test/test_delay_load.html": "6 failures",
"content/media/test/test_info_leak.html": "2 failures",
"content/media/test/test_play_events.html": "Last event should be canplaythrough for gizmo.mp4 - got playing, expected canplaythrough",
"content/media/test/test_play_events_2.html": "Last event should be canplaythrough for gizmo.mp4 - got playing, expected canplaythrough",
"content/media/test/test_playback.html": "Test timed out",
"content/media/test/test_play_events.html": "Last event should be canplaythrough for gizmo.mp4 - got playing, expected canplaythrough",
"content/media/test/test_play_events_2.html": "Last event should be canplaythrough for gizmo.mp4 - got playing, expected canplaythrough",
"content/media/test/test_playback.html": "Test timed out",
"content/media/test/test_streams_gc.html": "Value being assigned to HTMLMediaElement.currentTime is not a finite floating-point value",
"content/media/webaudio/test/test_audioBufferSourceNodeNeutered.html": "Test timed out",
"content/media/webaudio/test/test_audioBufferSourceNodeNeutered.html": " Test timed out",
"content/media/webspeech/recognition/test/test_nested_eventloop.html": "NS_ERROR_NOT_AVAILABLE: [nsIDOMWindow.showModalDialog]",
"content/media/webspeech/synth/ipc/test/test_ipc.html": "comp.classes['@mozilla.org/special-powers-observer;1'] is undefined",
"content/media/webspeech/synth/test/test_speech_queue.html": "Test timed out",
"content/media/webspeech/synth/test/test_speech_simple.html": "Test timed out",
"content/media/test/test_framebuffer.html": "timed out",
"content/media/test/test_seekable2.html": "timed out",
"content/media/test/test_seekable3.html": "timed out",
"content/media/webspeech/recognition/test/test_recognition_service_error.html": "timed out",
"content/media/test/test_can_play_type_mpeg.html":"7 failures out of 27",
"content/media/test/test_unseekable.html":"",
"content/media/webaudio/test/test_audioBufferSourceNodeOffset.html":"",
"content/media/test/test_can_play_type_ogg.html":"",
"content/media/test/test_can_play_type_no_dash.html":"",
"dom/imptests/editing/selecttest/test_addRange.html": "oom?, bug 775227",
"dom/imptests/webapps/DOMCore/tests/approved/test_Range-insertNode.html":"oom?, bug 775227",