You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2016/06/21 10:05:06 UTC

cordova-plugin-media git commit: CB-11430 Skip audio playback tests on Saucelabs

Repository: cordova-plugin-media
Updated Branches:
  refs/heads/master f206e96d5 -> 804aa6a2d


CB-11430 Skip audio playback tests on Saucelabs

This is a cherry-pick of particular commits from #102
aiming to resolve ios tests failures on Saucelabs


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/commit/804aa6a2
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/tree/804aa6a2
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/diff/804aa6a2

Branch: refs/heads/master
Commit: 804aa6a2deb7a34c649230834b04b2b4b232b401
Parents: f206e96
Author: Vladimir Kotikov <ko...@gmail.com>
Authored: Tue Jun 21 11:42:03 2016 +0300
Committer: Vladimir Kotikov <ko...@gmail.com>
Committed: Tue Jun 21 13:03:37 2016 +0300

----------------------------------------------------------------------
 tests/tests.js | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/804aa6a2/tests/tests.js
----------------------------------------------------------------------
diff --git a/tests/tests.js b/tests/tests.js
index bcc29a4..cab2aa4 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -27,8 +27,11 @@
 var ACTUAL_PLAYBACK_TEST_TIMEOUT = 2 * 60 * 1000;
 
 var isWindows = cordova.platformId == 'windows8' || cordova.platformId == 'windows';
-// detect whether audio hardware is available and enabled
-var isAudioSupported = isWindows ? Windows.Media.Devices.MediaDevice.getDefaultAudioRenderId(Windows.Media.Devices.AudioDeviceRole.default) : true;
+// Detect whether audio hardware is available and enabled. For iOS playing audio is
+// not supported on emulators w/out sound device connected to host PC but (which is
+// the case for Sauce Labs emulators - see CB-11430)
+var isAudioSupported = isWindows ? !!Windows.Media.Devices.MediaDevice.getDefaultAudioRenderId(Windows.Media.Devices.AudioDeviceRole.default) :
+    cordova.platformId === 'ios' ? !window.SAUCELABS_ENV : true;
 
 exports.defineAutoTests = function () {
     var failed = function (done, msg, context) {
@@ -371,8 +374,13 @@ exports.defineAutoTests = function () {
             if (cordova.platformId !== 'ios') {
                 expect(true).toFailWithMessage('Platform does not supported this feature');
                 pending();
-                return;
             }
+
+            // no audio hardware available
+            if (!isAudioSupported) {
+                pending();
+            }
+
             var mediaFile = 'https://cordova.apache.org/downloads/BlueZedEx.mp3',
                 successCallback,
                 context = this,


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org