michael@0: function test_seek10(v, seekTime, is, ok, finish) { michael@0: michael@0: // Test bug 523335 - ensure that if we close a stream while seeking, we michael@0: // don't hang during shutdown. This test won't "fail" per se if it's regressed, michael@0: // it will instead start to cause random hangs in the mochitest harness on michael@0: // shutdown. michael@0: michael@0: function startTest() { michael@0: // Must be duration*0.9 rather than seekTime, else we don't hit that problem. michael@0: // This is probably due to the seek bisection finishing too quickly, before michael@0: // we can close the stream. michael@0: v.currentTime = v.duration * 0.9; michael@0: } michael@0: michael@0: function done(evt) { michael@0: ok(true, "We don't acutally test anything..."); michael@0: finish(); michael@0: } michael@0: michael@0: function seeking() { michael@0: ok(v.currentTime >= seekTime - 0.1, "Video currentTime should be around " + seekTime + ": " + v.currentTime); michael@0: v.onerror = done; michael@0: v.src = "not a valid video file."; michael@0: v.load(); // Cause the existing stream to close. michael@0: } michael@0: michael@0: v.addEventListener("loadeddata", startTest, false); michael@0: v.addEventListener("seeking", seeking, false); michael@0: michael@0: }