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

Side by Side Diff: third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp

Issue 2573073003: Collapse the API surface on WebInputEvent via accessor functions. (Closed)
Patch Set: Fix nits Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 449
450 // A class to facilitate testing that events are correctly received by plugins. 450 // A class to facilitate testing that events are correctly received by plugins.
451 class EventTestPlugin : public FakeWebPlugin { 451 class EventTestPlugin : public FakeWebPlugin {
452 public: 452 public:
453 EventTestPlugin(WebFrame* frame, const WebPluginParams& params) 453 EventTestPlugin(WebFrame* frame, const WebPluginParams& params)
454 : FakeWebPlugin(frame, params), 454 : FakeWebPlugin(frame, params),
455 m_lastEventType(WebInputEvent::Undefined) {} 455 m_lastEventType(WebInputEvent::Undefined) {}
456 456
457 WebInputEventResult handleInputEvent(const WebInputEvent& event, 457 WebInputEventResult handleInputEvent(const WebInputEvent& event,
458 WebCursorInfo&) override { 458 WebCursorInfo&) override {
459 m_lastEventType = event.type; 459 m_lastEventType = event.type();
460 if (WebInputEvent::isMouseEventType(event.type) || 460 if (WebInputEvent::isMouseEventType(event.type()) ||
461 event.type == WebInputEvent::MouseWheel) { 461 event.type() == WebInputEvent::MouseWheel) {
462 const WebMouseEvent& mouseEvent = 462 const WebMouseEvent& mouseEvent =
463 static_cast<const WebMouseEvent&>(event); 463 static_cast<const WebMouseEvent&>(event);
464 m_lastMouseEventLocation = IntPoint(mouseEvent.x, mouseEvent.y); 464 m_lastMouseEventLocation = IntPoint(mouseEvent.x, mouseEvent.y);
465 } 465 }
466 466
467 return WebInputEventResult::HandledSystem; 467 return WebInputEventResult::HandledSystem;
468 } 468 }
469 WebInputEvent::Type getLastInputEventType() { return m_lastEventType; } 469 WebInputEvent::Type getLastInputEventType() { return m_lastEventType; }
470 470
471 IntPoint getLastMouseEventLocation() { return m_lastMouseEventLocation; } 471 IntPoint getLastMouseEventLocation() { return m_lastMouseEventLocation; }
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 WebString::fromUTF8("translated-plugin")); 815 WebString::fromUTF8("translated-plugin"));
816 pluginContainerOneElement.pluginContainer()->setWantsWheelEvents(true); 816 pluginContainerOneElement.pluginContainer()->setWantsWheelEvents(true);
817 817
818 runPendingTasks(); 818 runPendingTasks();
819 EXPECT_TRUE( 819 EXPECT_TRUE(
820 webView->page()->frameHost().eventHandlerRegistry().hasEventHandlers( 820 webView->page()->frameHost().eventHandlerRegistry().hasEventHandlers(
821 EventHandlerRegistry::WheelEventBlocking)); 821 EventHandlerRegistry::WheelEventBlocking));
822 } 822 }
823 823
824 } // namespace blink 824 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698