Bug 1407842 - Wrap fullscreen api calls with SpecialPowers. r?jib draft
authorAndreas Pehrson <pehrsons@mozilla.com>
Thu, 12 Oct 2017 11:38:27 +0200
changeset 679029 fb019c232692c6105bd41eb310dc9394e8180322
parent 679028 29e16eaccf3d4a8fc2a21829ee4689b99931f260
child 735513 a839d91ae5a593a34a7d2c6439fa66bce04a120a
push id84123
push userpehrsons@gmail.com
push dateThu, 12 Oct 2017 09:39:08 +0000
reviewersjib
bugs1407842
milestone58.0
Bug 1407842 - Wrap fullscreen api calls with SpecialPowers. r?jib MozReview-Commit-ID: 9bCO80q2sJB
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
@@ -93,22 +93,22 @@
       helper.drawColor(canvas, upleft, {offsetX: 0, offsetY: 0});
       helper.drawColor(canvas, upright, {offsetX: 10, offsetY: 0});
       helper.drawColor(canvas, downleft, {offsetX: 0, offsetY: 10});
       helper.drawColor(canvas, downright, {offsetX: 10, offsetY: 10});
     };
     let helper = new CaptureStreamTestHelper2D(1, 1);
 
     await new Promise((resolve, reject) => {
-      document.onfullscreenchange = resolve;
-      document.onfullscreenerror = () => reject(new Error("fullscreenerror"));
+      SpecialPowers.wrap(document).onfullscreenchange = resolve;
+      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.
-      canvas.requestFullscreen();
+      SpecialPowers.wrap(canvas).requestFullscreen();
     });
 
     info("Testing screenshare without constraints");
     let stream = await getUserMedia({
       video: {mediaSource: "screen"},
       fake: false,
     });
     draw(helper.red, helper.blue,
@@ -169,14 +169,14 @@
          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();
 
-    document.exitFullscreen();
+    SpecialPowers.wrap(document).exitFullscreen();
   });
 </script>
 </pre>
 </body>
 </html>