content/media/test/seek12.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     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