| 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 WebInputEvent& event, |
| 458 const std::vector<const blink::WebInputEvent*>&, |
| 459 WebCursorInfo&) override { |
| 458 m_lastEventType = event.type; | 460 m_lastEventType = event.type; |
| 459 return WebInputEventResult::HandledSystem; | 461 return WebInputEventResult::HandledSystem; |
| 460 } | 462 } |
| 461 WebInputEvent::Type getLastInputEventType() { return m_lastEventType; } | 463 WebInputEvent::Type getLastInputEventType() { return m_lastEventType; } |
| 462 | 464 |
| 463 private: | 465 private: |
| 464 WebInputEvent::Type m_lastEventType; | 466 WebInputEvent::Type m_lastEventType; |
| 465 }; | 467 }; |
| 466 | 468 |
| 467 TEST_F(WebPluginContainerTest, GestureLongPressReachesPlugin) { | 469 TEST_F(WebPluginContainerTest, GestureLongPressReachesPlugin) { |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 WebString::fromUTF8("translated-plugin")); | 769 WebString::fromUTF8("translated-plugin")); |
| 768 pluginContainerOneElement.pluginContainer()->setWantsWheelEvents(true); | 770 pluginContainerOneElement.pluginContainer()->setWantsWheelEvents(true); |
| 769 | 771 |
| 770 runPendingTasks(); | 772 runPendingTasks(); |
| 771 EXPECT_TRUE( | 773 EXPECT_TRUE( |
| 772 webView->page()->frameHost().eventHandlerRegistry().hasEventHandlers( | 774 webView->page()->frameHost().eventHandlerRegistry().hasEventHandlers( |
| 773 EventHandlerRegistry::WheelEventBlocking)); | 775 EventHandlerRegistry::WheelEventBlocking)); |
| 774 } | 776 } |
| 775 | 777 |
| 776 } // namespace blink | 778 } // namespace blink |
| OLD | NEW |