comparison mp4.t @ 388:3d4506565f43

Tests: more mp4 tests for exceeding start/end values.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 07 Apr 2014 20:25:40 +0400
parents ff2e9afde90d
children c24d1c0b4c73
comparison
equal deleted inserted replaced
387:ff2e9afde90d 388:3d4506565f43
22 22
23 select STDERR; $| = 1; 23 select STDERR; $| = 1;
24 select STDOUT; $| = 1; 24 select STDOUT; $| = 1;
25 25
26 my $t = Test::Nginx->new()->has(qw/http mp4/)->has_daemon('ffprobe ffmpeg') 26 my $t = Test::Nginx->new()->has(qw/http mp4/)->has_daemon('ffprobe ffmpeg')
27 ->plan(12)->write_file_expand('nginx.conf', <<'EOF'); 27 ->plan(14)->write_file_expand('nginx.conf', <<'EOF');
28 28
29 %%TEST_GLOBALS%% 29 %%TEST_GLOBALS%%
30 30
31 daemon off; 31 daemon off;
32 32
62 is(durations($t, 0.0), '10.0 20.0', 'start zero'); 62 is(durations($t, 0.0), '10.0 20.0', 'start zero');
63 is(durations($t, 2), '8.0 18.0', 'start integer'); 63 is(durations($t, 2), '8.0 18.0', 'start integer');
64 is(durations($t, 7.1), '2.9 12.9', 'start float'); 64 is(durations($t, 7.1), '2.9 12.9', 'start float');
65 65
66 SKIP: { 66 SKIP: {
67 skip 'no end argument support', 7 unless $t->has_version('1.5.13'); 67 skip 'no end argument support', 8 unless $t->has_version('1.5.13');
68 68
69 is(durations($t, 6, 9), '3.0 3.0', 'start end integer'); 69 is(durations($t, 6, 9), '3.0 3.0', 'start end integer');
70 is(durations($t, 2.7, 5.6), '2.9 2.9', 'start end float'); 70 is(durations($t, 2.7, 5.6), '2.9 2.9', 'start end float');
71 71
72 is(durations($t, undef, 9), '9.0 9.0', 'end integer'); 72 is(durations($t, undef, 9), '9.0 9.0', 'end integer');
79 79
80 # start/end values exceeding track/file duration 80 # start/end values exceeding track/file duration
81 81
82 unlike(http_head("/test.mp4?end=11"), qr!HTTP/1.1 500!, 82 unlike(http_head("/test.mp4?end=11"), qr!HTTP/1.1 500!,
83 'end beyond short track'); 83 'end beyond short track');
84 unlike(http_head("/test.mp4?end=21"), qr!HTTP/1.1 500!, 'end beyond EOF');
85
86 }
87
88 TODO: {
89 local $TODO = 'not yet' unless $t->has_version('1.5.10');
90
91 unlike(http_head("/test.mp4?start=11"), qr!HTTP/1.1 500!,
92 'start beyond short track');
84 93
85 } 94 }
86 95
87 like(http_head("/test.mp4?start=21"), qr!HTTP/1.1 500!, 'start beyond EOF'); 96 like(http_head("/test.mp4?start=21"), qr!HTTP/1.1 500!, 'start beyond EOF');
88 97