Skip to content

Commit

Permalink
Put browser config in env and test on more browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
tjenkinson committed Oct 14, 2016
1 parent 3987a5c commit 660b989
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 15 deletions.
20 changes: 15 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,21 @@ env:
global:
- SAUCE_USERNAME=mangui
matrix:
- TEST_STREAM_ID=arte
- TEST_STREAM_ID=bigBuckBunnyABR
- TEST_STREAM_ID=bigBuckBunny480p
- TEST_STREAM_ID=issue666
- TEST_STREAM_ID=nasa
- TEST_BROWSER_NAME=chrome TEST_BROWSER_PLATFORM="Windows 10" TEST_STREAM_ID=arte
- TEST_BROWSER_NAME=edge TEST_BROWSER_PLATFORM="Windows 10" TEST_STREAM_ID=arte
- TEST_BROWSER_NAME=firefox TEST_BROWSER_PLATFORM="Windows 10" TEST_STREAM_ID=arte
- TEST_BROWSER_NAME=chrome TEST_BROWSER_PLATFORM="Windows 10" TEST_STREAM_ID=bigBuckBunnyABR
- TEST_BROWSER_NAME=edge TEST_BROWSER_PLATFORM="Windows 10" TEST_STREAM_ID=bigBuckBunnyABR
- TEST_BROWSER_NAME=firefox TEST_BROWSER_PLATFORM="Windows 10" TEST_STREAM_ID=bigBuckBunnyABR
- TEST_BROWSER_NAME=chrome TEST_BROWSER_PLATFORM="Windows 10" TEST_STREAM_ID=bigBuckBunny480p
- TEST_BROWSER_NAME=edge TEST_BROWSER_PLATFORM="Windows 10" TEST_STREAM_ID=bigBuckBunny480p
- TEST_BROWSER_NAME=firefox TEST_BROWSER_PLATFORM="Windows 10" TEST_STREAM_ID=bigBuckBunny480p
- TEST_BROWSER_NAME=chrome TEST_BROWSER_PLATFORM="Windows 10" TEST_STREAM_ID=issue666
- TEST_BROWSER_NAME=edge TEST_BROWSER_PLATFORM="Windows 10" TEST_STREAM_ID=issue666
- TEST_BROWSER_NAME=firefox TEST_BROWSER_PLATFORM="Windows 10" TEST_STREAM_ID=issue666
- TEST_BROWSER_NAME=chrome TEST_BROWSER_PLATFORM="Windows 10" TEST_STREAM_ID=nasa
- TEST_BROWSER_NAME=edge TEST_BROWSER_PLATFORM="Windows 10" TEST_STREAM_ID=nasa
- TEST_BROWSER_NAME=firefox TEST_BROWSER_PLATFORM="Windows 10" TEST_STREAM_ID=nasa
addons:
sauce_connect: true
jwt:
Expand Down
31 changes: 21 additions & 10 deletions tests/functional/auto/hlsjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,25 @@ var stream = streams[STREAM_ID];
if (!stream) {
throw new Error('Could not find stream "'+stream_ID+'"');
}
var BROWSER_CONFIG = onTravis ? {name : 'chrome', version : 'latest', platform : 'Windows 10'} : { name : 'chrome' };

var browserDescription = BROWSER_CONFIG.name;
if (BROWSER_CONFIG.version) {
browserDescription += ' ('+BROWSER_CONFIG.version+')';
var browserConfig = {version : 'latest'};
if (onTravis) {
var TEST_BROWSER_NAME = process.env.TEST_BROWSER_NAME;
if (!TEST_BROWSER_NAME) {
throw new Error('No test browser name.')
}
var TEST_BROWSER_PLATFORM = process.env.TEST_BROWSER_PLATFORM;
if (!TEST_BROWSER_PLATFORM) {
throw new Error('No test browser platform.')
}
browserConfig.name = TEST_BROWSER_NAME;
browserConfig.platform = TEST_BROWSER_PLATFORM;
}
var browserDescription = browserConfig.name;
if (browserConfig.version) {
browserDescription += ' ('+browserConfig.version+')';
}
if (BROWSER_CONFIG.platform) {
browserDescription += ', '+BROWSER_CONFIG.platform;
if (browserConfig.platform) {
browserDescription += ', '+browserConfig.platform;
}

HttpServer.createServer({
Expand All @@ -33,9 +44,9 @@ HttpServer.createServer({
describe('testing hls.js playback in the browser with "'+stream.description+'" on "'+browserDescription+'"', function() {
beforeEach(function() {
var capabilities = {
browserName : BROWSER_CONFIG.name,
platform : BROWSER_CONFIG.platform,
version: BROWSER_CONFIG.version
browserName : browserConfig.name,
platform : browserConfig.platform,
version: browserConfig.version
};
if (onTravis) {
capabilities['tunnel-identifier'] = process.env.TRAVIS_JOB_NUMBER;
Expand Down

0 comments on commit 660b989

Please sign in to comment.