shazron closed pull request #166: CB-14091: fix tests code for stream url and remove browser URL: https://github.com/apache/cordova-plugin-media/pull/166
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/.travis.yml b/.travis.yml index 9e7438f0..f39fe518 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,35 +5,35 @@ addons: env: global: - SAUCE_USERNAME=snay - - TRAVIS_NODE_VERSION="4.2" + - TRAVIS_NODE_VERSION="6.14.2" matrix: include: - env: PLATFORM=browser-chrome os: linux language: node_js - node_js: '4.2' + node_js: '6.14.2' - env: PLATFORM=browser-firefox os: linux language: node_js - node_js: '4.2' + node_js: '6.14.2' - env: PLATFORM=browser-safari os: linux language: node_js - node_js: '4.2' + node_js: '6.14.2' - env: PLATFORM=browser-edge os: linux language: node_js - node_js: '4.2' + node_js: '6.14.2' - env: PLATFORM=ios-9.3 os: osx osx_image: xcode7.3 language: node_js - node_js: '4.2' + node_js: '6.14.2' - env: PLATFORM=ios-10.0 os: osx osx_image: xcode7.3 language: node_js - node_js: '4.2' + node_js: '6.14.2' - env: PLATFORM=android-4.4 os: linux language: android diff --git a/tests/tests.js b/tests/tests.js index 218f2a95..953b9547 100644 --- a/tests/tests.js +++ b/tests/tests.js @@ -27,7 +27,7 @@ var ACTUAL_PLAYBACK_TEST_TIMEOUT = 2 * 60 * 1000; var WEB_MP3_FILE = 'https://cordova.apache.org/downloads/BlueZedEx.mp3'; -var WEB_MP3_STREAM = 'http://c22033-l.i.core.cdn.streamfarm.net/22033mdr/live/3087mdr_figaro/ch_classic_128.mp3'; +var WEB_MP3_STREAM = 'https://cordova.apache.org/downloads/BlueZedEx.mp3'; var isWindows = cordova.platformId === 'windows8' || cordova.platformId === 'windows'; var isBrowser = cordova.platformId === 'browser'; @@ -37,6 +37,8 @@ var isBrowser = cordova.platformId === 'browser'; var isAudioSupported = isWindows ? !!Windows.Media.Devices.MediaDevice.getDefaultAudioRenderId(Windows.Media.Devices.AudioDeviceRole.default) : cordova.platformId === 'ios' ? !window.SAUCELABS_ENV : true; +var isKitKat = cordova.platformId === 'android' && /Android\s4\.4/.test(window.navigator.userAgent); + exports.defineAutoTests = function () { var failed = function (done, msg, context) { if (context && context.done) return; @@ -233,7 +235,7 @@ exports.defineAutoTests = function () { it("media.spec.19 position should be set properly", function (done) { // no audio hardware available - if (!isAudioSupported) { + if (!isAudioSupported || isBrowser || isKitKat) { pending(); } @@ -262,7 +264,7 @@ exports.defineAutoTests = function () { }, ACTUAL_PLAYBACK_TEST_TIMEOUT); it("media.spec.20 duration should be set properly", function (done) { - if (!isAudioSupported || cordova.platformId === 'blackberry10') { + if (!isAudioSupported || cordova.platformId === 'blackberry10' || isBrowser || isKitKat) { pending(); } @@ -291,7 +293,7 @@ exports.defineAutoTests = function () { }, ACTUAL_PLAYBACK_TEST_TIMEOUT); it("media.spec.21 should be able to resume playback after pause", function (done) { - if (!isAudioSupported || cordova.platformId === 'blackberry10') { + if (!isAudioSupported || cordova.platformId === 'blackberry10' || isKitKat) { pending(); } @@ -335,7 +337,7 @@ exports.defineAutoTests = function () { }, ACTUAL_PLAYBACK_TEST_TIMEOUT); it("media.spec.22 should be able to seek through file", function (done) { - if (!isAudioSupported || cordova.platformId === 'blackberry10') { + if (!isAudioSupported || cordova.platformId === 'blackberry10' || isKitKat) { pending(); } @@ -421,7 +423,7 @@ exports.defineAutoTests = function () { it("media.spec.25 should be able to play an audio stream", function (done) { // no audio hardware available, OR // O_o Safari can't play the stream, so we're skipping this test on all browsers o_O - if (!isAudioSupported || isBrowser) { + if (!isAudioSupported || isBrowser || isKitKat) { pending(); } ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org