| 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 | 308 |
| 309 // A class to facilitate testing that events are correctly received by plugins. | 309 // A class to facilitate testing that events are correctly received by plugins. |
| 310 class EventTestPlugin : public FakeWebPlugin { | 310 class EventTestPlugin : public FakeWebPlugin { |
| 311 public: | 311 public: |
| 312 EventTestPlugin(WebFrame* frame, const WebPluginParams& params) | 312 EventTestPlugin(WebFrame* frame, const WebPluginParams& params) |
| 313 : FakeWebPlugin(frame, params) | 313 : FakeWebPlugin(frame, params) |
| 314 , m_lastEventType(WebInputEvent::Undefined) | 314 , m_lastEventType(WebInputEvent::Undefined) |
| 315 { | 315 { |
| 316 } | 316 } |
| 317 | 317 |
| 318 bool handleInputEvent(const WebInputEvent& event, WebCursorInfo&) override | 318 WebInputEventResult handleInputEvent(const WebInputEvent& event, WebCursorIn
fo&) override |
| 319 { | 319 { |
| 320 m_lastEventType = event.type; | 320 m_lastEventType = event.type; |
| 321 return true; | 321 return WebInputEventResult::HandledSystem; |
| 322 } | 322 } |
| 323 WebInputEvent::Type getLastInputEventType() {return m_lastEventType; } | 323 WebInputEvent::Type getLastInputEventType() {return m_lastEventType; } |
| 324 | 324 |
| 325 private: | 325 private: |
| 326 WebInputEvent::Type m_lastEventType; | 326 WebInputEvent::Type m_lastEventType; |
| 327 }; | 327 }; |
| 328 | 328 |
| 329 class EventTestPluginWebFrameClient : public FrameTestHelpers::TestWebFrameClien
t { | 329 class EventTestPluginWebFrameClient : public FrameTestHelpers::TestWebFrameClien
t { |
| 330 WebPlugin* createPlugin(WebLocalFrame* frame, const WebPluginParams& params)
override | 330 WebPlugin* createPlugin(WebLocalFrame* frame, const WebPluginParams& params)
override |
| 331 { | 331 { |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 TopmostPlugin* testPlugin = static_cast<TopmostPlugin*>(pluginContainerImpl-
>plugin()); | 453 TopmostPlugin* testPlugin = static_cast<TopmostPlugin*>(pluginContainerImpl-
>plugin()); |
| 454 EXPECT_TRUE(testPlugin->isRectTopmost()); | 454 EXPECT_TRUE(testPlugin->isRectTopmost()); |
| 455 | 455 |
| 456 // Cause the plugin's frame to be detached. | 456 // Cause the plugin's frame to be detached. |
| 457 webViewHelper.reset(); | 457 webViewHelper.reset(); |
| 458 | 458 |
| 459 EXPECT_FALSE(pluginContainerImpl->isRectTopmost(topmostRect)); | 459 EXPECT_FALSE(pluginContainerImpl->isRectTopmost(topmostRect)); |
| 460 } | 460 } |
| 461 | 461 |
| 462 } // namespace blink | 462 } // namespace blink |
| OLD | NEW |