content/media/test/seek7.js

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     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