| OLD | NEW |
| 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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 WebClipboard::Buffer())); | 446 WebClipboard::Buffer())); |
| 447 } | 447 } |
| 448 | 448 |
| 449 // A class to facilitate testing that events are correctly received by plugins. | 449 // A class to facilitate testing that events are correctly received by plugins. |
| 450 class EventTestPlugin : public FakeWebPlugin { | 450 class EventTestPlugin : public FakeWebPlugin { |
| 451 public: | 451 public: |
| 452 EventTestPlugin(WebFrame* frame, const WebPluginParams& params) | 452 EventTestPlugin(WebFrame* frame, const WebPluginParams& params) |
| 453 : FakeWebPlugin(frame, params), | 453 : FakeWebPlugin(frame, params), |
| 454 m_lastEventType(WebInputEvent::Undefined) {} | 454 m_lastEventType(WebInputEvent::Undefined) {} |
| 455 | 455 |
| 456 WebInputEventResult handleInputEvent(const WebInputEvent& event, | 456 WebInputEventResult handleInputEvent( |
| 457 WebCursorInfo&) override { | 457 const CoalescedWebInputEvent& coalescedEvent, |
| 458 m_lastEventType = event.type; | 458 WebCursorInfo&) override { |
| 459 m_lastEventType = coalescedEvent.event().type; |
| 459 return WebInputEventResult::HandledSystem; | 460 return WebInputEventResult::HandledSystem; |
| 460 } | 461 } |
| 461 WebInputEvent::Type getLastInputEventType() { return m_lastEventType; } | 462 WebInputEvent::Type getLastInputEventType() { return m_lastEventType; } |
| 462 | 463 |
| 463 private: | 464 private: |
| 464 WebInputEvent::Type m_lastEventType; | 465 WebInputEvent::Type m_lastEventType; |
| 465 }; | 466 }; |
| 466 | 467 |
| 467 TEST_F(WebPluginContainerTest, GestureLongPressReachesPlugin) { | 468 TEST_F(WebPluginContainerTest, GestureLongPressReachesPlugin) { |
| 468 URLTestHelpers::registerMockedURLFromBaseURL( | 469 URLTestHelpers::registerMockedURLFromBaseURL( |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 WebString::fromUTF8("translated-plugin")); | 774 WebString::fromUTF8("translated-plugin")); |
| 774 pluginContainerOneElement.pluginContainer()->setWantsWheelEvents(true); | 775 pluginContainerOneElement.pluginContainer()->setWantsWheelEvents(true); |
| 775 | 776 |
| 776 runPendingTasks(); | 777 runPendingTasks(); |
| 777 EXPECT_TRUE( | 778 EXPECT_TRUE( |
| 778 webView->page()->frameHost().eventHandlerRegistry().hasEventHandlers( | 779 webView->page()->frameHost().eventHandlerRegistry().hasEventHandlers( |
| 779 EventHandlerRegistry::WheelEventBlocking)); | 780 EventHandlerRegistry::WheelEventBlocking)); |
| 780 } | 781 } |
| 781 | 782 |
| 782 } // namespace blink | 783 } // namespace blink |
| OLD | NEW |