WebKitTestRunner: Plugins are disabled in new windows
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Dec 2016 19:35:56 +0000 (19:35 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Dec 2016 19:35:56 +0000 (19:35 +0000)
commit7148a30885cd711390921cc4734690973474e500
tree7823e58903b4aef26f6c55a671afbbd7f9b9c784
parentf22ad9d116a7efb3962dce6d18ddca752275ed8d
WebKitTestRunner: Plugins are disabled in new windows
https://bugs.webkit.org/show_bug.cgi?id=165410

Reviewed by Alex Christensen.

Source/WebKit2:

Remove SPI exposed to explicitly toggle plugins from WebKitTestRunner.
Instead we will update WebKitTestRunner to make use of the SPI
WKBundleOverrideBoolPreferenceForTestRunner() to toggle plugins in
all windows.

* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleSetPluginsEnabled): Deleted.
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setPluginsEnabled): Deleted.

Tools:

Currently WebKitTestRunner only enables plugins in the main window. So, a test that opens
a new window and loads a plugin will fail. We should enable plugins in all windows by
default. Moreover toggling testRunner.setPluginsEnabled() should effect all windows.

Making these changes is a step towards running plugins/open-and-close-window-with-plugin.html
in WebKitTestRunner (we still need to fix <https://bugs.webkit.org/show_bug.cgi?id=46714>) and
will make the behavior of WebKitTestRunner more closely match the behavior DumpRenderTree.

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting): Call TestRunner::setPluginsEnabled() instead of
WKBundleSetPluginsEnabled().
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setPluginsEnabled): Take a similar approach as TestRunner::setXSSAuditorEnabled()
and make use of WKBundleOverrideBoolPreferenceForTestRunner().

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@209408 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp