| Index: third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp
|
| diff --git a/third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp b/third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp
|
| index edbb12706bc7926cb71c00a5533109fd26ee646e..edea235b937a22d5c9119c91caa9838e015cc475 100644
|
| --- a/third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp
|
| +++ b/third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp
|
| @@ -32,7 +32,10 @@
|
|
|
| #include "core/dom/Element.h"
|
| #include "core/events/KeyboardEvent.h"
|
| +#include "core/frame/EventHandlerRegistry.h"
|
| +#include "core/frame/FrameHost.h"
|
| #include "core/layout/LayoutObject.h"
|
| +#include "core/page/Page.h"
|
| #include "platform/PlatformEvent.h"
|
| #include "platform/PlatformKeyboardEvent.h"
|
| #include "platform/graphics/GraphicsContext.h"
|
| @@ -630,4 +633,25 @@ TEST_F(WebPluginContainerTest, CompositedPluginSPv2)
|
| EXPECT_EQ(plugin->getWebLayer()->ccLayer(), foreignLayerDisplayItem.layer());
|
| }
|
|
|
| +TEST_F(WebPluginContainerTest, NeedsWheelEvents)
|
| +{
|
| + URLTestHelpers::registerMockedURLFromBaseURL(
|
| + WebString::fromUTF8(m_baseURL.c_str()),
|
| + WebString::fromUTF8("plugin_container.html"));
|
| + TestPluginWebFrameClient pluginWebFrameClient; // Must outlive webViewHelper
|
| + FrameTestHelpers::WebViewHelper webViewHelper;
|
| + WebViewImpl* webView = webViewHelper.initializeAndLoad(m_baseURL + "plugin_container.html", true, &pluginWebFrameClient);
|
| + ASSERT(webView);
|
| + webView->settings()->setPluginsEnabled(true);
|
| + webView->resize(WebSize(300, 300));
|
| + webView->updateAllLifecyclePhases();
|
| + runPendingTasks();
|
| +
|
| + WebElement pluginContainerOneElement = webView->mainFrame()->document().getElementById(WebString::fromUTF8("translated-plugin"));
|
| + pluginContainerOneElement.pluginContainer()->setWantsWheelEvents(true);
|
| +
|
| + runPendingTasks();
|
| + EXPECT_TRUE(webView->page()->frameHost().eventHandlerRegistry().hasEventHandlers(EventHandlerRegistry::WheelEventBlocking));
|
| +}
|
| +
|
| } // namespace blink
|
|
|