Adding a runtime flag specific to MediaDevices
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Apr 2017 20:42:40 +0000 (20:42 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 28 Apr 2017 20:42:40 +0000 (20:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=171433

Patch by Youenn Fablet <youenn@apple.com> on 2017-04-28
Reviewed by Geoffrey Garen.

Source/WebCore:

Covered by existing tests.

Adding a preference for MediaDevices.
Setting media devices runtime flag to false by default.
Setting peer connection and media stream flags to true by default.
Activating mediaDevices and getUserMedia Navigator properties based on media devices flag.

* Modules/mediastream/NavigatorMediaDevices.idl:
* Modules/mediastream/NavigatorUserMedia.idl:
* page/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::mediaDevicesEnabled):
(WebCore::RuntimeEnabledFeatures::setMediaDevicesEnabled):

Source/WebKit/mac:

Adding a preference for MediaDevices.
Setting media devices runtime flag to false by default.
Setting peer connection and media stream flags to true by default.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences mediaDevicesEnabled]):
(-[WebPreferences setMediaDevicesEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

Adding a preference for MediaDevices.
Setting media devices runtime flag to false by default.
Setting peer connection and media stream flags to true by default.
Sending microphone sandbox extension based on media devices and not media stream flag.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetMediaDevicesEnabled):
(WKPreferencesGetMediaDevicesEnabled):
* UIProcess/API/C/WKPreferencesRef.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

Updating WTR and DRT as peer connection and media stream runtime flags are enabled by default.
Setting media devices runtime flag to true for WTR and DRT.

* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):
(resetWebPreferencesToConsistentValues):
* TestWebKitAPI/Tests/WebKit2/EnumerateMediaDevices.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2/UserMedia.cpp:
(TestWebKitAPI::TEST):
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setMediaDevicesEnabled):
(WTR::TestRunner::setMediaStreamEnabled): Deleted.
(WTR::TestRunner::setPeerConnectionEnabled): Deleted.
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215939 268f45cc-cd09-0410-ab3c-d52691b4dbfc

25 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/NavigatorMediaDevices.idl
Source/WebCore/Modules/mediastream/NavigatorUserMedia.idl
Source/WebCore/page/RuntimeEnabledFeatures.cpp
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKit/mac/WebView/WebPreferences.mm
Source/WebKit/mac/WebView/WebPreferencesPrivate.h
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPreferencesDefinitions.h
Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
Source/WebKit2/UIProcess/API/C/WKPreferencesRef.h
Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/TestWebKitAPI/Tests/WebKit2/EnumerateMediaDevices.cpp
Tools/TestWebKitAPI/Tests/WebKit2/UserMedia.cpp
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
Tools/WebKitTestRunner/TestController.cpp

index 3244279..4879511 100644 (file)
@@ -1,3 +1,25 @@
+2017-04-28  Youenn Fablet  <youenn@apple.com>
+
+        Adding a runtime flag specific to MediaDevices
+        https://bugs.webkit.org/show_bug.cgi?id=171433
+
+        Reviewed by Geoffrey Garen.
+
+        Covered by existing tests.
+
+        Adding a preference for MediaDevices.
+        Setting media devices runtime flag to false by default.
+        Setting peer connection and media stream flags to true by default.
+        Activating mediaDevices and getUserMedia Navigator properties based on media devices flag.
+
+        * Modules/mediastream/NavigatorMediaDevices.idl:
+        * Modules/mediastream/NavigatorUserMedia.idl:
+        * page/RuntimeEnabledFeatures.cpp:
+        (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
+        * page/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::mediaDevicesEnabled):
+        (WebCore::RuntimeEnabledFeatures::setMediaDevicesEnabled):
+
 2017-04-28  Eric Carlson  <eric.carlson@apple.com>
 
         Implement ondevicechange
index 4287ce0..beeb65c 100644 (file)
@@ -30,7 +30,7 @@
 
 [
     Conditional=MEDIA_STREAM,
-    EnabledAtRuntime=MediaStream,
+    EnabledAtRuntime=MediaDevices,
 ] partial interface Navigator {
     // FIXME: missing [SameObject]
     readonly attribute MediaDevices mediaDevices;
index f5ad26c..5d86f3c 100644 (file)
@@ -30,7 +30,7 @@
 
 [
     Conditional=MEDIA_STREAM&WEB_RTC,
-    EnabledAtRuntime=WebRTCLegacyAPI&MediaStream,
+    EnabledAtRuntime=WebRTCLegacyAPI&MediaDevices,
 ] partial interface Navigator {
     [JSBuiltin] void getUserMedia(MediaStreamConstraints constraints, NavigatorUserMediaSuccessCallback successCallback, NavigatorUserMediaErrorCallback errorCallback);
 };
index 890c07b..1bc7648 100644 (file)
@@ -40,7 +40,7 @@ namespace WebCore {
 RuntimeEnabledFeatures::RuntimeEnabledFeatures()
 {
 #if ENABLE(MEDIA_STREAM) && PLATFORM(COCOA)
-    m_isMediaStreamEnabled = false;
+    m_isMediaDevicesEnabled = false;
 #endif
 }
 
index 3a130a8..61811e4 100644 (file)
@@ -89,6 +89,8 @@ public:
 #endif
 
 #if ENABLE(MEDIA_STREAM)
+    bool mediaDevicesEnabled() const { return m_isMediaDevicesEnabled; }
+    void setMediaDevicesEnabled(bool isEnabled) { m_isMediaDevicesEnabled = isEnabled; }
     bool mediaStreamEnabled() const { return m_isMediaStreamEnabled; }
     void setMediaStreamEnabled(bool isEnabled) { m_isMediaStreamEnabled = isEnabled; }
 #endif
@@ -235,6 +237,7 @@ private:
 #endif
 
 #if ENABLE(MEDIA_STREAM)
+    bool m_isMediaDevicesEnabled { false };
     bool m_isMediaStreamEnabled { true };
 #endif
 
index 49f6a3e..96bb5f0 100644 (file)
@@ -1,3 +1,23 @@
+2017-04-28  Youenn Fablet  <youenn@apple.com>
+
+        Adding a runtime flag specific to MediaDevices
+        https://bugs.webkit.org/show_bug.cgi?id=171433
+
+        Reviewed by Geoffrey Garen.
+
+        Adding a preference for MediaDevices.
+        Setting media devices runtime flag to false by default.
+        Setting peer connection and media stream flags to true by default.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        (-[WebPreferences mediaDevicesEnabled]):
+        (-[WebPreferences setMediaDevicesEnabled:]):
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2017-04-27  Chris Dumez  <cdumez@apple.com>
 
         Align colspan/rowspan limits with the latest HTML specification
index 8c4c6f4..a1aa2de 100644 (file)
 #define WebKitVisualViewportEnabledPreferenceKey @"WebKitVisualViewportEnabled"
 #define WebKitModernMediaControlsEnabledPreferenceKey @"WebKitModernMediaControlsEnabled"
 #define WebKitSubtleCryptoEnabledPreferenceKey @"WebKitSubtleCryptoEnabled"
+#define WebKitMediaDevicesEnabledPreferenceKey @"WebKitMediaDevicesEnabled"
 #define WebKitMediaStreamEnabledPreferenceKey @"WebKitMediaStreamEnabled"
 #define WebKitPeerConnectionEnabledPreferenceKey @"WebKitPeerConnectionEnabled"
 #define WebKitWebRTCLegacyAPIEnabledPreferenceKey @"WebKitWebRTCLegacyAPIEnabled"
index b183baf..7749ac6 100644 (file)
@@ -656,11 +656,12 @@ public:
         [NSNumber numberWithBool:YES], WebKitSubtleCryptoEnabledPreferenceKey,
 #endif
 #if ENABLE(MEDIA_STREAM)
-        [NSNumber numberWithBool:NO], WebKitMediaStreamEnabledPreferenceKey,
+        [NSNumber numberWithBool:NO], WebKitMediaDevicesEnabledPreferenceKey,
+        [NSNumber numberWithBool:YES], WebKitMediaStreamEnabledPreferenceKey,
 #endif
 #if ENABLE(WEB_RTC)
-        [NSNumber numberWithBool:NO], WebKitPeerConnectionEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO], WebKitWebRTCLegacyAPIEnabledPreferenceKey,
+        [NSNumber numberWithBool:YES], WebKitPeerConnectionEnabledPreferenceKey,
+        [NSNumber numberWithBool:YES], WebKitWebRTCLegacyAPIEnabledPreferenceKey,
 #endif
 #if ENABLE(INTERSECTION_OBSERVER)
         @NO, WebKitIntersectionObserverEnabledPreferenceKey,
@@ -2761,6 +2762,16 @@ static NSString *classIBCreatorID = nil;
     [self _setBoolValue:flag forKey:WebKitSubtleCryptoEnabledPreferenceKey];
 }
 
+- (BOOL)mediaDevicesEnabled
+{
+    return [self _boolValueForKey:WebKitMediaDevicesEnabledPreferenceKey];
+}
+
+- (void)setMediaDevicesEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitMediaDevicesEnabledPreferenceKey];
+}
+
 - (BOOL)mediaStreamEnabled
 {
     return [self _boolValueForKey:WebKitMediaStreamEnabledPreferenceKey];
index 7eb53f7..ef5efc9 100644 (file)
@@ -162,6 +162,9 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification;
 - (void)setSubtleCryptoEnabled:(BOOL)flag;
 - (BOOL)subtleCryptoEnabled;
 
+- (void)setMediaDevicesEnabled:(BOOL)flag;
+- (BOOL)mediaDevicesEnabled;
+
 - (void)setMediaStreamEnabled:(BOOL)flag;
 - (BOOL)mediaStreamEnabled;
 
index a8c91e0..b36f3d0 100644 (file)
@@ -2979,6 +2979,7 @@ static bool needsSelfRetainWhileLoadingQuirk()
     settings.setMediaCaptureRequiresSecureConnection([preferences mediaCaptureRequiresSecureConnection]);
     RuntimeEnabledFeatures::sharedFeatures().setMediaStreamEnabled([preferences mediaStreamEnabled]);
     settings.setUseAVFoundationAudioCapture([preferences useAVFoundationAudioCapture]);
+    RuntimeEnabledFeatures::sharedFeatures().setMediaDevicesEnabled([preferences mediaDevicesEnabled]);
 #endif
 
 #if ENABLE(WEB_RTC)
index ecdbb51..11310b5 100644 (file)
@@ -1,3 +1,29 @@
+2017-04-28  Youenn Fablet  <youenn@apple.com>
+
+        Adding a runtime flag specific to MediaDevices
+        https://bugs.webkit.org/show_bug.cgi?id=171433
+
+        Reviewed by Geoffrey Garen.
+
+        Adding a preference for MediaDevices.
+        Setting media devices runtime flag to false by default.
+        Setting peer connection and media stream flags to true by default.
+        Sending microphone sandbox extension based on media devices and not media stream flag.
+
+        * Shared/WebPreferencesDefinitions.h:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetMediaDevicesEnabled):
+        (WKPreferencesGetMediaDevicesEnabled):
+        * UIProcess/API/C/WKPreferencesRef.h:
+        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+        (WebKit::WebProcessPool::platformInitializeWebProcess):
+        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
+        (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+
 2017-04-28  Brady Eidson  <beidson@apple.com>
 
         Teach WebProcessPool to track a map of SessionIDs to WebPageProxys to manage their lifetime
index 96bba5d..263c852 100644 (file)
     macro(SimpleLineLayoutEnabled, simpleLineLayoutEnabled, Bool, bool, true, "", "") \
     macro(SubpixelCSSOMElementMetricsEnabled, subpixelCSSOMElementMetricsEnabled, Bool, bool, false, "", "") \
     macro(UseGiantTiles, useGiantTiles, Bool, bool, false, "", "") \
-    macro(MediaStreamEnabled, mediaStreamEnabled, Bool, bool, false, "", "") \
+    macro(MediaDevicesEnabled, mediaDevicesEnabled, Bool, bool, false, "", "") \
+    macro(MediaStreamEnabled, mediaStreamEnabled, Bool, bool, true, "", "") \
     macro(PeerConnectionEnabled, peerConnectionEnabled, Bool, bool, WebCore::LibWebRTCProvider::webRTCAvailable(), "", "") \
     macro(UseLegacyTextAlignPositionedElementBehavior, useLegacyTextAlignPositionedElementBehavior, Bool, bool, false, "", "") \
     macro(SpatialNavigationEnabled, spatialNavigationEnabled, Bool, bool, false, "", "") \
index 2a607af..9542e0f 100644 (file)
@@ -1341,6 +1341,16 @@ bool WKPreferencesGetUseGiantTiles(WKPreferencesRef preferencesRef)
     return toImpl(preferencesRef)->useGiantTiles();
 }
 
+void WKPreferencesSetMediaDevicesEnabled(WKPreferencesRef preferencesRef, bool enabled)
+{
+    toImpl(preferencesRef)->setMediaDevicesEnabled(enabled);
+}
+
+bool WKPreferencesGetMediaDevicesEnabled(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)->mediaDevicesEnabled();
+}
+
 void WKPreferencesSetMediaStreamEnabled(WKPreferencesRef preferencesRef, bool enabled)
 {
     toImpl(preferencesRef)->setMediaStreamEnabled(enabled);
index 5cb6122..2c85460 100644 (file)
@@ -252,11 +252,15 @@ WK_EXPORT bool WKPreferencesGetQTKitEnabled(WKPreferencesRef preferencesRef);
 WK_EXPORT void WKPreferencesSetAsynchronousSpellCheckingEnabled(WKPreferencesRef preferencesRef, bool enabled);
 WK_EXPORT bool WKPreferencesGetAsynchronousSpellCheckingEnabled(WKPreferencesRef preferencesRef);
 
-// Defaults to false
+// Defaults to true
 WK_EXPORT void WKPreferencesSetMediaStreamEnabled(WKPreferencesRef preferencesRef, bool enabled);
 WK_EXPORT bool WKPreferencesGetMediaStreamEnabled(WKPreferencesRef preferencesRef);
 
 // Defaults to false
+WK_EXPORT void WKPreferencesSetMediaDevicesEnabled(WKPreferencesRef preferencesRef, bool enabled);
+WK_EXPORT bool WKPreferencesGetMediaDevicesEnabled(WKPreferencesRef preferencesRef);
+
+// Defaults to true
 WK_EXPORT void WKPreferencesSetPeerConnectionEnabled(WKPreferencesRef preferencesRef, bool enabled);
 WK_EXPORT bool WKPreferencesGetPeerConnectionEnabled(WKPreferencesRef preferencesRef);
 
index 34f524c..b27ccea 100644 (file)
@@ -249,13 +249,13 @@ void WebProcessPool::platformInitializeWebProcess(WebProcessCreationParameters&
 #endif
 #if ENABLE(MEDIA_STREAM)
     // Allow microphone access if either preference is set because WebRTC requires microphone access.
-    bool mediaStreamEnabled = m_defaultPageGroup->preferences().mediaStreamEnabled();
+    bool mediaDevicesEnabled = m_defaultPageGroup->preferences().mediaDevicesEnabled();
     bool webRTCEnabled = m_defaultPageGroup->preferences().peerConnectionEnabled();
     if ([defaults objectForKey:@"ExperimentalPeerConnectionEnabled"])
         webRTCEnabled = [defaults boolForKey:@"ExperimentalPeerConnectionEnabled"];
     
     // FIXME: Remove this and related parameter when <rdar://problem/29448368> is fixed.
-    if (!parameters.shouldCaptureAudioInUIProcess && (mediaStreamEnabled || webRTCEnabled))
+    if (!parameters.shouldCaptureAudioInUIProcess && (mediaDevicesEnabled || webRTCEnabled))
         SandboxExtension::createHandleForGenericExtension("com.apple.webkit.microphone", parameters.audioCaptureExtensionHandle);
 #endif
 }
index cc571df..c44a808 100644 (file)
@@ -221,13 +221,11 @@ void InjectedBundle::overrideBoolPreferenceForTestRunner(WebPageGroupProxy* page
 #endif
 
 #if ENABLE(MEDIA_STREAM)
-    if (preference == "WebKitMediaStreamEnabled")
-        RuntimeEnabledFeatures::sharedFeatures().setMediaStreamEnabled(enabled);
+    if (preference == "WebKitMediaDevicesEnabled")
+        RuntimeEnabledFeatures::sharedFeatures().setMediaDevicesEnabled(enabled);
 #endif
 
 #if ENABLE(WEB_RTC)
-    if (preference == "WebKitPeerConnectionEnabled")
-        RuntimeEnabledFeatures::sharedFeatures().setPeerConnectionEnabled(enabled);
     if (preference == "WebKitWebRTCLegacyAPIEnabled")
         RuntimeEnabledFeatures::sharedFeatures().setWebRTCLegacyAPIEnabled(enabled);
 #endif
index 7aaa244..b399804 100644 (file)
@@ -3165,6 +3165,7 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
 #endif
 
 #if ENABLE(MEDIA_STREAM)
+    RuntimeEnabledFeatures::sharedFeatures().setMediaDevicesEnabled(store.getBoolValueForKey(WebPreferencesKey::mediaDevicesEnabledKey()));
     RuntimeEnabledFeatures::sharedFeatures().setMediaStreamEnabled(store.getBoolValueForKey(WebPreferencesKey::mediaStreamEnabledKey()));
 #endif
 
index e78eaef..6a151a9 100644 (file)
@@ -1,3 +1,30 @@
+2017-04-28  Youenn Fablet  <youenn@apple.com>
+
+        Adding a runtime flag specific to MediaDevices
+        https://bugs.webkit.org/show_bug.cgi?id=171433
+
+        Reviewed by Geoffrey Garen.
+
+        Updating WTR and DRT as peer connection and media stream runtime flags are enabled by default.
+        Setting media devices runtime flag to true for WTR and DRT.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (enableExperimentalFeatures):
+        (resetWebPreferencesToConsistentValues):
+        * TestWebKitAPI/Tests/WebKit2/EnumerateMediaDevices.cpp:
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WebKit2/UserMedia.cpp:
+        (TestWebKitAPI::TEST):
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+        (WTR::InjectedBundle::beginTesting):
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+        (WTR::TestRunner::setMediaDevicesEnabled):
+        (WTR::TestRunner::setMediaStreamEnabled): Deleted.
+        (WTR::TestRunner::setPeerConnectionEnabled): Deleted.
+        * WebKitTestRunner/InjectedBundle/TestRunner.h:
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::resetPreferencesToConsistentValues):
+
 2017-04-28  Dean Jackson  <dino@apple.com>
 
         [WebGPU] Label MTLCommandQueues with a prefix for internal telemetry
index a27f86c..a1465e4 100644 (file)
@@ -849,7 +849,6 @@ static void enableExperimentalFeatures(WebPreferences* preferences)
     [preferences setWebAnimationsEnabled:YES];
     [preferences setWebGL2Enabled:YES];
     [preferences setWebGPUEnabled:YES];
-    [preferences setPeerConnectionEnabled:YES];
     [preferences setWebRTCLegacyAPIEnabled:YES];
     [preferences setCredentialManagementEnabled:YES];
     [preferences setReadableByteStreamAPIEnabled:YES];
@@ -952,15 +951,13 @@ static void resetWebPreferencesToConsistentValues()
     [preferences setWebGL2Enabled:YES];
     [preferences setWebGPUEnabled:YES];
 
-    [preferences setFetchAPIEnabled:YES];
-
     [preferences setDownloadAttributeEnabled:YES];
 
     [preferences setHiddenPageDOMTimerThrottlingEnabled:NO];
     [preferences setHiddenPageCSSAnimationSuspensionEnabled:NO];
-    
-    [preferences setMediaStreamEnabled:YES];
-    
+
+    [preferences setMediaDevicesEnabled:YES];
+
     [preferences setLargeImageAsyncDecodingEnabled:NO];
 
     [WebPreferences _clearNetworkLoaderSession];
index 0ac7d0f..f92fb1e 100644 (file)
@@ -53,7 +53,7 @@ TEST(WebKit2, EnumerateDevices)
 
     WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(Util::toWK("EnumerateDevices").get()));
     WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get());
-    WKPreferencesSetMediaStreamEnabled(preferences, true);
+    WKPreferencesSetMediaDevicesEnabled(preferences, true);
     WKPreferencesSetFileAccessFromFileURLsAllowed(preferences, true);
     WKPreferencesSetMediaCaptureRequiresSecureConnection(preferences, false);
 
index 7bca8ff..88a2380 100644 (file)
@@ -66,7 +66,7 @@ TEST(WebKit2, UserMediaBasic)
 
     WKRetainPtr<WKPageGroupRef> pageGroup(AdoptWK, WKPageGroupCreateWithIdentifier(Util::toWK("GetUserMedia").get()));
     WKPreferencesRef preferences = WKPageGroupGetPreferences(pageGroup.get());
-    WKPreferencesSetMediaStreamEnabled(preferences, true);
+    WKPreferencesSetMediaDevicesEnabled(preferences, true);
     WKPreferencesSetFileAccessFromFileURLsAllowed(preferences, true);
     WKPreferencesSetMediaCaptureRequiresSecureConnection(preferences, false);
     WKPreferencesSetMockCaptureDevicesEnabled(preferences, true);
index 5d18c38..f9f5ebc 100644 (file)
@@ -339,10 +339,6 @@ void InjectedBundle::beginTesting(WKDictionaryRef settings)
 
     m_testRunner->setSubtleCryptoEnabled(true);
 
-    m_testRunner->setMediaStreamEnabled(true);
-    m_testRunner->setPeerConnectionEnabled(true);
-    m_testRunner->setWebRTCLegacyAPIEnabled(true);
-
     if (m_timeout > 0)
         m_testRunner->setCustomTimeout(m_timeout);
 
index c71f4cf..e16b3df 100644 (file)
@@ -353,16 +353,9 @@ void TestRunner::setSubtleCryptoEnabled(bool enabled)
     WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
 }
 
-void TestRunner::setMediaStreamEnabled(bool enabled)
+void TestRunner::setMediaDevicesEnabled(bool enabled)
 {
-    WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitMediaStreamEnabled"));
-    auto& injectedBundle = InjectedBundle::singleton();
-    WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
-}
-
-void TestRunner::setPeerConnectionEnabled(bool enabled)
-{
-    WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitPeerConnectionEnabled"));
+    WKRetainPtr<WKStringRef> key(AdoptWK, WKStringCreateWithUTF8CString("WebKitMediaDevicesEnabled"));
     auto& injectedBundle = InjectedBundle::singleton();
     WKBundleOverrideBoolPreferenceForTestRunner(injectedBundle.bundle(), injectedBundle.pageGroup(), key.get(), enabled);
 }
index d6392e9..44785c5 100644 (file)
@@ -128,8 +128,7 @@ public:
     void setAllowsAnySSLCertificate(bool);
     void setEncryptedMediaAPIEnabled(bool);
     void setSubtleCryptoEnabled(bool);
-    void setMediaStreamEnabled(bool);
-    void setPeerConnectionEnabled(bool);
+    void setMediaDevicesEnabled(bool);
     void setWebRTCLegacyAPIEnabled(bool);
 
     // Special DOM functions.
index 47a17e0..b096572 100644 (file)
@@ -656,7 +656,8 @@ void TestController::resetPreferencesToConsistentValues(const TestOptions& optio
     WKPreferencesSetSubpixelAntialiasedLayerTextEnabled(preferences, false);
     WKPreferencesSetXSSAuditorEnabled(preferences, false);
     WKPreferencesSetWebAudioEnabled(preferences, true);
-    WKPreferencesSetMediaStreamEnabled(preferences, true);
+    WKPreferencesSetMediaDevicesEnabled(preferences, true);
+    WKPreferencesSetWebRTCLegacyAPIEnabled(preferences, true);
     WKPreferencesSetDeveloperExtrasEnabled(preferences, true);
     WKPreferencesSetJavaScriptRuntimeFlags(preferences, kWKJavaScriptRuntimeFlagsAllEnabled);
     WKPreferencesSetJavaScriptCanOpenWindowsAutomatically(preferences, true);