Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Unified Diff: third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp

Issue 1828203003: Flash players weren't receiving mouse wheel events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit test Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/web/WebPluginContainerImpl.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « third_party/WebKit/Source/web/WebPluginContainerImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698