Backed out changeset 9f8ac6bbbd47 (bug 1450954) for frequent failures in the newly-added test. DONTBUILD
authorRyan VanderMeulen <ryanvm@gmail.com>
Mon, 16 Apr 2018 15:20:43 -0400
changeset 463307 1c12e0428ff13c0b07a612d48f7043e4931e74c1
parent 463306 1cf6b6ff8bd2d01bf14175640971f1c28d1ea7fe
child 463308 e33dbf9bdeee771c9023a9ea2a26e088d2fe3f2b
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1450954
milestone60.0
backs out9f8ac6bbbd47a4da7cad5f138a58528d382a5f25
Backed out changeset 9f8ac6bbbd47 (bug 1450954) for frequent failures in the newly-added test. DONTBUILD
dom/media/tests/mochitest/test_getUserMedia_basicScreenshare.html
--- a/dom/media/tests/mochitest/test_getUserMedia_basicScreenshare.html
+++ b/dom/media/tests/mochitest/test_getUserMedia_basicScreenshare.html
@@ -99,34 +99,25 @@
       SpecialPowers.wrap(document).onfullscreenerror = () => reject(new Error("fullscreenerror"));
 
       // Note that going fullscreen requires the tab (and window) to be in the
       // foreground and having focus.
       SpecialPowers.wrap(canvas).requestFullscreen();
     });
 
     info("Testing screenshare without constraints");
-    let stream = await getUserMedia({video: {mediaSource: "screen"}});
-    let settings = stream.getTracks()[0].getSettings();
-    ok(settings.width <= 8192,
-       `Width setting ${settings.width} should be set after gUM (or 0 per bug 1453247)`);
-    ok(settings.height <= 8192,
-       `Height setting ${settings.height} should be set after gUM (or 0 per bug 1453247)`);
+    let stream = await getUserMedia({
+      video: {mediaSource: "screen"},
+      fake: false,
+    });
     draw(helper.red, helper.blue,
          helper.green, helper.grey);
     let playback = new LocalMediaStreamPlayback(testVideo, stream);
     playback.startMedia();
     await playback.verifyPlaying();
-    settings = stream.getTracks()[0].getSettings();
-    is(settings.width, testVideo.videoWidth,
-       "Width setting should match video width");
-    is(settings.height, testVideo.videoHeight,
-       "Height setting should match video height");
-    let screenWidth = testVideo.videoWidth;
-    let screenHeight = testVideo.videoHeight;
     await verifyScreenshare(testVideo, helper,
                             helper.red, helper.blue,
                             helper.green, helper.grey);
     for (let track of stream.getTracks()) {
       track.stop();
     }
     playback.detachFromMediaElement();
 
@@ -142,75 +133,40 @@
           min: '10',
           max: '100'
         },
         frameRate: {
           min: '10',
           max: '15'
         },
       },
+      fake: false,
     });
-    settings = stream.getTracks()[0].getSettings();
-    ok(settings.width == 0 || (settings.width >= 10 && settings.width <= 100),
-       `Width setting ${settings.width} should be correct after gUM (or 0 per bug 1453247)`);
-    ok(settings.height == 0 || (settings.height >= 10 && settings.height <= 100),
-       `Height setting ${settings.height} should be correct after gUM (or 0 per bug 1453247)`);
     draw(helper.green, helper.red,
          helper.grey, helper.blue);
     playback = new LocalMediaStreamPlayback(testVideo, stream);
     playback.startMedia();
     await playback.verifyPlaying();
-    settings = stream.getTracks()[0].getSettings();
-    ok(settings.width >= 10 && settings.width <= 100,
-       `Width setting ${settings.width} should be within constraints`);
-    ok(settings.height >= 10 && settings.height <= 100,
-       `Height setting ${settings.height} should be within constraints`);
-    is(settings.width, testVideo.videoWidth,
-       "Width setting should match video width");
-    is(settings.height, testVideo.videoHeight,
-       "Height setting should match video height");
-    let expectedHeight = (screenHeight * settings.width) / screenWidth;
-    ok(Math.abs(expectedHeight - settings.height) <= 1,
-       "Aspect ratio after constrained gUM should be close enough");
     await verifyScreenshare(testVideo, helper,
                             helper.green, helper.red,
                             helper.grey, helper.blue);
 
     info("Testing modifying screenshare with applyConstraints");
-    let resize = haveEvent(testVideo, "resize", wait(5000, new Error("Timeout")));
-    await testVideo.srcObject.getVideoTracks()[0].applyConstraints({
-      mediaSource: 'screen',
-      width: 200,
-      height: 200,
-      frameRate: {
-        min: '5',
-        max: '10'
-      }
-    });
-    // getSettings() should report correct size as soon as applyConstraints()
-    // resolves - bug 1453259. Until fixed, check that we at least report
-    // something sane.
-    let newSettings = stream.getTracks()[0].getSettings();
-    ok(newSettings.width > settings.width && newSettings.width < screenWidth,
-       `Width setting ${newSettings.width} should have increased after applyConstraints`);
-    ok(newSettings.height > settings.height && newSettings.height < screenHeight,
-       `Height setting ${newSettings.height} should have increased after applyConstraints`);
-    await resize;
-    settings = stream.getTracks()[0].getSettings();
-    ok(settings.width > 100 && settings.width < screenWidth,
-       `Width setting ${settings.width} should have increased after first frame after applyConstraints`);
-    ok(settings.height > 100 && settings.height < screenHeight,
-       `Height setting ${settings.height} should have increased after first frame after applyConstraints`);
-    is(settings.width, testVideo.videoWidth,
-       "Width setting should match video width");
-    is(settings.height, testVideo.videoHeight,
-       "Height setting should match video height");
-    expectedHeight = (screenHeight * settings.width) / screenWidth;
-    ok(Math.abs(expectedHeight - settings.height) <= 1,
-       "Aspect ratio after applying constraints should be close enough");
+    await Promise.all([
+      testVideo.srcObject.getVideoTracks()[0].applyConstraints({
+        mediaSource: 'screen',
+        width: 200,
+        height: 200,
+        frameRate: {
+          min: '5',
+          max: '10'
+        }
+      }),
+      haveEvent(testVideo, "resize", wait(5000, new Error("Timeout"))),
+    ]);
     draw(helper.grey, helper.green,
          helper.blue, helper.red);
     await playback.verifyPlaying(); // still playing
     await verifyScreenshare(testVideo, helper,
                             helper.grey, helper.green,
                             helper.blue, helper.red);
     await playback.deprecatedStopStreamInMediaPlayback();
     playback.detachFromMediaElement();