content/media/test/seek10.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 function test_seek10(v, seekTime, is, ok, finish) {
     3 // Test bug 523335 - ensure that if we close a stream while seeking, we
     4 // don't hang during shutdown. This test won't "fail" per se if it's regressed,
     5 // it will instead start to cause random hangs in the mochitest harness on
     6 // shutdown.
     8 function startTest() {
     9   // Must be duration*0.9 rather than seekTime, else we don't hit that problem.
    10   // This is probably due to the seek bisection finishing too quickly, before
    11   // we can close the stream.
    12   v.currentTime = v.duration * 0.9;
    13 }
    15 function done(evt) {
    16   ok(true, "We don't acutally test anything...");
    17   finish();
    18 }
    20 function seeking() {
    21   ok(v.currentTime >= seekTime - 0.1, "Video currentTime should be around " + seekTime + ": " + v.currentTime);
    22   v.onerror = done;
    23   v.src = "not a valid video file.";
    24   v.load(); // Cause the existing stream to close.
    25 }
    27 v.addEventListener("loadeddata", startTest, false);
    28 v.addEventListener("seeking", seeking, false);
    30 }

mercurial