Mercurial > hg > nginx-tests
comparison mp4.t @ 1612:8659123d2d37
Tests: made http_content() exportable.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 17 Nov 2020 17:39:09 +0300 |
parents | 3ff92feb99d1 |
children | 5ac6efbe5552 |
comparison
equal
deleted
inserted
replaced
1611:dbeb4c896f7e | 1612:8659123d2d37 |
---|---|
14 use Test::More; | 14 use Test::More; |
15 | 15 |
16 BEGIN { use FindBin; chdir($FindBin::Bin); } | 16 BEGIN { use FindBin; chdir($FindBin::Bin); } |
17 | 17 |
18 use lib 'lib'; | 18 use lib 'lib'; |
19 use Test::Nginx; | 19 use Test::Nginx qw/ :DEFAULT http_content /; |
20 | 20 |
21 ############################################################################### | 21 ############################################################################### |
22 | 22 |
23 select STDERR; $| = 1; | 23 select STDERR; $| = 1; |
24 select STDOUT; $| = 1; | 24 select STDOUT; $| = 1; |
142 | 142 |
143 } elsif (defined $end) { | 143 } elsif (defined $end) { |
144 $uri .= "?end=$end"; | 144 $uri .= "?end=$end"; |
145 } | 145 } |
146 | 146 |
147 $t->write_file('frag.mp4', Test::Nginx::http_content(http_get($uri))); | 147 $t->write_file('frag.mp4', http_content(http_get($uri))); |
148 | 148 |
149 my $r = `ffprobe -show_streams $path 2>/dev/null`; | 149 my $r = `ffprobe -show_streams $path 2>/dev/null`; |
150 Test::Nginx::log_core('||', $r); | 150 Test::Nginx::log_core('||', $r); |
151 sprintf "%.1f %.1f", $r =~ /duration=(\d+\.\d+)/g; | 151 sprintf "%.1f %.1f", $r =~ /duration=(\d+\.\d+)/g; |
152 } | 152 } |