diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-04 15:31:32 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-11-09 15:33:04 +0100 |
commit | bd54ad1953ee0484ba90cf5f588f4c282048f368 (patch) | |
tree | 36e84ed92589a8775bc18e1b056f6b8de14bf2bb /server/tests/api/videos/video-hls.ts | |
parent | 68e70a745b2010cd0199864a2addd60d8f99c732 (diff) | |
download | PeerTube-bd54ad1953ee0484ba90cf5f588f4c282048f368.tar.gz PeerTube-bd54ad1953ee0484ba90cf5f588f4c282048f368.tar.zst PeerTube-bd54ad1953ee0484ba90cf5f588f4c282048f368.zip |
Add live notification tests
Diffstat (limited to 'server/tests/api/videos/video-hls.ts')
-rw-r--r-- | server/tests/api/videos/video-hls.ts | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/server/tests/api/videos/video-hls.ts b/server/tests/api/videos/video-hls.ts index 6555bc8b6..3a65cc1d2 100644 --- a/server/tests/api/videos/video-hls.ts +++ b/server/tests/api/videos/video-hls.ts | |||
@@ -1,9 +1,11 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import * as chai from 'chai' | ||
4 | import 'mocha' | 3 | import 'mocha' |
4 | import * as chai from 'chai' | ||
5 | import { join } from 'path' | ||
5 | import { | 6 | import { |
6 | checkDirectoryIsEmpty, | 7 | checkDirectoryIsEmpty, |
8 | checkResolutionsInMasterPlaylist, | ||
7 | checkSegmentHash, | 9 | checkSegmentHash, |
8 | checkTmpIsEmpty, | 10 | checkTmpIsEmpty, |
9 | cleanupTests, | 11 | cleanupTests, |
@@ -23,7 +25,6 @@ import { | |||
23 | } from '../../../../shared/extra-utils' | 25 | } from '../../../../shared/extra-utils' |
24 | import { VideoDetails } from '../../../../shared/models/videos' | 26 | import { VideoDetails } from '../../../../shared/models/videos' |
25 | import { VideoStreamingPlaylistType } from '../../../../shared/models/videos/video-streaming-playlist.type' | 27 | import { VideoStreamingPlaylistType } from '../../../../shared/models/videos/video-streaming-playlist.type' |
26 | import { join } from 'path' | ||
27 | import { DEFAULT_AUDIO_RESOLUTION } from '../../../initializers/constants' | 28 | import { DEFAULT_AUDIO_RESOLUTION } from '../../../initializers/constants' |
28 | 29 | ||
29 | const expect = chai.expect | 30 | const expect = chai.expect |
@@ -66,16 +67,12 @@ async function checkHlsPlaylist (servers: ServerInfo[], videoUUID: string, hlsOn | |||
66 | } | 67 | } |
67 | 68 | ||
68 | { | 69 | { |
69 | const res = await getPlaylist(hlsPlaylist.playlistUrl) | 70 | await checkResolutionsInMasterPlaylist(hlsPlaylist.playlistUrl, resolutions) |
70 | 71 | ||
72 | const res = await getPlaylist(hlsPlaylist.playlistUrl) | ||
71 | const masterPlaylist = res.text | 73 | const masterPlaylist = res.text |
72 | 74 | ||
73 | for (const resolution of resolutions) { | 75 | for (const resolution of resolutions) { |
74 | const reg = new RegExp( | ||
75 | '#EXT-X-STREAM-INF:BANDWIDTH=\\d+,RESOLUTION=\\d+x' + resolution + ',FRAME-RATE=\\d+,CODECS="avc1.64001f,mp4a.40.2"' | ||
76 | ) | ||
77 | |||
78 | expect(masterPlaylist).to.match(reg) | ||
79 | expect(masterPlaylist).to.contain(`${resolution}.m3u8`) | 76 | expect(masterPlaylist).to.contain(`${resolution}.m3u8`) |
80 | expect(masterPlaylist).to.contain(`${resolution}.m3u8`) | 77 | expect(masterPlaylist).to.contain(`${resolution}.m3u8`) |
81 | } | 78 | } |