Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
1 function test_seek3(v, seekTime, is, ok, finish) {
3 // Test seeking works if current time is set but video is not played.
4 var startPassed = false;
5 var completed = false;
6 var gotTimeupdate = false;
8 function startTest() {
9 if (completed)
10 return;
12 v.currentTime=seekTime;
13 }
15 function timeupdate() {
16 gotTimeupdate = true;
17 v.removeEventListener("timeupdate", timeupdate, false);
18 }
20 function seekStarted() {
21 if (completed)
22 return;
24 ok(v.currentTime >= seekTime - 0.1, "Video currentTime should be around " + seekTime + ": " + v.currentTime);
25 v.addEventListener("timeupdate", timeupdate, false);
26 startPassed = true;
27 }
29 function seekEnded() {
30 if (completed)
31 return;
33 var t = v.currentTime;
34 ok(Math.abs(t - seekTime) <= 0.1, "Video currentTime should be around " + seekTime + ": " + t);
35 ok(gotTimeupdate, "Should have got timeupdate between seeking and seekended");
36 completed = true;
37 finish();
38 }
40 v.addEventListener("loadedmetadata", startTest, false);
41 v.addEventListener("seeking", seekStarted, false);
42 v.addEventListener("seeked", seekEnded, false);
44 }