content/media/test/seek10.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.

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

mercurial