Bug 986381 - Modify test case can_play_webm_type.js r=cpearce
authorBlake Wu <bwu@mozilla.com>
Wed, 07 May 2014 18:02:20 +0800
changeset 182093 86616594f0c9
parent 182092 a2a9fef81547
child 182094 135afc151b75
push id43210
push usercbook@mozilla.com
push dateThu, 08 May 2014 08:52:53 +0000
treeherdermozilla-inbound@135afc151b75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs986381
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 986381 - Modify test case can_play_webm_type.js r=cpearce
content/media/test/can_play_type_webm.js
--- a/content/media/test/can_play_type_webm.js
+++ b/content/media/test/can_play_type_webm.js
@@ -2,19 +2,34 @@ function check_webm(v, enabled) {
   function check(type, expected) {
     is(v.canPlayType(type), enabled ? expected : "", type);
   }
 
   // WebM types
   check("video/webm", "maybe");
   check("audio/webm", "maybe");
 
-  // Supported Webm codecs
-  var video = ['vp8', 'vp8.0', 'vp9', 'vp9.0'];
-  var audio = ['vorbis', 'opus'];
+  // Since we want to use OMX webm HW acceleration to speed up vp8 decoding,
+  // we enabled it after Android version 16(JB) as MOZ_OMX_WEBM_DECODER
+  // defined in moz.build. More information is on Bug 986381.
+  // Currently OMX (KK included) webm decoders can only support vp8 and vorbis,
+  // so only vp8 and vorbis will be tested when OMX webm decoder is enabled.
+  var androidVer = SpecialPowers.Cc['@mozilla.org/system-info;1']
+                                  .getService(SpecialPowers.Ci.nsIPropertyBag2)
+                                  .getProperty('version');
+  info("android version:"+androidVer);
+  //Check for FxOS case
+  if (navigator.userAgent.indexOf("Mobile") != -1 &&
+      navigator.userAgent.indexOf("Android") == -1 && androidVer > 15) {
+    var video = ['vp8', 'vp8.0'];
+    var audio = ['vorbis'];
+  } else {
+    var video = ['vp8', 'vp8.0', 'vp9', 'vp9.0'];
+    var audio = ['vorbis', 'opus'];
+  }
   audio.forEach(function(acodec) {
     check("audio/webm; codecs=" + acodec, "probably");
     check("video/webm; codecs=" + acodec, "probably");
   });
   video.forEach(function(vcodec) {
     check("video/webm; codecs=" + vcodec, "probably");
     audio.forEach(function(acodec) {
         check("video/webm; codecs=\"" + vcodec + ", " + acodec + "\"", "probably");