Skip to content

Commit

Permalink
Merge pull request #3138 from Orange-OpenSource/update-sample-sources
Browse files Browse the repository at this point in the history
Update functional tests
  • Loading branch information
bbert authored Mar 19, 2020
2 parents 6166ab3 + e10fcce commit 44fe4df
Show file tree
Hide file tree
Showing 13 changed files with 171 additions and 36 deletions.
28 changes: 5 additions & 23 deletions samples/dash-if-reference-player/app/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"name": "SegmentTimeline/Time"
},
{
"url": "https://dash.akamaized.net/dash264/TestCases/5a/1/manifest.mpd",
"url": "http://dash.akamaized.net/dash264/TestCases/5a/1/manifest.mpd",
"name": "Multiperiod"
},
{
Expand Down Expand Up @@ -93,15 +93,6 @@
"liveDelay": 3
}
},
{
"url": "http://24x7dash-i.akamaihd.net/dash/live/900080/dash-demo/dash.mpd",
"name": "Akamai 24x7 reference stream - segmentTemplate"
},
{
"url": "https://akamai-axtest.akamaized.net/routes/lapd-v1-acceptance/www_c4/Manifest.mpd",
"name": "Axinom reference stream (Live-Clear)",
"moreInfo": "https://github.com/Axinom/dash-test-vectors#live-clear"
},
{
"url": "https://live.unified-streaming.com/scte35/scte35.isml/.mpd",
"name": "Unified Streaming reference stream with scte35 markers",
Expand Down Expand Up @@ -941,25 +932,16 @@
{
"name": "Smooth Streaming",
"submenu": [
{
"url": "http://2is7server2.rd.francetelecom.com/hasplayer/VOD_1/VOD_1.ism/manifest",
"name": "Prince Of Persia"
},
{
"url": "http://2is7server2.rd.francetelecom.com/hasplayer/LIVE_1.isml/manifest",
"name": "Prince Of Persia - Live"
},
{
"url": "http://2is7server1.rd.francetelecom.com/VOD/BBB-SD/big_buck_bunny_1080p_stereo.ism/Manifest",
"name": "Big Buck Bunny"
},
{
"url": "http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest",
"name": "Super Speedway"
},
{
"url": "http://playready.directtaps.net/smoothstreaming/SSWSS720H264PR/SuperSpeedway_720.ism/Manifest",
"name": "Super Speedway + PlayReady DRM"
"name": "Super Speedway + PlayReady DRM",
"protData": {
"com.microsoft.playready": {
}}
},
{
"url": "http://test.playready.microsoft.com/smoothstreaming/SSWSS720H264PR/SuperSpeedway_720.ism/Manifest",
Expand Down
18 changes: 15 additions & 3 deletions test/functional/config/browsers/windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ define(function () {
platform: 'WINDOWS',
os: 'WINDOWS',
os_version: '10',
keySystems: ['com.widevine.alpha', 'org.w3.clearkey'],
keySystems: {
'com.widevine.alpha': true,
'com.microsoft.playready': false,
'org.w3.clearkey': true
},
'goog:chromeOptions': { w3c: false }
};

Expand All @@ -14,13 +18,21 @@ define(function () {
platform: 'WINDOWS',
os: 'WINDOWS',
os_version: '10',
keySystems: ['com.widevine.alpha', 'org.w3.clearkey']
keySystems: {
'com.widevine.alpha': true,
'com.microsoft.playready': false,
'org.w3.clearkey': true
}
};

var EDGE_CONFIG = {
browserName: 'MicrosoftEdge',
platform: 'WINDOWS',
keySystems: ['com.microsoft.playready', 'org.w3.clearkey']
keySystems: {
'com.widevine.alpha': false,
'com.microsoft.playready': true,
'org.w3.clearkey': true
}
};

return {
Expand Down
2 changes: 1 addition & 1 deletion test/functional/selenium/Win10nodeConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"hubPort": 4444,
"hubHost": "127.0.0.1",
"Dwebdriver.chrome.driver=chromedriver.exe": "",
"Dwebdriver.edge.driver=MicrosoftWebDriver.exe": "",
"Dwebdriver.edge.driver=msedgedriver.exe": "",
"Dwebdriver.gecko.driver=geckodriver.exe": ""

}
Binary file modified test/functional/selenium/chromedriver.exe
Binary file not shown.
Binary file modified test/functional/selenium/geckodriver.exe
Binary file not shown.
Binary file added test/functional/selenium/msedgedriver.exe
Binary file not shown.
7 changes: 5 additions & 2 deletions test/functional/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,26 @@ define([
'test/functional/config/streams',
'test/functional/tests/setup',
'test/functional/tests/play',
'test/functional/tests/playFromTime',
'test/functional/tests/pause',
'test/functional/tests/seek',
'test/functional/tests/ended',
'test/functional/tests/ended'
], function(intern,
streams,
setup,
play,
playFromTime,
pause,
seek,
ended) {

var registerSuites = function (stream) {
var suites = intern.config.testSuites || ['play', 'pause', 'seek', 'ended'];
var suites = intern.config.testSuites || ['play', /*'playFromTime',*/ 'pause', /*'seek',*/ 'ended'];

setup.register(stream);

if (suites.indexOf('play') !== -1) play.register(stream);
if (suites.indexOf('playFromTime') !== -1) playFromTime.register(stream);
if (suites.indexOf('pause') !== -1) pause.register(stream);
if (suites.indexOf('seek') !== -1) seek.register(stream);
if (suites.indexOf('ended') !== -1) ended.register(stream);
Expand Down
4 changes: 2 additions & 2 deletions test/functional/tests/ended.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ define([

// Test constants
var PLAYING_TIMEOUT = 10; // Timeout (in sec.) for checking playing status
var PROGRESS_VALUE = 5; // Playback progress value (in sec.) to be checked
var SEEK_SHIFT = 5; // Timeout (in sec.) for checking playback progress
var SEEK_SHIFT = 10; // Timeout (in sec.) for checking playback progress
var SEEK_TIMEOUT = 10; // Timeout (in sec.) for checking playback progress
var ENDED_TIMEOUT = SEEK_SHIFT + 10; // Timeout (in sec.) for checking seek to be completed

Expand Down Expand Up @@ -56,6 +55,7 @@ define([
if (!stream.available) this.skip();
if (stream.dynamic) this.skip();
// Seek the player before end
utils.log(NAME, 'Seek before end: ' + (stream.duration - SEEK_SHIFT));
return command.executeAsync(player.seek, [(stream.duration - SEEK_SHIFT), SEEK_TIMEOUT])
.then(function(seeked) {
assert.isTrue(seeked);
Expand Down
8 changes: 5 additions & 3 deletions test/functional/tests/pause.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ define([

load: function() {
if (!stream.available) this.skip();
// Ignore streams that are insufficiently long
if (stream.duration < 60) this.skip();
utils.log(NAME, 'Load stream');
command = this.remote.get(require.toUrl(intern.config.testPage));
return command.execute(player.loadStream, [stream])
Expand All @@ -56,16 +58,16 @@ define([
name: NAME,

pause: function() {
if (!stream.available) this.skip();
if (!stream.available || stream.duration < 60) this.skip();
var pauseTime = 0;
// Execute a play in case previous pause test has failed
utils.log(NAME, 'Play');
return command.execute(player.play)
.then(function () {
var sleepTime = PAUSE_DELAY + Math.round(Math.random() * 10);
var sleepTime = Math.round(Math.random() * 10);
utils.log(NAME, 'Wait ' + sleepTime + ' sec. and pause playback');
// Wait and pause the player
return command.sleep(sleepTime * 1000).execute(player.pause)
return command.sleep(sleepTime * 1000).execute(player.pause)
})
.then(function() {
// Pause the player
Expand Down
20 changes: 20 additions & 0 deletions test/functional/tests/play.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ define([
.then(function (dynamic) {
utils.log(NAME, 'dynamic: ' + dynamic);
stream.dynamic = dynamic;
return command.execute(player.getDVRWindowSize)
})
.then(function (dvrWindow) {
if (dvrWindow > 0) {
stream.dvrWindow = dvrWindow;
}
});
},

Expand All @@ -86,6 +92,20 @@ define([
utils.log(NAME, 'duration: ' + duration);
stream.duration = duration;
});
},

getPeriods: function() {
if (!stream.available) {
this.skip();
}
return command.execute(player.getStreams)
.then(function (streams) {
utils.log(NAME, 'Nb periods: ' + streams.length);
stream.periods = [];
for(let i=0; i < streams.length; i++ ){
stream.periods.push({start: streams[i].start});
}
});
}
});
};
Expand Down
109 changes: 109 additions & 0 deletions test/functional/tests/playFromTime.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/**
PLAY:
- for each stream:
- load test page
- load stream from specific time
- for VOD stream, check to seek at a specific time that can be in a different period
- check playing state, and time
- check if playback progressing
**/
define([
'intern',
'intern!object',
'intern/chai!assert',
'require',
'test/functional/tests/scripts/player',
'test/functional/tests/scripts/utils'
], function(intern, registerSuite, assert, require, player, utils) {

// Suite name
var NAME = 'PLAYFROMTIME';

var command = null;

// Test constants
var PLAYING_TIMEOUT = 10; // Timeout (in sec.) for checking playing status
var PROGRESS_VALUE = 5; // Playback progress value (in sec.) to be checked
var PROGRESS_TIMEOUT = 10; // Timeout (in sec.) for checking playback progress
var SEEK_TIMEOUT = 10; // Timeout (in sec.) for checking seek to be completed
var OFFSET_TO_START = 15; // time offset (in sec.) from the beginning of the period

var loadAtRValue = function(stream) {
registerSuite({
name: NAME,

load: function() {
if (!stream.available) this.skip();
utils.log(NAME, 'Load stream');
command = this.remote.get(require.toUrl(intern.config.testPage));
if (!stream.dynamic) {
let timeToStart = stream.periods[stream.periods.length - 1].start + OFFSET_TO_START;
stream.url += '#t=' + timeToStart;
} else {
if (stream.dvrWindow > 0) {
let relativePosition = stream.dvrWindow / 2;
stream.url += '#r=' + relativePosition;
}
}
// load the player in the last period
return command.execute(player.loadStream, [stream]);
}
})
};

var play = function(stream) {
registerSuite({
name: NAME,

play: function() {
if (!stream.available) this.skip();
utils.log(NAME, 'Play');
return command.executeAsync(player.isPlaying, [PLAYING_TIMEOUT])
.then(function (playing) {
stream.available = playing;
assert.isTrue(playing);
return command.execute(player.getTime);
})
.then(function(time) {
utils.log(NAME, 'Playback time: ' + time);
assert.isAtLeast(time, stream.periods[stream.periods.length - 1].start + OFFSET_TO_START);
});
},

seek: function () {
if (!stream.available || stream.dynamic) this.skip();
// Seek the player in the first period
return command.executeAsync(player.seek, [stream.periods[0].start + OFFSET_TO_START, SEEK_TIMEOUT])
.then(function(seeked) {
assert.isTrue(seeked);
// Check if correctly seeked
return command.execute(player.getTime);
})
.then(function(time) {
utils.log(NAME, 'Playback time: ' + time);
if(stream.periods.length > 1) {
assert.isBelow(time, stream.periods[stream.periods.length - 1].start);
}
return assert.isAtLeast(time, stream.periods[0].start + OFFSET_TO_START);
});
},

progress: function() {
if (!stream.available) this.skip();
utils.log(NAME, 'Progress');
return command.executeAsync(player.isProgressing, [PROGRESS_VALUE, PROGRESS_TIMEOUT])
.then(function (progressing) {
stream.available = progressing;
return assert.isTrue(progressing);
});
}
});
};

return {
register: function (stream) {
loadAtRValue(stream);
play(stream);
}
}
});
7 changes: 7 additions & 0 deletions test/functional/tests/scripts/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ define([], function () {
player.stop();
},

getStreams: function () {
return player.getStreamsFromManifest();
},

getDVRWindowSize: function () {
return player.getDVRWindowSize();
},

isPlaying: function(timeout, done) {
var _timeout = null,
Expand Down
4 changes: 2 additions & 2 deletions test/functional/tests/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ define([
if (stream.protData) {
stream.available = false;
Object.keys(stream.protData).forEach(keySystem => {
stream.available |= browsersConf.keySystems.includes(keySystem);
stream.available |= browsersConf.keySystems[keySystem] === true;
});
if (!stream.available) {
this.skip();
Expand All @@ -42,7 +42,7 @@ define([
});
}
});
};
};

return {
register: function (stream) {
Expand Down

0 comments on commit 44fe4df

Please sign in to comment.