content/media/test/seek7.js

Fri, 16 Jan 2015 04:50:19 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 04:50:19 +0100
branch
TOR_BUG_9701
changeset 13
44a2da4a2ab2
permissions
-rw-r--r--

Replace accessor implementation with direct member state manipulation, by
request https://trac.torproject.org/projects/tor/ticket/9701#comment:32

     1 function test_seek7(v, seekTime, is, ok, finish) {
     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;
    10 function startTest() {
    11   if (completed)
    12     return;
    14   try {
    15     v.currentTime = NaN;
    16   } catch(e) {
    17     thrown1 = true;
    18   }
    20   try {
    21     v.currentTime = Math.random;
    22   } catch(e) {
    23     thrown3 = true;
    24   }
    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 }
    32 v.addEventListener("loadedmetadata", startTest, false);
    34 }

mercurial