Skip to content

Commit 524c337

Browse files
knight9999shazron
authored andcommitted
CB-14091: fix tests code for stream url and remove browser (#166)
* 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)
1 parent 067bad9 commit 524c337

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

.travis.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,35 @@ addons:
55
env:
66
global:
77
- SAUCE_USERNAME=snay
8-
- TRAVIS_NODE_VERSION="4.2"
8+
- TRAVIS_NODE_VERSION="6.14.2"
99
matrix:
1010
include:
1111
- env: PLATFORM=browser-chrome
1212
os: linux
1313
language: node_js
14-
node_js: '4.2'
14+
node_js: '6.14.2'
1515
- env: PLATFORM=browser-firefox
1616
os: linux
1717
language: node_js
18-
node_js: '4.2'
18+
node_js: '6.14.2'
1919
- env: PLATFORM=browser-safari
2020
os: linux
2121
language: node_js
22-
node_js: '4.2'
22+
node_js: '6.14.2'
2323
- env: PLATFORM=browser-edge
2424
os: linux
2525
language: node_js
26-
node_js: '4.2'
26+
node_js: '6.14.2'
2727
- env: PLATFORM=ios-9.3
2828
os: osx
2929
osx_image: xcode7.3
3030
language: node_js
31-
node_js: '4.2'
31+
node_js: '6.14.2'
3232
- env: PLATFORM=ios-10.0
3333
os: osx
3434
osx_image: xcode7.3
3535
language: node_js
36-
node_js: '4.2'
36+
node_js: '6.14.2'
3737
- env: PLATFORM=android-4.4
3838
os: linux
3939
language: android

tests/tests.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
var ACTUAL_PLAYBACK_TEST_TIMEOUT = 2 * 60 * 1000;
2828

2929
var WEB_MP3_FILE = 'https://cordova.apache.org/downloads/BlueZedEx.mp3';
30-
var WEB_MP3_STREAM = 'http://c22033-l.i.core.cdn.streamfarm.net/22033mdr/live/3087mdr_figaro/ch_classic_128.mp3';
30+
var WEB_MP3_STREAM = 'https://cordova.apache.org/downloads/BlueZedEx.mp3';
3131

3232
var isWindows = cordova.platformId === 'windows8' || cordova.platformId === 'windows';
3333
var isBrowser = cordova.platformId === 'browser';
@@ -37,6 +37,8 @@ var isBrowser = cordova.platformId === 'browser';
3737
var isAudioSupported = isWindows ? !!Windows.Media.Devices.MediaDevice.getDefaultAudioRenderId(Windows.Media.Devices.AudioDeviceRole.default) :
3838
cordova.platformId === 'ios' ? !window.SAUCELABS_ENV : true;
3939

40+
var isKitKat = cordova.platformId === 'android' && /Android\s4\.4/.test(window.navigator.userAgent);
41+
4042
exports.defineAutoTests = function () {
4143
var failed = function (done, msg, context) {
4244
if (context && context.done) return;
@@ -233,7 +235,7 @@ exports.defineAutoTests = function () {
233235

234236
it("media.spec.19 position should be set properly", function (done) {
235237
// no audio hardware available
236-
if (!isAudioSupported) {
238+
if (!isAudioSupported || isBrowser || isKitKat) {
237239
pending();
238240
}
239241

@@ -262,7 +264,7 @@ exports.defineAutoTests = function () {
262264
}, ACTUAL_PLAYBACK_TEST_TIMEOUT);
263265

264266
it("media.spec.20 duration should be set properly", function (done) {
265-
if (!isAudioSupported || cordova.platformId === 'blackberry10') {
267+
if (!isAudioSupported || cordova.platformId === 'blackberry10' || isBrowser || isKitKat) {
266268
pending();
267269
}
268270

@@ -291,7 +293,7 @@ exports.defineAutoTests = function () {
291293
}, ACTUAL_PLAYBACK_TEST_TIMEOUT);
292294

293295
it("media.spec.21 should be able to resume playback after pause", function (done) {
294-
if (!isAudioSupported || cordova.platformId === 'blackberry10') {
296+
if (!isAudioSupported || cordova.platformId === 'blackberry10' || isKitKat) {
295297
pending();
296298
}
297299

@@ -335,7 +337,7 @@ exports.defineAutoTests = function () {
335337
}, ACTUAL_PLAYBACK_TEST_TIMEOUT);
336338

337339
it("media.spec.22 should be able to seek through file", function (done) {
338-
if (!isAudioSupported || cordova.platformId === 'blackberry10') {
340+
if (!isAudioSupported || cordova.platformId === 'blackberry10' || isKitKat) {
339341
pending();
340342
}
341343

@@ -421,7 +423,7 @@ exports.defineAutoTests = function () {
421423
it("media.spec.25 should be able to play an audio stream", function (done) {
422424
// no audio hardware available, OR
423425
// O_o Safari can't play the stream, so we're skipping this test on all browsers o_O
424-
if (!isAudioSupported || isBrowser) {
426+
if (!isAudioSupported || isBrowser || isKitKat) {
425427
pending();
426428
}
427429

0 commit comments

Comments
 (0)