content/media/test/seek7.js

branch
TOR_BUG_9701
changeset 11
deefc01c0e14
equal deleted inserted replaced
-1:000000000000 0:6b381d628c3e
1 function test_seek7(v, seekTime, is, ok, finish) {
2
3 // If a NaN is passed to currentTime, make sure this is caught
4 // otherwise an infinite loop in the Ogg backend occurs.
5 var completed = false;
6 var thrown1 = false;
7 var thrown2 = false;
8 var thrown3 = false;
9
10 function startTest() {
11 if (completed)
12 return;
13
14 try {
15 v.currentTime = NaN;
16 } catch(e) {
17 thrown1 = true;
18 }
19
20 try {
21 v.currentTime = Math.random;
22 } catch(e) {
23 thrown3 = true;
24 }
25
26 completed = true;
27 ok(thrown1, "Setting currentTime to invalid value of NaN");
28 ok(thrown3, "Setting currentTime to invalid value of a function");
29 finish();
30 }
31
32 v.addEventListener("loadedmetadata", startTest, false);
33
34 }

mercurial