Bug 986381 - Modify test case can_play_webm_type.js. r=cpearce, a=1.4+
authorBlake Wu <bwu@mozilla.com>
Wed, 07 May 2014 18:02:20 +0800
changeset 187416 e96076a30b09
parent 187415 3ecdbb73c057
child 187417 182a670892a5
push id71
push userryanvm@gmail.com
push dateThu, 08 May 2014 20:43:47 +0000
treeherdermozilla-b2g30_v1_4@e96076a30b09 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce, 1
bugs986381
milestone30.0
Bug 986381 - Modify test case can_play_webm_type.js. r=cpearce, a=1.4+
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");