content/media/test/seek12.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_seek12(v, seekTime, is, ok, finish) {
     2 var completed = false;
     4 function startTest() {
     5   if (completed)
     6     return;
     7   ok(!v.seeking, "seeking should default to false");
     8   v.currentTime = seekTime;
     9   is(v.currentTime, seekTime, "currentTime must report seek target immediately");
    10   is(v.seeking, true, "seeking flag on start should be true");
    11 }
    13 function seekStarted() {
    14   if (completed)
    15     return;
    16   //is(v.currentTime, seekTime, "seeking: currentTime must be seekTime");
    17   ok(Math.abs(v.currentTime - seekTime) < 0.01, "seeking: currentTime must be seekTime");
    18 }
    20 function seekEnded() {
    21   if (completed)
    22     return;
    23   completed = true;
    24   //is(v.currentTime, seekTime, "seeked: currentTime must be seekTime");
    25   ok(Math.abs(v.currentTime - seekTime) < 0.01, "seeked: currentTime must be seekTime");
    26   is(v.seeking, false, "seeking flag on end should be false");
    27   finish();
    28 }
    30 v.addEventListener("loadedmetadata", startTest, false);
    31 v.addEventListener("seeking", seekStarted, false);
    32 v.addEventListener("seeked", seekEnded, false);
    33 }

mercurial