haikuwebkit/LayoutTests/plugins/unsupported-plugin-expected...

8 lines
162 B
Plaintext
Raw Permalink Normal View History

Allow specifying which plug-ins are supported https://bugs.webkit.org/show_bug.cgi?id=182748 Patch by Youenn Fablet <youenn@apple.com> on 2018-02-16 Reviewed by Chris Dumez. Source/WebCore: Tests: http/tests/plugins/nounsupported-plugin.html http/tests/plugins/supported-plugin-all-origin-visibility.html http/tests/plugins/supported-plugin-on-specific-origin.html http/tests/plugins/supported-plugin-origin-specific-visibility.html http/tests/plugins/unsupported-plugin-on-specific-origin.html plugins/unsupported-plugin.html Added support for computing plugin web visibility with the added knowledge of supported plugins. In case of a plugin failing to be created due to being unsupported, update the UI to use mark the plugin as "Unexpected plug in". Added internal API to retrieve the plug-in error description message. * English.lproj/Localizable.strings: * WebCore.xcodeproj/project.pbxproj: * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::setReplacement): * html/HTMLPlugInElement.h: * loader/EmptyClients.cpp: * platform/LocalizedStrings.cpp: (WebCore::unsupportedPluginText): * platform/LocalizedStrings.h: * plugins/PluginData.cpp: (WebCore::PluginData::initPlugins): * plugins/PluginData.h: (WebCore::decodePluginNames): (WebCore::encodePluginNames): (WebCore::SupportedPluginNames::decode): (WebCore::SupportedPluginNames::encode const): * plugins/PluginInfoProvider.h: * rendering/RenderEmbeddedObject.cpp: (WebCore::unavailablePluginReplacementText): * rendering/RenderEmbeddedObject.h: (WebCore::RenderEmbeddedObject::pluginReplacementTextIfUnavailable const): * testing/Internals.cpp: (WebCore::Internals::unavailablePluginReplacementText): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: Add a C and ObjC API to set which plug-ins are specified. Plug-ins may be allowed by origin of the main page or for all origins. If the API to set a supported plug-in is called, WebKit enters a mode where it will block any plug-in that is not on the list. The list of supported plug-ins is stored in UIProcess and sent to WebProcess. This allows to compute the list of visible plug-ins according supported plugins. PluginInfoStore is storing the list of supported plugins and can answer whether a plug-in creation request is to be made unsupported or not. It also creates the structure sent to WebProcess for computing plugin visibility. Updated ArgumentCoders to accept modern HashSet decoders. * Platform/IPC/ArgumentCoders.h: * UIProcess/API/C/WKContext.cpp: (WKContextAddSupportedPlugin): (WKContextClearSupportedPlugins): * UIProcess/API/C/WKContextPrivate.h: * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _addSupportedPlugin:named:withMimeTypes:withExtensions:]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/Plugins/PluginInfoStore.cpp: (WebKit::PluginInfoStore::isSupportedPlugin): (WebKit::PluginInfoStore::SupportedPlugins::isSupported): (WebKit::PluginInfoStore::SupportedPlugin::isSupported): (WebKit::PluginInfoStore::supportedPluginNames): (WebKit::PluginInfoStore::addSupportedPlugin): * UIProcess/Plugins/PluginInfoStore.h: (WebKit::PluginInfoStore::clearSupportedPlugins): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::findPlugin): (WebKit::WebPageProxy::unavailablePluginButtonClicked): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::addSupportedPlugin): (WebKit::WebProcessPool::clearSupportedPlugins): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::getPlugins): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/Plugins/WebPluginInfoProvider.cpp: (WebKit::WebPluginInfoProvider::getPluginInfo): (WebKit::WebPluginInfoProvider::getWebVisiblePluginInfo): (WebKit::WebPluginInfoProvider::populatePluginCache): * WebProcess/Plugins/WebPluginInfoProvider.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::shouldUnavailablePluginMessageBeButton const): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::createPlugin): (WebKit::WebPage::canPluginHandleResponse): Source/WebKitLegacy/mac: * WebCoreSupport/WebPluginInfoProvider.h: * WebCoreSupport/WebPluginInfoProvider.mm: (WebPluginInfoProvider::getPluginInfo): (WebPluginInfoProvider::getWebVisiblePluginInfo): Source/WebKitLegacy/win: * WebCoreSupport/WebPluginInfoProvider.cpp: (WebPluginInfoProvider::getPluginInfo): * WebCoreSupport/WebPluginInfoProvider.h: Tools: Add support for a test runner API to specificy supported plug-ins. * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setPluginsAsUnsupported): * WebKitTestRunner/InjectedBundle/TestRunner.h: * WebKitTestRunner/TestController.cpp: (WTR::TestController::resetStateToConsistentValues): (WTR::TestController::setPluginsAsUnsupported): * WebKitTestRunner/TestController.h: * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): LayoutTests: * http/tests/plugins/nounsupported-plugin-expected.txt: Added. * http/tests/plugins/nounsupported-plugin.html: Added. * http/tests/plugins/supported-plugin-all-origin-visibility-expected.txt: Added. * http/tests/plugins/supported-plugin-all-origin-visibility.html: Added. * http/tests/plugins/supported-plugin-on-specific-origin-expected.txt: Added. * http/tests/plugins/supported-plugin-on-specific-origin.html: Added. * http/tests/plugins/supported-plugin-origin-specific-visibility-expected.txt: Added. * http/tests/plugins/supported-plugin-origin-specific-visibility.html: Added. * http/tests/plugins/unsupported-plugin-on-specific-origin-expected.txt: Added. * http/tests/plugins/unsupported-plugin-on-specific-origin.html: Added. * plugins/unsupported-plugin-expected.txt: Added. * plugins/unsupported-plugin.html: Added. * platform/ios-wk1/TestExpectations: * platform/mac-wk1/TestExpectations: Canonical link: https://commits.webkit.org/198649@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228587 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-16 23:31:31 +00:00
CONSOLE MESSAGE: Tried to use an unsupported plug-in.
A console log message should appear stating the plugin is unsupported.
PASS Testing unsupported plug-in
Allow specifying which plug-ins are supported https://bugs.webkit.org/show_bug.cgi?id=182748 Patch by Youenn Fablet <youenn@apple.com> on 2018-02-16 Reviewed by Chris Dumez. Source/WebCore: Tests: http/tests/plugins/nounsupported-plugin.html http/tests/plugins/supported-plugin-all-origin-visibility.html http/tests/plugins/supported-plugin-on-specific-origin.html http/tests/plugins/supported-plugin-origin-specific-visibility.html http/tests/plugins/unsupported-plugin-on-specific-origin.html plugins/unsupported-plugin.html Added support for computing plugin web visibility with the added knowledge of supported plugins. In case of a plugin failing to be created due to being unsupported, update the UI to use mark the plugin as "Unexpected plug in". Added internal API to retrieve the plug-in error description message. * English.lproj/Localizable.strings: * WebCore.xcodeproj/project.pbxproj: * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::setReplacement): * html/HTMLPlugInElement.h: * loader/EmptyClients.cpp: * platform/LocalizedStrings.cpp: (WebCore::unsupportedPluginText): * platform/LocalizedStrings.h: * plugins/PluginData.cpp: (WebCore::PluginData::initPlugins): * plugins/PluginData.h: (WebCore::decodePluginNames): (WebCore::encodePluginNames): (WebCore::SupportedPluginNames::decode): (WebCore::SupportedPluginNames::encode const): * plugins/PluginInfoProvider.h: * rendering/RenderEmbeddedObject.cpp: (WebCore::unavailablePluginReplacementText): * rendering/RenderEmbeddedObject.h: (WebCore::RenderEmbeddedObject::pluginReplacementTextIfUnavailable const): * testing/Internals.cpp: (WebCore::Internals::unavailablePluginReplacementText): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: Add a C and ObjC API to set which plug-ins are specified. Plug-ins may be allowed by origin of the main page or for all origins. If the API to set a supported plug-in is called, WebKit enters a mode where it will block any plug-in that is not on the list. The list of supported plug-ins is stored in UIProcess and sent to WebProcess. This allows to compute the list of visible plug-ins according supported plugins. PluginInfoStore is storing the list of supported plugins and can answer whether a plug-in creation request is to be made unsupported or not. It also creates the structure sent to WebProcess for computing plugin visibility. Updated ArgumentCoders to accept modern HashSet decoders. * Platform/IPC/ArgumentCoders.h: * UIProcess/API/C/WKContext.cpp: (WKContextAddSupportedPlugin): (WKContextClearSupportedPlugins): * UIProcess/API/C/WKContextPrivate.h: * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _addSupportedPlugin:named:withMimeTypes:withExtensions:]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: * UIProcess/Plugins/PluginInfoStore.cpp: (WebKit::PluginInfoStore::isSupportedPlugin): (WebKit::PluginInfoStore::SupportedPlugins::isSupported): (WebKit::PluginInfoStore::SupportedPlugin::isSupported): (WebKit::PluginInfoStore::supportedPluginNames): (WebKit::PluginInfoStore::addSupportedPlugin): * UIProcess/Plugins/PluginInfoStore.h: (WebKit::PluginInfoStore::clearSupportedPlugins): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::findPlugin): (WebKit::WebPageProxy::unavailablePluginButtonClicked): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::addSupportedPlugin): (WebKit::WebProcessPool::clearSupportedPlugins): * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::getPlugins): * UIProcess/WebProcessProxy.h: * UIProcess/WebProcessProxy.messages.in: * WebProcess/Plugins/WebPluginInfoProvider.cpp: (WebKit::WebPluginInfoProvider::getPluginInfo): (WebKit::WebPluginInfoProvider::getWebVisiblePluginInfo): (WebKit::WebPluginInfoProvider::populatePluginCache): * WebProcess/Plugins/WebPluginInfoProvider.h: * WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::shouldUnavailablePluginMessageBeButton const): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::createPlugin): (WebKit::WebPage::canPluginHandleResponse): Source/WebKitLegacy/mac: * WebCoreSupport/WebPluginInfoProvider.h: * WebCoreSupport/WebPluginInfoProvider.mm: (WebPluginInfoProvider::getPluginInfo): (WebPluginInfoProvider::getWebVisiblePluginInfo): Source/WebKitLegacy/win: * WebCoreSupport/WebPluginInfoProvider.cpp: (WebPluginInfoProvider::getPluginInfo): * WebCoreSupport/WebPluginInfoProvider.h: Tools: Add support for a test runner API to specificy supported plug-ins. * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setPluginsAsUnsupported): * WebKitTestRunner/InjectedBundle/TestRunner.h: * WebKitTestRunner/TestController.cpp: (WTR::TestController::resetStateToConsistentValues): (WTR::TestController::setPluginsAsUnsupported): * WebKitTestRunner/TestController.h: * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): LayoutTests: * http/tests/plugins/nounsupported-plugin-expected.txt: Added. * http/tests/plugins/nounsupported-plugin.html: Added. * http/tests/plugins/supported-plugin-all-origin-visibility-expected.txt: Added. * http/tests/plugins/supported-plugin-all-origin-visibility.html: Added. * http/tests/plugins/supported-plugin-on-specific-origin-expected.txt: Added. * http/tests/plugins/supported-plugin-on-specific-origin.html: Added. * http/tests/plugins/supported-plugin-origin-specific-visibility-expected.txt: Added. * http/tests/plugins/supported-plugin-origin-specific-visibility.html: Added. * http/tests/plugins/unsupported-plugin-on-specific-origin-expected.txt: Added. * http/tests/plugins/unsupported-plugin-on-specific-origin.html: Added. * plugins/unsupported-plugin-expected.txt: Added. * plugins/unsupported-plugin.html: Added. * platform/ios-wk1/TestExpectations: * platform/mac-wk1/TestExpectations: Canonical link: https://commits.webkit.org/198649@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228587 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-16 23:31:31 +00:00