#include "third_party/blink/public/web/web_plugin_container.h"
#include <memory>
#include <string>
#include "build/build_config.h"
#include "cc/layers/layer.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/input/web_coalesced_input_event.h"
#include "third_party/blink/public/common/input/web_mouse_wheel_event.h"
#include "third_party/blink/public/common/input/web_pointer_event.h"
#include "third_party/blink/public/web/web_document.h"
#include "third_party/blink/public/web/web_element.h"
#include "third_party/blink/public/web/web_local_frame_client.h"
#include "third_party/blink/public/web/web_plugin_params.h"
#include "third_party/blink/public/web/web_print_params.h"
#include "third_party/blink/public/web/web_settings.h"
#include "third_party/blink/public/web/web_view.h"
#include "third_party/blink/renderer/core/clipboard/system_clipboard.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/events/keyboard_event.h"
#include "third_party/blink/renderer/core/exported/web_plugin_container_impl.h"
#include "third_party/blink/renderer/core/exported/web_view_impl.h"
#include "third_party/blink/renderer/core/frame/event_handler_registry.h"
#include "third_party/blink/renderer/core/frame/frame_test_helpers.h"
#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
#include "third_party/blink/renderer/core/html/html_element.h"
#include "third_party/blink/renderer/core/layout/layout_object.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/core/testing/fake_web_plugin.h"
#include "third_party/blink/renderer/core/testing/page_test_base.h"
#include "third_party/blink/renderer/core/testing/scoped_fake_plugin_registry.h"
#include "third_party/blink/renderer/platform/graphics/graphics_context.h"
#include "third_party/blink/renderer/platform/graphics/paint/cull_rect.h"
#include "third_party/blink/renderer/platform/graphics/paint/foreign_layer_display_item.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_controller.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_recorder.h"
#include "third_party/blink/renderer/platform/keyboard_codes.h"
#include "third_party/blink/renderer/platform/scheduler/public/thread.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
#include "third_party/blink/renderer/platform/testing/url_loader_mock_factory.h"
#include "third_party/blink/renderer/platform/testing/url_test_helpers.h"
RunPendingTasks;
namespace blink {
class WebPluginContainerTest : public PageTestBase { … };
namespace {
#if BUILDFLAG(IS_MAC)
const WebInputEvent::Modifiers kEditingModifier = WebInputEvent::kMetaKey;
#else
const WebInputEvent::Modifiers kEditingModifier = …;
#endif
template <typename T>
class CustomPluginWebFrameClient
: public frame_test_helpers::TestWebFrameClient { … };
class TestPluginWebFrameClient;
class TestPlugin : public FakeWebPlugin { … };
class TestPluginWithEditableText : public FakeWebPlugin { … };
class TestPluginWebFrameClient : public frame_test_helpers::TestWebFrameClient { … };
bool TestPlugin::CanCopy() const { … }
void TestPlugin::PrintPage(int page_index, cc::PaintCanvas* canvas) { … }
void EnablePlugins(WebView* web_view, const gfx::Size& size) { … }
WebPluginContainer* GetWebPluginContainer(WebViewImpl* web_view,
const WebString& id) { … }
String ReadClipboard(LocalFrame& frame) { … }
void ClearClipboardBuffer(LocalFrame& frame) { … }
void CreateAndHandleKeyboardEvent(WebElement* plugin_container_one_element,
WebInputEvent::Modifiers modifier_key,
int key_code) { … }
void ExecuteContextMenuCommand(WebViewImpl* web_view,
const WebString& command_name) { … }
}
TEST_F(WebPluginContainerTest, WindowToLocalPointTest) { … }
TEST_F(WebPluginContainerTest, LocalToWindowPointTest) { … }
TEST_F(WebPluginContainerTest, Copy) { … }
TEST_F(WebPluginContainerTest, CopyWithoutPermission) { … }
TEST_F(WebPluginContainerTest, CopyFromContextMenu) { … }
TEST_F(WebPluginContainerTest, CopyFromContextMenuWithoutCopyPermission) { … }
TEST_F(WebPluginContainerTest, CopyInsertKeyboardEventsTest) { … }
TEST_F(WebPluginContainerTest,
CopyInsertKeyboardEventsTestWithoutCopyPermission) { … }
TEST_F(WebPluginContainerTest, CutDeleteKeyboardEventsTest) { … }
TEST_F(WebPluginContainerTest, PasteInsertKeyboardEventsTest) { … }
TEST_F(WebPluginContainerTest, PasteAndMatchStyleKeyboardEventsTest) { … }
TEST_F(WebPluginContainerTest, CutFromContextMenu) { … }
TEST_F(WebPluginContainerTest, PasteFromContextMenu) { … }
TEST_F(WebPluginContainerTest, PasteAndMatchStyleFromContextMenu) { … }
class EventTestPlugin : public FakeWebPlugin { … };
TEST_F(WebPluginContainerTest, GestureLongPressReachesPlugin) { … }
TEST_F(WebPluginContainerTest, MouseEventButtons) { … }
TEST_F(WebPluginContainerTest, MouseWheelEventTranslated) { … }
TEST_F(WebPluginContainerTest, TouchEventScrolled) { … }
TEST_F(WebPluginContainerTest, TouchEventScrolledWithCoalescedTouches) { … }
TEST_F(WebPluginContainerTest, MouseWheelEventScrolled) { … }
TEST_F(WebPluginContainerTest, MouseEventScrolled) { … }
TEST_F(WebPluginContainerTest, MouseEventZoomed) { … }
TEST_F(WebPluginContainerTest, MouseWheelEventZoomed) { … }
TEST_F(WebPluginContainerTest, TouchEventZoomed) { … }
TEST_F(WebPluginContainerTest, IsRectTopmostTest) { … }
TEST_F(WebPluginContainerTest, IsRectTopmostTestWithOddAndEvenDimensions) { … }
TEST_F(WebPluginContainerTest, ClippedRectsForIframedElement) { … }
TEST_F(WebPluginContainerTest, ClippedRectsForShiftedIframedElement) { … }
TEST_F(WebPluginContainerTest, ClippedRectsForSubpixelPositionedPlugin) { … }
TEST_F(WebPluginContainerTest, TopmostAfterDetachTest) { … }
namespace {
class CompositedPlugin : public FakeWebPlugin { … };
}
TEST_F(WebPluginContainerTest, CompositedPlugin) { … }
TEST_F(WebPluginContainerTest, NeedsWheelEvents) { … }
}