Bug 1335740 - Update wpt & mochitests to work w/[SecureContext] navigator.mediaDevices. r=pehrsons
authorJan-Ivar Bruaroey <jib@mozilla.com>
Tue, 19 Mar 2019 14:17:53 +0000
changeset 465148 7beefe9e4d811305370548773956f56c5cc74fd5
parent 465147 35abcd7c962a7f5b74b8789f24d5071436a20bfc
child 465149 fece5bb7e809fd3a7dd960ad9c0df9167b27fecc
push id35732
push useropoprus@mozilla.com
push dateWed, 20 Mar 2019 10:52:37 +0000
treeherdermozilla-central@708979f9c3f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspehrsons
bugs1335740
milestone68.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 1335740 - Update wpt & mochitests to work w/[SecureContext] navigator.mediaDevices. r=pehrsons Differential Revision: https://phabricator.services.mozilla.com/D20425
browser/base/content/test/webrtc/browser_devices_get_user_media.js
dom/media/test/crashtests/crashtests.list
dom/media/test/mochitest.ini
dom/media/tests/crashtests/crashtests.list
dom/media/tests/mochitest/identity/mochitest.ini
dom/media/tests/mochitest/mediaStreamPlayback.js
dom/media/tests/mochitest/mochitest.ini
dom/media/tests/mochitest/test_enumerateDevices.html
dom/media/tests/mochitest/test_enumerateDevices_iframe.html
dom/media/tests/mochitest/test_getUserMedia_permission.html
dom/media/tests/mochitest/test_getUserMedia_permission_iframe.html
dom/media/tests/mochitest/test_peerConnection_basicAudioNATRelay.html
dom/media/tests/mochitest/test_peerConnection_basicAudioNATRelayTCP.html
dom/media/tests/mochitest/test_peerConnection_basicAudioNATRelayTLS.html
dom/media/tests/mochitest/test_peerConnection_basicAudioNATSrflx.html
dom/media/tests/mochitest/test_peerConnection_stats_relayProtocol.html
dom/media/webaudio/test/mochitest.ini
testing/web-platform/meta/mediacapture-streams/MediaDevices-getSupportedConstraints.html.ini
testing/web-platform/meta/mediacapture-streams/MediaDevices-getSupportedConstraints.https.html.ini
testing/web-platform/tests/mediacapture-streams/MediaDevices-SecureContext.html
testing/web-platform/tests/mediacapture-streams/MediaDevices-getSupportedConstraints.html
testing/web-platform/tests/mediacapture-streams/MediaDevices-getSupportedConstraints.https.html
--- a/browser/base/content/test/webrtc/browser_devices_get_user_media.js
+++ b/browser/base/content/test/webrtc/browser_devices_get_user_media.js
@@ -525,16 +525,20 @@ var gTests = [
     await closeStream();
   },
 },
 
 {
   desc: "'Always Allow' disabled on http pages",
   run: async function checkNoAlwaysOnHttp() {
     // Load an http page instead of the https version.
+    await SpecialPowers.pushPrefEnv({ set: [
+        ["media.devices.insecure.enabled", true],
+        ["media.getusermedia.insecure.enabled", true],
+    ]});
     let browser = gBrowser.selectedBrowser;
     BrowserTestUtils.loadURI(browser, browser.documentURI.spec.replace("https://", "http://"));
     await BrowserTestUtils.browserLoaded(browser);
 
     // Initially set both permissions to 'allow'.
     let Perms = Services.perms;
     let uri = browser.documentURI;
     Perms.add(uri, "microphone", Perms.ALLOW_ACTION);
--- a/dom/media/test/crashtests/crashtests.list
+++ b/dom/media/test/crashtests/crashtests.list
@@ -108,12 +108,12 @@ load buffer-source-slow-resampling-1.htm
 skip-if(verify&&isDebugBuild&&gtkWidget) HTTP load media-element-source-seek-1.html
 skip-if(verify&&isDebugBuild&&gtkWidget) load offline-buffer-source-ended-1.html
 load oscillator-ended-1.html
 load oscillator-ended-2.html
 skip-if(Android&&AndroidVersion=='22') load video-replay-after-audio-end.html # bug 1315125, bug 1358876
 # This needs to run at the end to avoid leaking busted state into other tests.
 skip-if(Android) load 691096-1.html # Bug 1365451
 load 1236639.html
-test-pref(media.navigator.permission.disabled,true) load 1388372.html
+test-pref(media.navigator.permission.disabled,true) test-pref(media.getusermedia.insecure.enabled,true) test-pref(media.getusermedia.insecure.enabled,true) load 1388372.html
 load 1494073.html
 skip-if(Android) load 1526044.html # Bug 1528391
 load 1533909.html
--- a/dom/media/test/mochitest.ini
+++ b/dom/media/test/mochitest.ini
@@ -875,16 +875,17 @@ scheme=https
 [test_empty_resource.html]
 [test_error_in_video_document.html]
 [test_error_on_404.html]
 [test_fastSeek.html]
 skip-if = toolkit == 'android' # android(bug 1232305)
 [test_fastSeek-forwards.html]
 skip-if = toolkit == 'android' # bug 1337590, android(bug 1232305)
 [test_imagecapture.html]
+scheme=https
 [test_info_leak.html]
 [test_invalid_reject.html]
 skip-if = android_version == '17' # android(bug 1232305)
 [test_invalid_reject_play.html]
 skip-if = android_version <= '17' # android(bug 1232305)
 [test_invalid_seek.html]
 [test_load.html]
 skip-if = android_version == '17' # android(bug 1232305)
@@ -898,16 +899,17 @@ skip-if = toolkit == 'android' # android
 [test_loop.html]
 skip-if = toolkit == 'android' # bug 1242112, android(bug 1232305)
 [test_looping_eventsOrder.html]
 [test_media_selection.html]
 [test_media_sniffer.html]
 skip-if = android_version == '17' # android(bug 1232305)
 [test_mediarecorder_avoid_recursion.html]
 skip-if = (os == 'win' && !debug) || (android_version == '17') # bug 1228605, android(bug 1232305)
+scheme=https
 tags=msg
 [test_mediarecorder_bitrate.html]
 skip-if = toolkit == 'android' # bug 1297432, android(bug 1232305)
 tags=msg
 [test_mediarecorder_creation.html]
 skip-if = android_version == '17' # android(bug 1232305)
 tags=msg capturestream
 [test_mediarecorder_creation_fail.html]
@@ -951,19 +953,21 @@ tags=msg
 [test_mediarecorder_record_upsize_resolution.html]
 skip-if = toolkit == 'android' # android(bug 1232305)
 tags=msg
 [test_mediarecorder_record_downsize_resolution.html]
 skip-if = toolkit == 'android' # android(bug 1232305)
 tags=msg
 [test_mediarecorder_record_gum_video_timeslice.html]
 skip-if = android_version == '17' # bug 1297298, android(bug 1232305)
+scheme=https
 tags=msg
 [test_mediarecorder_record_gum_video_timeslice_mixed.html]
 skip-if = android_version == '17' # bug 1297298, android(bug 1232305)
+scheme=https
 tags=msg
 [test_mediarecorder_record_immediate_stop.html]
 skip-if = android_version == '17' # android(bug 1232305)
 tags=msg capturestream
 [test_mediarecorder_record_no_timeslice.html]
 skip-if = android_version == '17' # bug 1306513, android(bug 1232305)
 tags=msg capturestream
 [test_mediarecorder_record_session.html]
@@ -979,42 +983,46 @@ skip-if = android_version == '17' # andr
 tags=msg capturestream
 [test_mediarecorder_state_transition.html]
 skip-if = android_version == '17' # android(bug 1232305)
 tags=msg capturestream
 [test_mediarecorder_state_event_order.html]
 skip-if = android_version == '17' # android(bug 1232305)
 tags=msg capturestream
 [test_mediarecorder_unsupported_src.html]
+scheme=https
 tags=msg
 [test_mediarecorder_webm_support.html]
 skip-if = android_version == '17' # android(bug 1232305)
 tags=msg
 [test_mediarecorder_record_getdata_afterstart.html]
 skip-if = android_version == '17' # bug 1240299, android(bug 1232305)
 tags=msg capturestream
 [test_mediatrack_consuming_mediaresource.html]
 skip-if = toolkit == 'android' # android(bug 1232305)
 [test_mediatrack_consuming_mediastream.html]
 skip-if = android_version == '17' # android(bug 1232305)
+scheme=https
 tags=msg
 [test_mediatrack_events.html]
 skip-if = android_version == '17' # android(bug 1232305)
+scheme=https
 [test_mediatrack_parsing_ogg.html]
 skip-if = android_version == '17' # android(bug 1232305)
 [test_mediatrack_replay_from_end.html]
 skip-if = toolkit == 'android' # android(bug 1232305)
 [test_metadata.html]
 [test_midflight_redirect_blocked.html]
 [test_mixed_principals.html]
 skip-if = toolkit == 'android' # bug 1309814, android(bug 1232305)
 [test_mozHasAudio.html]
 skip-if = toolkit == 'android' # android(bug 1232305)
 [test_multiple_mediastreamtracks.html]
 skip-if = android_version == '17' # android(bug 1232305)
+scheme=https
 [test_networkState.html]
 skip-if = android_version == '17' # android(bug 1232305)
 [test_new_audio.html]
 skip-if = toolkit == 'android' # bug 1372457
 [test_no_load_event.html]
 skip-if = android_version == '17' # android(bug 1232305)
 [test_paused.html]
 skip-if = android_version == '17' # android(bug 1232305)
@@ -1183,16 +1191,17 @@ tags=msg capturestream
 [test_streams_element_capture_reset.html]
 skip-if = toolkit == 'android' # android(bug 1232305)
 tags=msg capturestream
 [test_streams_gc.html]
 skip-if = android_version == '17' || (android_version == '19' && debug) # android(bug 1232305)
 tags=msg capturestream
 [test_streams_individual_pause.html]
 skip-if = android_version == '17' || android_version == '19' # android(bug 1232305)
+scheme=https
 tags=msg
 [test_streams_srcObject.html]
 skip-if = toolkit == 'android' # bug 1300443, android(bug 1232305)
 tags=msg capturestream
 [test_streams_tracks.html]
 skip-if = toolkit == 'android' # android(bug 1232305)
 tags=msg capturestream
 [test_texttrack.html]
--- a/dom/media/tests/crashtests/crashtests.list
+++ b/dom/media/tests/crashtests/crashtests.list
@@ -1,9 +1,9 @@
-default-preferences  pref(media.peerconnection.enabled,true) pref(media.navigator.permission.disabled,true) pref(dom.disable_open_during_load,false)
+default-preferences  pref(media.peerconnection.enabled,true) pref(media.navigator.permission.disabled,true) pref(dom.disable_open_during_load,false) pref(media.getusermedia.insecure.enabled,true) pref(media.getusermedia.insecure.enabled,true)
 
 load 780790.html
 load 791270.html
 load 791278.html
 load 791330.html
 load 799419.html
 load 802982.html
 load 812785.html
--- a/dom/media/tests/mochitest/identity/mochitest.ini
+++ b/dom/media/tests/mochitest/identity/mochitest.ini
@@ -28,23 +28,28 @@ support-files =
   /.well-known/idp-proxy/idp-redirect-https-odd-path.js
   /.well-known/idp-proxy/idp-redirect-https-odd-path.js^headers^
   /.well-known/idp-min.js
   /.well-known/idp-proxy/idp-bad.js
 skip-if = android_version == '22' # bug 1358876, bug 1361325
 
 [test_fingerprints.html]
 skip-if = android_version == '22' # bug 1329257, bug 1358876, bug 1361325
+scheme=https
 [test_getIdentityAssertion.html]
 skip-if = android_version == '22' # bug 1358876, bug 1361325
 [test_setIdentityProvider.html]
 skip-if = android_version == '22' # bug 1358876, bug 1361325
+scheme=https
 [test_setIdentityProviderWithErrors.html]
 skip-if = android_version == '22' # bug 1358876, bug 1361325
+scheme=https
 [test_peerConnection_peerIdentity.html]
 skip-if = android_version == '22' # bug 1358876, bug 1361325
+scheme=https
 [test_peerConnection_asymmetricIsolation.html]
 skip-if = android_version == '22' # bug 1358876, bug 1361325
+scheme=https
 [test_loginNeeded.html]
 support-files =
   /.well-known/idp-proxy/login.html
   /.well-known/idp-proxy/idp.sjs
 skip-if = android_version == '22' # bug 1358876, bug 1361325
--- a/dom/media/tests/mochitest/mediaStreamPlayback.js
+++ b/dom/media/tests/mochitest/mediaStreamPlayback.js
@@ -162,17 +162,18 @@ function createHTML(options) {
 //
 // It relies on the fact that, by spec, device labels from enumerateDevices are
 // only visible during active gum calls. They're also visible when persistent
 // permissions are granted, so turn off media.navigator.permission.disabled
 // (which is normally on otherwise in our tests). Lastly, we must turn on
 // media.navigator.permission.fake otherwise fake devices don't count as active.
 
 var noGum = () => pushPrefs(["media.navigator.permission.disabled", false],
-                            ["media.navigator.permission.fake", true])
+                            ["media.navigator.permission.fake", true],
+                            ["media.devices.insecure.enabled", true])
   .then(() => navigator.mediaDevices.enumerateDevices())
   .then(([device]) => device &&
       is(device.label, "", "Test must leave no active gUM streams behind."));
 
 var runTest = testFunction => scriptsReady
   .then(() => runTestWhenReady(testFunction))
   .then(() => noGum())
   .then(() => finish());
--- a/dom/media/tests/mochitest/mochitest.ini
+++ b/dom/media/tests/mochitest/mochitest.ini
@@ -1,11 +1,12 @@
 [DEFAULT]
 tags = msg webrtc
 subsuite = media
+scheme = https
 support-files =
   head.js
   dataChannel.js
   mediaStreamPlayback.js
   network.js
   nonTrickleIce.js
   pc.js
   templates.js
@@ -24,32 +25,36 @@ support-files =
   !/dom/media/test/320x240.ogv
   !/dom/media/test/r11025_s16_c1.wav
   !/dom/media/test/bug461281.ogg
   !/dom/media/test/seek.webm
   !/dom/media/test/gizmo.mp4
 
 [test_1488832.html]
 [test_a_noOp.html]
+scheme=http
 [test_dataChannel_basicAudio.html]
 skip-if = (android_version == '18') # Bug 962984 for debug, bug 963244 for opt
 [test_dataChannel_basicAudioVideo.html]
 skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_dataChannel_basicAudioVideoNoBundle.html]
 skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_dataChannel_basicAudioVideoCombined.html]
 skip-if = toolkit == 'android'  # Bug 1189784
 [test_dataChannel_basicDataOnly.html]
+scheme=http
 [test_dataChannel_basicVideo.html]
 skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_dataChannel_bug1013809.html]
 skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_dataChannel_dataOnlyBufferedAmountLow.html]
 skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
+scheme=http
 [test_dataChannel_noOffer.html]
+scheme=http
 [test_enumerateDevices.html]
 [test_enumerateDevices_navigation.html]
 [test_groupId.html]
 [test_ondevicechange.html]
 skip-if = os == 'android' || verify
 [test_getUserMedia_active_autoplay.html]
 [test_getUserMedia_audioCapture.html]
 skip-if = toolkit == 'android' # android(Bug 1189784, timeouts on 4.3 emulator), android(Bug 1264333)
@@ -123,22 +128,26 @@ skip-if = (android_version == '18') # an
 [test_peerConnection_audioSynchronizationSourcesUnidirectional.html]
 skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_audioContributingSources.html]
 skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_checkPacketDumpHook.html]
 skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_basicAudioNATSrflx.html]
 skip-if = toolkit == 'android' || (verify && (os == 'linux')) || socketprocess_e10s # websockets don't work on android (bug 1266217, IPV6 is busted in try which causes timeouts in socket process case (bug 1521117))
+scheme=http
 [test_peerConnection_basicAudioNATRelay.html]
 skip-if = toolkit == 'android' || (verify && debug && (os == 'linux')) || socketprocess_e10s # websockets don't work on android (bug 1266217, IPV6 is busted in try which causes timeouts in socket process case (bug 1521117))
+scheme=http
 [test_peerConnection_basicAudioNATRelayTCP.html]
 skip-if = toolkit == 'android' || socketprocess_e10s # websockets don't work on android (bug 1266217, IPV6 is busted in try which causes timeouts in socket process case (bug 1521117))
+scheme=http
 [test_peerConnection_basicAudioNATRelayTLS.html]
 skip-if = true # need pyopenssl on builders, see bug 1323439 # toolkit == 'android' || socketprocess_e10s # websockets don't work on android (bug 1266217), IPV6 is busted in try which causes timeouts in socket process case (bug 1521117)
+scheme=http
 [test_peerConnection_basicAudioRequireEOC.html]
 skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_basicAudioPcmaPcmuOnly.html]
 skip-if = android_version == '18'
 [test_peerConnection_basicAudioDynamicPtMissingRtpmap.html]
 skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_basicAudioVerifyRtpHeaderExtensions.html]
 skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
@@ -168,45 +177,56 @@ skip-if = (android_version == '18') # an
 # frequent timeouts/crashes on e10s (bug 1048455)
 skip-if = toolkit == 'android' # no screenshare on android
 [test_peerConnection_basicWindowshare.html]
 # frequent timeouts/crashes on e10s (bug 1048455)
 skip-if = toolkit == 'android' # no screenshare on android
 [test_peerConnection_basicH264Video.html]
 skip-if = toolkit == 'android' # Bug 1043403, Bug 1355786, Bug 1149374
 [test_peerConnection_bug822674.html]
+scheme=http
 [test_peerConnection_bug825703.html]
+scheme=http
 [test_peerConnection_bug827843.html]
 skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_bug834153.html]
+scheme=http
 [test_peerConnection_bug1013809.html]
 skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_bug1042791.html]
 skip-if = toolkit == 'android' # Bug 1043403, Bug 1355786, Bug 1149374
 [test_peerConnection_capturedVideo.html]
 tags=capturestream
 skip-if = toolkit == 'android' # android(Bug 1189784, timeouts on 4.3 emulator), Bug 1264340
 [test_peerConnection_captureStream_canvas_2d.html]
 skip-if = android_version == '18' # android(Bug 1319019, timeouts on 4.3 emulator)
+scheme=http
 [test_peerConnection_captureStream_canvas_2d_noSSRC.html]
 skip-if = android_version == '18' # android(Bug 1319019, timeouts on 4.3 emulator)
+scheme=http
 [test_peerConnection_multiple_captureStream_canvas_2d.html]
 skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
+scheme=http
 [test_peerConnection_captureStream_canvas_webgl.html]
 # Cross process WebGL doesn't seem to work in the emulator
 skip-if = (toolkit == 'android' && e10s && is_emulator) || (android_version <= '17' || android_version == '18') # (<17: bug 1346630, 18: bug 1385950)
+scheme=http
 [test_peerConnection_certificates.html]
 disabled=bug 1180968
+scheme=http
 [test_peerConnection_close.html]
+scheme=http
 [test_peerConnection_closeDuringIce.html]
 [test_peerConnection_constructedStream.html]
 skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_errorCallbacks.html]
+scheme=http
 [test_peerConnection_iceFailure.html]
 skip-if = os == 'linux' || os == 'mac' || os == 'win' || toolkit == 'android' # (Bug 1180388 for win, mac and linux), android(Bug 1189784, timeouts on 4.3 emulator), Bug 1180388
+scheme=http
 [test_peerConnection_insertDTMF.html]
 skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_forwarding_basicAudioVideoCombined.html]
 skip-if = toolkit == 'android'  # Bug 1189784
 [test_peerConnection_maxFsConstraint.html]
 [test_peerConnection_noTrickleAnswer.html]
 skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_noTrickleOffer.html]
@@ -217,16 +237,17 @@ skip-if = (android_version == '18') # an
 skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_offerRequiresReceiveVideo.html]
 [test_peerConnection_offerRequiresReceiveVideoAudio.html]
 skip-if = toolkit == 'android' # android(Bug 1189784)
 [test_peerConnection_promiseSendOnly.html]
 skip-if = (android_version == '18') # android(Bug 1189784, 1318809 timeouts on 4.3 emulator)
 [test_peerConnection_renderAfterRenegotiation.html]
 skip-if = (android_version == '18') # android(Bug 1189784, 1326005 timeouts on 4.3 emulator)
+scheme=http
 [test_peerConnection_restartIce.html]
 skip-if = toolkit == 'android'
 [test_peerConnection_restartIceNoBundle.html]
 skip-if = toolkit == 'android'
 [test_peerConnection_restartIceNoBundleNoRtcpMux.html]
 skip-if = toolkit == 'android'
 [test_peerConnection_restartIceNoRtcpMux.html]
 skip-if = toolkit == 'android'
@@ -263,16 +284,17 @@ skip-if = android_version == '18' # andr
 skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_setParameters_scaleResolutionDownBy.html]
 skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_setRemoteAnswerInHaveRemoteOffer.html]
 [test_peerConnection_setRemoteAnswerInStable.html]
 [test_peerConnection_setRemoteOfferInHaveLocalOffer.html]
 [test_peerConnection_throwInCallbacks.html]
 [test_peerConnection_toJSON.html]
+scheme=http
 [test_peerConnection_trackDisabling_clones.html]
 skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_trackDisabling.html]
 skip-if = toolkit == 'android' # android(Bug 1189784, timeouts on 4.3 emulator), Bug 1265878
 [test_peerConnection_twoAudioStreams.html]
 skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_twoAudioTracksInOneStream.html]
 skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
@@ -326,39 +348,43 @@ skip-if = android_version == '18' # andr
 skip-if = toolkit == 'android' # android(Bug 1189784, timeouts on 4.3 emulator), android(Bug 1409203, failures on Autophone)
 [test_peerConnection_audioRenegotiationInactiveAnswer.html]
 skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_videoRenegotiationInactiveAnswer.html]
 skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_webAudio.html]
 tags = webaudio webrtc
 skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
+scheme=http
 [test_peerConnection_localRollback.html]
 skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_localReofferRollback.html]
 skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_remoteRollback.html]
 skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_remoteReofferRollback.html]
 skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_threeUnbundledConnections.html]
 skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_selftest.html]
 # Bug 1227781: Crash with bogus TURN server.
+scheme=http
 [test_peerConnection_bug1227781.html]
+scheme=http
 [test_peerConnection_stats.html]
 skip-if = toolkit == 'android' # android(Bug 1189784, timeouts on 4.3 emulator, Bug 1373858)
 [test_peerConnection_stats_relayProtocol.html]
 skip-if = toolkit == 'android' || socketprocess_e10s # android(Bug 1189784, timeouts on 4.3 emulator, Bug 1373858, Bug 1521117)
+scheme=http
 [test_peerConnection_sender_and_receiver_stats.html]
 skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_trackless_sender_stats.html]
 skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_verifyDescriptions.html]
 skip-if = (android_version == '18')
 [test_fingerprinting_resistance.html]
 [test_getUserMedia_nonDefaultRate.html]
 [test_peerConnection_nonDefaultRate.html]
 skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
 [test_forceSampleRate.html]
-
+scheme=http
 [test_setSinkId.html]
 skip-if = os != 'linux' # the only platform with real devices
--- a/dom/media/tests/mochitest/test_enumerateDevices.html
+++ b/dom/media/tests/mochitest/test_enumerateDevices.html
@@ -77,17 +77,17 @@ runTest(async () => {
                      () => gUM({ video: { deviceId: { exact: unknownId } } }));
   await mustFailWith("unknown exact deviceId on audio",
                      "OverconstrainedError", "deviceId",
                      () => gUM({ audio: { deviceId: { exact: unknownId } } }));
 
   // Check that deviceIds are stable for same origin and differ across origins.
 
   const path = "/tests/dom/media/tests/mochitest/test_enumerateDevices_iframe.html";
-  const origins = ["http://mochi.test:8888", "http://test1.mochi.test:8888"];
+  const origins = ["https://example.com", "https://test1.example.com"];
   info(window.location);
 
   let haveDevicesMap = new Promise(resolve => {
     let map = new Map();
     window.addEventListener("message", ({origin, data}) => {
       ok(origins.includes(origin), "Got message from expected origin");
       map.set(origin, JSON.parse(data));
       if (map.size < origins.length) return;
--- a/dom/media/tests/mochitest/test_enumerateDevices_iframe.html
+++ b/dom/media/tests/mochitest/test_enumerateDevices_iframe.html
@@ -9,15 +9,15 @@
 
 var pushPrefs = (...p) => SpecialPowers.pushPrefEnv({set: p});
 var gUM = c => navigator.mediaDevices.getUserMedia(c);
 
 (async () => {
   await pushPrefs(["media.navigator.streams.fake", true]);
 
   let devices = await navigator.mediaDevices.enumerateDevices();
-  parent.postMessage(JSON.stringify(devices), "http://mochi.test:8888");
+  parent.postMessage(JSON.stringify(devices), "https://example.com:443");
 
 })().catch(e => setTimeout(() => { throw e; }));
 </script>
 </pre>
 </body>
 </html>
--- a/dom/media/tests/mochitest/test_getUserMedia_permission.html
+++ b/dom/media/tests/mochitest/test_getUserMedia_permission.html
@@ -36,31 +36,31 @@ runTest(async () => {
       let message;
       let stream;
       try {
         stream = await gUM({ video: true });
         message = 'success';
       } catch(e) {
         message = e.name;
       }
-      parent.postMessage(message, 'http://mochi.test:8888');
+      parent.postMessage(message, 'https://example.com:443');
 
       if (message == "success") {
         stream.getTracks().forEach(track => track.stop());
       }
     } catch (e) {
       setTimeout(() => { throw e; });
     }
   }
 
   const source = `<html\><script\>(${sourceFn.toString()})()</script\></html\>`;
 
   // Test gUM in sandboxed vs. regular iframe.
 
-  for (const origin of ["http://mochi.test:8888", "http://test1.mochi.test:8888"]) {
+  for (const origin of ["https://example.com", "https://test1.example.com"]) {
     const src = origin + path;
     is(await iframeGum({ src, sandbox: "allow-scripts" }),
        "NotAllowedError", "gUM fails in sandboxed iframe " + origin);
     is(await iframeGum({ src, sandbox: "allow-scripts allow-same-origin " + origin }),
        "success", "gUM works in regular iframe");
   }
 
   // Test gUM in sandboxed vs regular srcdoc iframe
--- a/dom/media/tests/mochitest/test_getUserMedia_permission_iframe.html
+++ b/dom/media/tests/mochitest/test_getUserMedia_permission_iframe.html
@@ -13,17 +13,17 @@ const gUM = c => navigator.mediaDevices.
   let message;
   let stream;
   try {
     stream = await gUM({ video: true });
     message = "success";
   } catch(e) {
     message = e.name;
   }
-  parent.postMessage(message, "http://mochi.test:8888");
+  parent.postMessage(message, "https://example.com:443");
 
   if (message == "success") {
     stream.getTracks().forEach(track => track.stop());
   }
 })().catch(e => setTimeout(() => { throw e; }));
 </script>
 </pre>
 </body>
--- a/dom/media/tests/mochitest/test_peerConnection_basicAudioNATRelay.html
+++ b/dom/media/tests/mochitest/test_peerConnection_basicAudioNATRelay.html
@@ -7,38 +7,35 @@
 <body>
 <pre id="test">
 <script type="application/javascript">
   createHTML({
     bug: "1231975",
     title: "Basic audio-only peer connection with port dependent NAT"
   });
 
-  var test;
-  runNetworkTest(options => {
-    SpecialPowers.pushPrefEnv(
-      {
-        'set': [
-          ['media.peerconnection.nat_simulator.filtering_type', 'PORT_DEPENDENT'],
-          ['media.peerconnection.nat_simulator.mapping_type', 'PORT_DEPENDENT']
-        ]
-      }, function (options) {
-        options = options || {};
-        options.expectedLocalCandidateType = "srflx";
-        options.expectedRemoteCandidateType = "relay";
-        // If both have TURN, it is a toss-up which one will end up using a
-        // relay.
-        options.turn_disabled_local = true;
-        test = new PeerConnectionTest(options);
-        // Make sure we don't end up choosing the wrong thing due to delays in
-        // trickle. Once we are willing to accept trickle after ICE success, we
-        // can maybe wait a bit to allow things to stabilize.
-        // TODO(bug 1238249)
-        makeOffererNonTrickle(test.chain);
-        makeAnswererNonTrickle(test.chain);
-        test.setMediaConstraints([{audio: true}], [{audio: true}]);
-        test.run();
-      })
+  // This test uses the NAT simulator, which doesn't work in https, so we turn
+  // on getUserMedia in http.
+  runNetworkTest(async (options = {}) => {
+    await pushPrefs(
+        ['media.peerconnection.nat_simulator.filtering_type', 'PORT_DEPENDENT'],
+        ['media.peerconnection.nat_simulator.mapping_type', 'PORT_DEPENDENT'],
+        ['media.devices.insecure.enabled', true],
+        ['media.getusermedia.insecure.enabled', true]);
+    options.expectedLocalCandidateType = "srflx";
+    options.expectedRemoteCandidateType = "relay";
+    // If both have TURN, it is a toss-up which one will end up using a
+    // relay.
+    options.turn_disabled_local = true;
+    const test = new PeerConnectionTest(options);
+    // Make sure we don't end up choosing the wrong thing due to delays in
+    // trickle. Once we are willing to accept trickle after ICE success, we
+    // can maybe wait a bit to allow things to stabilize.
+    // TODO(bug 1238249)
+    makeOffererNonTrickle(test.chain);
+    makeAnswererNonTrickle(test.chain);
+    test.setMediaConstraints([{audio: true}], [{audio: true}]);
+    test.run();
   }, { useIceServer: true });
 </script>
 </pre>
 </body>
 </html>
--- a/dom/media/tests/mochitest/test_peerConnection_basicAudioNATRelayTCP.html
+++ b/dom/media/tests/mochitest/test_peerConnection_basicAudioNATRelayTCP.html
@@ -1,37 +1,34 @@
-<!DOCTYPE HTML>
+<!DOCTYPE HTML>
 <html>
 <head>
   <script type="application/javascript" src="pc.js"></script>
 </head>
 <body>
 <pre id="test">
 <script type="application/javascript">
   createHTML({
     bug: "1231975",
     title: "Basic audio-only peer connection with port dependent NAT that blocks UDP"
   });
 
-  var test;
-  runNetworkTest(options => {
-    SpecialPowers.pushPrefEnv(
-      {
-        'set': [
-          ['media.peerconnection.nat_simulator.filtering_type', 'PORT_DEPENDENT'],
-          ['media.peerconnection.nat_simulator.mapping_type', 'PORT_DEPENDENT'],
-          ['media.peerconnection.nat_simulator.block_udp', true]
-        ]
-      }, function (options) {
-        options = options || {};
-        options.expectedLocalCandidateType = "relay-tcp";
-        options.expectedRemoteCandidateType = "relay-tcp";
-        // No reason to wait for gathering to complete like the other NAT tests,
-        // since relayed-tcp is the only thing that can work.
-        test = new PeerConnectionTest(options);
-        test.setMediaConstraints([{audio: true}], [{audio: true}]);
-        test.run();
-      })
+  // This test uses the NAT simulator, which doesn't work in https, so we turn
+  // on getUserMedia in http.
+  runNetworkTest(async (options = {}) => {
+    await pushPrefs(
+        ['media.peerconnection.nat_simulator.filtering_type', 'PORT_DEPENDENT'],
+        ['media.peerconnection.nat_simulator.mapping_type', 'PORT_DEPENDENT'],
+        ['media.peerconnection.nat_simulator.block_udp', true],
+        ['media.devices.insecure.enabled', true],
+        ['media.getusermedia.insecure.enabled', true]);
+    options.expectedLocalCandidateType = "relay-tcp";
+    options.expectedRemoteCandidateType = "relay-tcp";
+    // No reason to wait for gathering to complete like the other NAT tests,
+    // since relayed-tcp is the only thing that can work.
+    const test = new PeerConnectionTest(options);
+    test.setMediaConstraints([{audio: true}], [{audio: true}]);
+    test.run();
   }, { useIceServer: true });
 </script>
 </pre>
 </body>
 </html>
--- a/dom/media/tests/mochitest/test_peerConnection_basicAudioNATRelayTLS.html
+++ b/dom/media/tests/mochitest/test_peerConnection_basicAudioNATRelayTLS.html
@@ -1,38 +1,35 @@
-<!DOCTYPE HTML>
+<!DOCTYPE HTML>
 <html>
 <head>
   <script type="application/javascript" src="pc.js"></script>
 </head>
 <body>
 <pre id="test">
 <script type="application/javascript">
   createHTML({
     bug: "1231975",
     title: "Basic audio-only peer connection with port dependent NAT that blocks STUN"
   });
 
-  var test;
-  runNetworkTest(options => {
-    SpecialPowers.pushPrefEnv(
-      {
-        'set': [
-          ['media.peerconnection.nat_simulator.filtering_type', 'PORT_DEPENDENT'],
-          ['media.peerconnection.nat_simulator.mapping_type', 'PORT_DEPENDENT'],
-          ['media.peerconnection.nat_simulator.block_udp', true],
-          ['media.peerconnection.nat_simulator.block_tcp', true]
-        ]
-      }, function (options) {
-        options = options || {};
-        options.expectedLocalCandidateType = "relay-tcp";
-        options.expectedRemoteCandidateType = "relay-tcp";
-        // No reason to wait for gathering to complete like the other NAT tests,
-        // since relayed-tcp is the only thing that can work.
-        test = new PeerConnectionTest(options);
-        test.setMediaConstraints([{audio: true}], [{audio: true}]);
-        test.run();
-      })
+  // This test uses the NAT simulator, which doesn't work in https, so we turn
+  // on getUserMedia in http.
+  runNetworkTest(async (options = {}) => {
+    await pushPrefs(
+        ['media.peerconnection.nat_simulator.filtering_type', 'PORT_DEPENDENT'],
+        ['media.peerconnection.nat_simulator.mapping_type', 'PORT_DEPENDENT'],
+        ['media.peerconnection.nat_simulator.block_udp', true],
+        ['media.peerconnection.nat_simulator.block_tcp', true],
+        ['media.devices.insecure.enabled', true],
+        ['media.getusermedia.insecure.enabled', true]);
+    options.expectedLocalCandidateType = "relay-tcp";
+    options.expectedRemoteCandidateType = "relay-tcp";
+    // No reason to wait for gathering to complete like the other NAT tests,
+    // since relayed-tcp is the only thing that can work.
+    const test = new PeerConnectionTest(options);
+    test.setMediaConstraints([{audio: true}], [{audio: true}]);
+    test.run();
   }, { useIceServer: true });
 </script>
 </pre>
 </body>
 </html>
--- a/dom/media/tests/mochitest/test_peerConnection_basicAudioNATSrflx.html
+++ b/dom/media/tests/mochitest/test_peerConnection_basicAudioNATSrflx.html
@@ -1,41 +1,38 @@
-<!DOCTYPE HTML>
+<!DOCTYPE HTML>
 <html>
 <head>
   <script type="application/javascript" src="nonTrickleIce.js"></script>
   <script type="application/javascript" src="pc.js"></script>
 </head>
 <body>
 <pre id="test">
 <script type="application/javascript">
   createHTML({
     bug: "1231975",
     title: "Basic audio-only peer connection with endpoint independent NAT"
   });
 
-  var test;
-  runNetworkTest(options => {
-    SpecialPowers.pushPrefEnv(
-      {
-        'set': [
-          ['media.peerconnection.nat_simulator.filtering_type', 'ENDPOINT_INDEPENDENT'],
-          ['media.peerconnection.nat_simulator.mapping_type', 'ENDPOINT_INDEPENDENT']
-        ]
-      }, function (options) {
-        options = options || {};
-        options.expectedLocalCandidateType = "srflx";
-        options.expectedRemoteCandidateType = "srflx";
-        test = new PeerConnectionTest(options);
-        // Make sure we don't end up choosing the wrong thing due to delays in
-        // trickle. Once we are willing to accept trickle after ICE success, we
-        // can maybe wait a bit to allow things to stabilize.
-        // TODO(bug 1238249)
-        makeOffererNonTrickle(test.chain);
-        makeAnswererNonTrickle(test.chain);
-        test.setMediaConstraints([{audio: true}], [{audio: true}]);
-        test.run();
-      })
+  // This test uses the NAT simulator in order to get srflx candidates.
+  // It doesn't work in https, so we turn on getUserMedia in http.
+  runNetworkTest(async (options = {}) => {
+    await pushPrefs(
+        ['media.peerconnection.nat_simulator.filtering_type', 'ENDPOINT_INDEPENDENT'],
+        ['media.peerconnection.nat_simulator.mapping_type', 'ENDPOINT_INDEPENDENT'],
+        ['media.devices.insecure.enabled', true],
+        ['media.getusermedia.insecure.enabled', true]);
+    options.expectedLocalCandidateType = "srflx";
+    options.expectedRemoteCandidateType = "srflx";
+    const test = new PeerConnectionTest(options);
+    // Make sure we don't end up choosing the wrong thing due to delays in
+    // trickle. Once we are willing to accept trickle after ICE success, we
+    // can maybe wait a bit to allow things to stabilize.
+    // TODO(bug 1238249)
+    makeOffererNonTrickle(test.chain);
+    makeAnswererNonTrickle(test.chain);
+    test.setMediaConstraints([{audio: true}], [{audio: true}]);
+    test.run();
   }, { useIceServer: true });
 </script>
 </pre>
 </body>
 </html>
--- a/dom/media/tests/mochitest/test_peerConnection_stats_relayProtocol.html
+++ b/dom/media/tests/mochitest/test_peerConnection_stats_relayProtocol.html
@@ -25,32 +25,30 @@ var PC_LOCAL_TEST_LOCAL_STATS_RELAYCANDI
     ok(haveRelayProtocol["relay-tcp"], "Has TCP relay candidate");
     // TURN/TLS does not work, see https://bugzilla.mozilla.org/show_bug.cgi?id=1323439
     // With TURN/TLS working, we should have exactly five entries in haveRelayProtocol.
     todo(haveRelayProtocol["relay-tls"], "Has TLS relay candidate. See https://bugzilla.mozilla.org/show_bug.cgi?id=1323439");
     is(Object.keys(haveRelayProtocol).length, 4, "All candidate types are accounted for");
   });
 }
 
-runNetworkTest(options => {
-  // uses NAT simulator in order to get srflx candidates.
-  SpecialPowers.pushPrefEnv(
-    {
-      'set': [
-        ['media.peerconnection.nat_simulator.filtering_type', 'ENDPOINT_INDEPENDENT'],
-        ['media.peerconnection.nat_simulator.mapping_type', 'ENDPOINT_INDEPENDENT']
-      ]
-    }, function (options) {
-      const test = new PeerConnectionTest(options);
-      makeOffererNonTrickle(test.chain);
-      makeAnswererNonTrickle(test.chain);
+// This test uses the NAT simulator in order to get srflx candidates.
+// It doesn't work in https, so we turn on getUserMedia in http.
+runNetworkTest(async (options = {}) => {
+  await pushPrefs(
+      ['media.peerconnection.nat_simulator.filtering_type', 'ENDPOINT_INDEPENDENT'],
+      ['media.peerconnection.nat_simulator.mapping_type', 'ENDPOINT_INDEPENDENT'],
+      ['media.devices.insecure.enabled', true],
+      ['media.getusermedia.insecure.enabled', true]);
+  const test = new PeerConnectionTest(options);
+  makeOffererNonTrickle(test.chain);
+  makeAnswererNonTrickle(test.chain);
 
-      test.chain.removeAfter("PC_LOCAL_WAIT_FOR_MEDIA_FLOW");
-      test.chain.append([PC_LOCAL_TEST_LOCAL_STATS_RELAYCANDIDATE]);
+  test.chain.removeAfter("PC_LOCAL_WAIT_FOR_MEDIA_FLOW");
+  test.chain.append([PC_LOCAL_TEST_LOCAL_STATS_RELAYCANDIDATE]);
 
-      test.setMediaConstraints([{ audio: true }], [{ audio: true }]);
-      test.run();
-    })
+  test.setMediaConstraints([{ audio: true }], [{ audio: true }]);
+  test.run();
 }, { useIceServer: true });
 </script>
 </pre>
 </body>
 </html>
--- a/dom/media/webaudio/test/mochitest.ini
+++ b/dom/media/webaudio/test/mochitest.ini
@@ -185,16 +185,17 @@ skip-if = toolkit == 'android' # bug 133
 [test_mediaElementAudioSourceNodeCrossOrigin.html]
 tags=capturestream
 skip-if = toolkit == 'android' # bug 1145816
 [test_mediaStreamAudioDestinationNode.html]
 [test_mediaStreamAudioSourceNode.html]
 [test_mediaStreamAudioSourceNodeCrossOrigin.html]
 tags=capturestream
 [test_mediaStreamAudioSourceNodeNoGC.html]
+scheme=https
 [test_mediaStreamAudioSourceNodePassThrough.html]
 [test_mediaStreamAudioSourceNodeResampling.html]
 tags=capturestream
 [test_mixingRules.html]
 skip-if = toolkit == 'android' # bug 1091965
 [test_nodeToParamConnection.html]
 [test_nodeCreationDocumentGone.html]
 [test_notAllowedToStartAudioContextGC.html]
rename from testing/web-platform/meta/mediacapture-streams/MediaDevices-getSupportedConstraints.html.ini
rename to testing/web-platform/meta/mediacapture-streams/MediaDevices-getSupportedConstraints.https.html.ini
--- a/testing/web-platform/meta/mediacapture-streams/MediaDevices-getSupportedConstraints.html.ini
+++ b/testing/web-platform/meta/mediacapture-streams/MediaDevices-getSupportedConstraints.https.html.ini
@@ -1,9 +1,9 @@
-[MediaDevices-getSupportedConstraints.html]
+[MediaDevices-getSupportedConstraints.https.html]
   [sampleSize is supported]
     expected: FAIL
 
   [aspectRatio is supported]
     expected: FAIL
 
   [latency is supported]
     expected: FAIL
--- a/testing/web-platform/tests/mediacapture-streams/MediaDevices-SecureContext.html
+++ b/testing/web-platform/tests/mediacapture-streams/MediaDevices-SecureContext.html
@@ -5,15 +5,16 @@
 <script src=/resources/testharness.js></script>
 <script src=/resources/testharnessreport.js></script>
 </head>
 <body>
 <script>
 
 assert_false(window.isSecureContext, "This test must be run in a non secure context");
 assert_false('MediaDevices' in window, "MediaDevices is not exposed");
+assert_false('MediaDeviceInfo' in window, "MediaDeviceInfo is not exposed");
 assert_false('getUserMedia' in navigator, "getUserMedia is not exposed");
 assert_false('mediaDevices' in navigator, "mediaDevices is not exposed");
 
 done();
 </script>
 </body>
 </html>
rename from testing/web-platform/tests/mediacapture-streams/MediaDevices-getSupportedConstraints.html
rename to testing/web-platform/tests/mediacapture-streams/MediaDevices-getSupportedConstraints.https.html