Bug 1232335 - [1.3] Fix test_can_play_type_mpeg for Android. r=snorp

This commit is contained in:
Eugen Sawin 2016-01-05 01:10:51 +01:00
parent e2d8681359
commit 0477860247
2 changed files with 12 additions and 4 deletions

View File

@ -507,7 +507,8 @@ var gUnseekableTests = [
];
var androidVersion = -1; // non-Android platforms
if (manifestNavigator().userAgent.indexOf("Mobile") != -1) {
if (manifestNavigator().userAgent.indexOf("Mobile") != -1 ||
manifestNavigator().userAgent.indexOf("Tablet") != -1) {
// See nsSystemInfo.cpp, the getProperty('version') returns different value
// on each platforms, so we need to distinguish the android and B2G platform.
var versionString = manifestNavigator().userAgent.indexOf("Android") != -1 ?

View File

@ -124,13 +124,18 @@ function getPref(name) {
return pref;
}
function IsSupportedAndroid() {
return getAndroidVersion() >= 14;
}
function IsJellyBeanOrLater() {
return androidVersion >= 16;
return getAndroidVersion() >= 16;
}
var haveMp4 = (getPref("media.wmf.enabled") && IsWindowsVistaOrLater()) ||
IsMacOSSnowLeopardOrLater() ||
IsJellyBeanOrLater() ||
(IsAndroid() &&
(IsJellyBeanOrLater() || getPref("media.plugins.enabled"))) ||
getPref("media.omx.enabled") ||
(IsLinux() && getPref("media.ffmpeg.enabled"));
@ -138,8 +143,10 @@ check_mp4(document.getElementById('v'), haveMp4);
var haveMp3 = getPref("media.directshow.enabled") ||
(getPref("media.wmf.enabled") && IsWindowsVistaOrLater()) ||
(IsJellyBeanOrLater() && getPref("media.android-media-codec.enabled")) ||
(IsLinux() && getPref("media.ffmpeg.enabled")) ||
(IsSupportedAndroid() &&
((IsJellyBeanOrLater() && getPref("media.android-media-codec.enabled")) ||
getPref("media.plugins.enabled"))) ||
getPref("media.apple.mp3.enabled");
check_mp3(document.getElementById('v'), haveMp3);