Bug 1305601 - Increase test_gUM_mediaElementCapture_tracks.html timeouts to 50 seconds. r=jib
authorAndreas Pehrson <pehrsons@gmail.com>
Tue, 11 Oct 2016 17:22:26 +0200
changeset 317481 2aef09a9b7f9ef1f928823ade13378e900ef1bb7
parent 317480 380b5366b20f4ad1cb21ee8252486017e0f66ad2
child 317482 8fef52daf4b5be227469a5603da1211e50c895b6
push id30805
push usercbook@mozilla.com
push dateWed, 12 Oct 2016 10:00:08 +0000
treeherdermozilla-central@feb1c52ebe9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1305601
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1305601 - Increase test_gUM_mediaElementCapture_tracks.html timeouts to 50 seconds. r=jib MozReview-Commit-ID: 1wY3Y3MxPGA
dom/media/tests/mochitest/test_getUserMedia_mediaElementCapture_tracks.html
--- a/dom/media/tests/mochitest/test_getUserMedia_mediaElementCapture_tracks.html
+++ b/dom/media/tests/mochitest/test_getUserMedia_mediaElementCapture_tracks.html
@@ -24,17 +24,17 @@ var tracks = [];
 runTest(() => getUserMedia({audio: true, video: true})
   .then(stream => {
     // We need to test with multiple tracks. We add an extra of each kind.
     stream.getTracks().forEach(t => stream.addTrack(t.clone()));
 
     audioElement = createMediaElement("gUMAudio", "local", "gUMAudio", true);
     audioElement.srcObject = stream;
 
-    return haveEvent(audioElement, "loadedmetadata", wait(5000, new Error("Timeout")));
+    return haveEvent(audioElement, "loadedmetadata", wait(50000, new Error("Timeout")));
   })
   .then(() => {
     info("Capturing audio element (loadedmetadata -> captureStream)");
     audioCaptureStream = audioElement.mozCaptureStream();
 
     is(audioCaptureStream.getAudioTracks().length, 2,
        "audio element should capture two audio tracks");
     is(audioCaptureStream.getVideoTracks().length, 0,
@@ -48,29 +48,29 @@ runTest(() => getUserMedia({audio: true,
     info("Capturing video element (captureStream -> loadedmetadata)");
     videoCaptureStream = videoElement.mozCaptureStream();
     videoElement.srcObject = audioElement.srcObject.clone();
 
     is(videoCaptureStream.getTracks().length, 0,
        "video element should have no tracks before metadata known");
 
     return haveEventsButNoMore(
-        videoCaptureStream, "addtrack", 3, wait(5000, new Error("No event")));
+        videoCaptureStream, "addtrack", 3, wait(50000, new Error("No event")));
   })
   .then(() => {
     is(videoCaptureStream.getAudioTracks().length, 2,
        "video element should capture two audio tracks");
     is(videoCaptureStream.getVideoTracks().length, 1,
        "video element should capture one video track at most");
 
     info("Testing dynamically adding audio track to audio element");
     audioElement.srcObject.addTrack(
         audioElement.srcObject.getAudioTracks()[0].clone());
     return haveEventsButNoMore(
-        audioCaptureStream, "addtrack", 1, wait(5000, new Error("No event")));
+        audioCaptureStream, "addtrack", 1, wait(50000, new Error("No event")));
   })
   .then(() => {
     is(audioCaptureStream.getAudioTracks().length, 3,
        "Audio element should have three audio tracks captured.");
 
     info("Testing dynamically adding video track to audio element");
     audioElement.srcObject.addTrack(
         audioElement.srcObject.getVideoTracks()[0].clone());
@@ -79,17 +79,17 @@ runTest(() => getUserMedia({audio: true,
   .then(() => {
     is(audioCaptureStream.getVideoTracks().length, 0,
        "Audio element should have no video tracks captured.");
 
     info("Testing dynamically adding audio track to video element");
     videoElement.srcObject.addTrack(
         videoElement.srcObject.getAudioTracks()[0].clone());
     return haveEventsButNoMore(
-        videoCaptureStream, "addtrack", 1, wait(5000, new Error("Timeout")));
+        videoCaptureStream, "addtrack", 1, wait(50000, new Error("Timeout")));
   })
   .then(() => {
     is(videoCaptureStream.getAudioTracks().length, 3,
        "Captured video stream should have three audio tracks captured.");
 
     info("Testing dynamically adding video track to video element");
     videoElement.srcObject.addTrack(
         videoElement.srcObject.getVideoTracks()[0].clone());
@@ -103,34 +103,34 @@ runTest(() => getUserMedia({audio: true,
     tracks.push(...videoElement.srcObject.getTracks());
     videoElement.srcObject.getVideoTracks().reverse().forEach(t =>
         videoElement.srcObject.removeTrack(t));
     is(videoCaptureStream.getVideoTracks()
                          .filter(t => t.readyState == "live").length, 1,
        "Captured video should have still have one video track captured.");
 
     return haveEvent(videoCaptureStream.getVideoTracks()[0], "ended",
-                     wait(5000, new Error("Timeout")));
+                     wait(50000, new Error("Timeout")));
   })
   .then(() => {
     is(videoCaptureStream.getVideoTracks()
                          .filter(t => t.readyState == "live").length, 0,
        "Captured video stream should have no video tracks captured after removal.");
 
     info("Testing source reset.");
   })
   .then(() => getUserMedia({audio: true, video: true}))
   .then(stream => {
     videoElement.srcObject = stream;
     return Promise.all(videoCaptureStream.getTracks()
         .filter(t => t.readyState == "live")
-        .map(t => haveEvent(t, "ended", wait(5000, new Error("Timeout")))));
+        .map(t => haveEvent(t, "ended", wait(50000, new Error("Timeout")))));
   })
   .then(() => haveEventsButNoMore(
-                  videoCaptureStream, "addtrack", 2, wait(5000, new Error("Timeout"))))
+                  videoCaptureStream, "addtrack", 2, wait(50000, new Error("Timeout"))))
   .then(() => {
     is(videoCaptureStream.getAudioTracks()
         .filter(t => t.readyState == "ended").length, 3,
        "Captured video stream should have three ended audio tracks");
     is(videoCaptureStream.getAudioTracks()
         .filter(t => t.readyState == "live").length, 1,
        "Captured video stream should have one live audio track");
 
@@ -142,41 +142,41 @@ runTest(() => getUserMedia({audio: true,
        "Captured video stream should have one live video track");
 
     info("Testing CaptureStreamUntilEnded");
     untilEndedElement =
       createMediaElement("gUMVideoUntilEnded", "local", "gUMVideoUntilEnded", false);
     untilEndedElement.srcObject = audioElement.srcObject;
 
     return haveEvent(untilEndedElement, "loadedmetadata",
-                     wait(5000, new Error("Timeout")));
+                     wait(50000, new Error("Timeout")));
   })
   .then(() => {
     streamUntilEnded = untilEndedElement.mozCaptureStreamUntilEnded();
 
     is(streamUntilEnded.getAudioTracks().length, 3,
        "video element should capture all 3 audio tracks until ended");
     is(streamUntilEnded.getVideoTracks().length, 1,
        "video element should capture only 1 video track until ended");
 
     untilEndedElement.srcObject.getTracks().forEach(t => t.stop());
     // TODO(1208316) We stop the stream to make the media element end.
     untilEndedElement.srcObject.stop();
 
     return Promise.all([
-      haveEvent(untilEndedElement, "ended", wait(5000, new Error("Timeout"))),
+      haveEvent(untilEndedElement, "ended", wait(50000, new Error("Timeout"))),
       ...streamUntilEnded.getTracks()
-           .map(t => haveEvent(t, "ended", wait(5000, new Error("Timeout"))))
+           .map(t => haveEvent(t, "ended", wait(50000, new Error("Timeout"))))
     ]);
   })
   .then(() => {
     info("Element and tracks ended. Ensuring that new tracks aren't created.");
     untilEndedElement.srcObject = videoElement.srcObject;
     return haveEventsButNoMore(
-        untilEndedElement, "loadedmetadata", 1, wait(5000, new Error("Timeout")));
+        untilEndedElement, "loadedmetadata", 1, wait(50000, new Error("Timeout")));
   })
   .then(() => is(streamUntilEnded.getTracks().length, 4,
                  "Should still have 4 tracks"))
   .catch(e => ok(false, "Test failed: " + e + (e && e.stack ? "\n" + e.stack : "")))
   .then(() => [...tracks,
                ...videoElement.srcObject.getTracks()].forEach(t => t.stop())));
 
 </script>