Backed out changeset 621860d37e72 (bug 1315858) for WinXP failures in test_getUserMedia_scarySources.html
authorPhil Ringnalda <philringnalda@gmail.com>
Tue, 08 Nov 2016 20:50:53 -0800
changeset 351714 76b2f75e20f7794a8263f249ddc36907262c327d
parent 351713 8b988d56154b865c3e19786b073315971d3b6313
child 351715 ab5b5e1a8fc0d4f21de1a9f4d24269f922e7c201
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1315858
milestone52.0a1
backs out621860d37e7223a26c116c3dd5f9236d757459e3
Backed out changeset 621860d37e72 (bug 1315858) for WinXP failures in test_getUserMedia_scarySources.html
dom/media/MediaManager.cpp
dom/media/tests/mochitest/mochitest.ini
dom/media/tests/mochitest/test_getUserMedia_scarySources.html
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -2295,18 +2295,17 @@ if (privileged) {
 
   nsString callID;
   rv = GenerateUUID(callID);
   NS_ENSURE_SUCCESS(rv, rv);
 
   bool fake = c.mFake.WasPassed()? c.mFake.Value() :
       Preferences::GetBool("media.navigator.streams.fake");
 
-  bool askPermission =
-      (!privileged || Preferences::GetBool("media.navigator.permission.force")) &&
+  bool askPermission = !privileged &&
       (!fake || Preferences::GetBool("media.navigator.permission.fake"));
 
   RefPtr<PledgeSourceSet> p = EnumerateDevicesImpl(windowID, videoType,
                                                    audioType, fake);
   p->Then([this, onSuccess, onFailure, windowID, c, listener, askPermission,
            prefs, isHTTPS, callID, origin, isChrome](SourceSet*& aDevices) mutable {
 
     RefPtr<Refcountable<UniquePtr<SourceSet>>> devices(
--- a/dom/media/tests/mochitest/mochitest.ini
+++ b/dom/media/tests/mochitest/mochitest.ini
@@ -68,18 +68,16 @@ skip-if = android_version == '18' # andr
 [test_getUserMedia_mediaElementCapture_video.html]
 skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_getUserMedia_mediaStreamClone.html]
 [test_getUserMedia_mediaStreamConstructors.html]
 [test_getUserMedia_mediaStreamTrackClone.html]
 [test_getUserMedia_playAudioTwice.html]
 [test_getUserMedia_playVideoAudioTwice.html]
 [test_getUserMedia_playVideoTwice.html]
-[test_getUserMedia_scarySources.html]
-skip-if = toolkit == 'android' # no screenshare or windowshare on android
 [test_getUserMedia_spinEventLoop.html]
 [test_getUserMedia_stopAudioStream.html]
 [test_getUserMedia_stopAudioStreamWithFollowupAudio.html]
 [test_getUserMedia_stopVideoAudioStream.html]
 [test_getUserMedia_stopVideoAudioStreamWithFollowupVideoAudio.html]
 [test_getUserMedia_stopVideoStream.html]
 [test_getUserMedia_stopVideoStreamWithFollowupVideo.html]
 [test_getUserMedia_trackCloneCleanup.html]
deleted file mode 100644
--- a/dom/media/tests/mochitest/test_getUserMedia_scarySources.html
+++ /dev/null
@@ -1,60 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <script type="application/javascript" src="head.js"></script>
-  <script type="application/javascript" src="mediaStreamPlayback.js"></script>
-</head>
-<body>
-<pre id="test">
-<script type="application/javascript">
-
-createHTML({title: "Detect screensharing sources that are firefox", bug: "1311048"});
-
-netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-
-const { Services } = SpecialPowers.Cu.import('resource://gre/modules/Services.jsm');
-
-let observe = topic => new Promise(r => Services.obs.addObserver(function o(...args) {
-  Services.obs.removeObserver(o, topic);
-  r(args);
-}, topic, false));
-
-let getDevices = async constraints => {
-  let [{ windowID, innerWindowID, callID }] = await Promise.race([
-    getUserMedia(constraints),
-    observe("getUserMedia:request")
-  ]);
-  let window = Services.wm.getOuterWindowWithId(windowID);
-  let devices = await new Promise((resolve, reject) =>
-      window.navigator.mozGetUserMediaDevices({}, resolve, reject,
-                                              innerWindowID, callID));
-  return devices.map(d => d.QueryInterface(Ci.nsIMediaDevice));
-};
-
-runTest(async () => {
-  try {
-    await pushPrefs(["media.navigator.permission.disabled", true],
-                    ["media.navigator.permission.fake", true],
-                    ["media.navigator.permission.force", true]);
-    let devices = await getDevices({video: { mediaSource: "window" }});
-    ok(devices.length, "Found one or more windows.");
-    devices = devices.filter(d => d.scary);
-    ok(devices.length, "Found one or more scary windows (our own counts).");
-    devices.filter(d => d.name.includes("MochiTest"));
-    ok(devices.length,
-       "Our own window is among the scary: " + devices.map(d => `"${d.name}"`));
-
-    devices = await getDevices({video: { mediaSource: "screen" }});
-    let numScreens = devices.length;
-    ok(numScreens, "Found one or more screens.");
-    devices = devices.filter(d => d.scary);
-    is(devices.length, numScreens, "All screens are scary.");
-  } catch(e) {
-    ok(false, e);
-  }
-});
-
-</script>
-</pre>
-</body>
-</html>