Make AVFoundationEnabled preference available on iOS
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Mar 2018 11:39:53 +0000 (11:39 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Mar 2018 11:39:53 +0000 (11:39 +0000)
commitefd180b0ef9fe8ff9669dedcf96c25a7b4e09bc2
tree0aefd894b509240878703dcc30ed2bb6106affc6
parente045045215564c01cfbbcbea9a5fef9342ba095b
Make AVFoundationEnabled preference available on iOS
https://bugs.webkit.org/show_bug.cgi?id=183876
<rdar://problem/38726459>

Reviewed by Youenn Fablet.

Source/WebCore:

Test: AVFoundationPref API test.

* html/HTMLAudioElement.idl: There is no need for a runtime setting to enable/disable audio,
there is already settings.mediaEnabled.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::prepareForLoad): Fail if there are no media engines registered.
(WebCore::HTMLMediaElement::noneSupported): Return early if m_error has already been set.
(WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Remove a typo.

* page/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::audioEnabled const): Deleted.
* page/RuntimeEnabledFeatures.h:

Source/WebKit:

* Shared/WebPreferences.yaml: Set AVFoundationEnabled with DEFAULT_AVFOUNDATION_ENABLED.
* Shared/WebPreferencesDefaultValues.h:

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setAVFoundationEnabled:]): Enable for iOS.
(-[WKPreferences _avFoundationEnabled]): Ditto.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/video.html: Added.
* TestWebKitAPI/Tests/WebKitCocoa/AVFoundationPreference.mm: Added.
(-[PreferenceTestMessageHandler userContentController:didReceiveScriptMessage:]):
(TestWebKitAPI::AVFoundationPref::SetUp):
(TestWebKitAPI::AVFoundationPref::testWithPreference):
(TestWebKitAPI::TEST_F):

LayoutTests:

* media/media-error-fired-once-expected.txt: Added.
* media/media-error-fired-once.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229995 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
LayoutTests/ChangeLog
LayoutTests/media/media-error-fired-once-expected.txt [new file with mode: 0644]
LayoutTests/media/media-error-fired-once.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLAudioElement.idl
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/page/RuntimeEnabledFeatures.cpp
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKit/Shared/WebPreferencesDefaultValues.h
Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm
Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKit/video.html [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKitCocoa/AVFoundationPreference.mm [new file with mode: 0644]