Skip to content

Commit

Permalink
CB-14091: fix tests code for stream url and remove browser (#166)
Browse files Browse the repository at this point in the history
* fix tests code for fix stream url and remove browser
* Update .travis.yml - upgraded node.js to use 6.14.2 (Node 4 is deprecated)
* remove streaming test for Android 4.4 (KitKat does not support modern SSL)
  • Loading branch information
knight9999 authored and shazron committed Jun 22, 2018
1 parent 067bad9 commit 524c337
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 8 additions & 6 deletions tests/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;
Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -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();
}

Expand Down

0 comments on commit 524c337

Please sign in to comment.