#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_FRAME_TEST_HELPERS_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_FRAME_TEST_HELPERS_H_
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <memory>
#include <string>
#include "base/functional/callback_helpers.h"
#include "base/functional/function_ref.h"
#include "base/memory/weak_ptr.h"
#include "base/task/single_thread_task_runner.h"
#include "cc/test/fake_layer_tree_frame_sink.h"
#include "cc/trees/layer_tree_host.h"
#include "components/viz/common/surfaces/frame_sink_id.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "third_party/blink/public/common/input/web_mouse_event.h"
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink-forward.h"
#include "third_party/blink/public/mojom/frame/tree_scope_type.mojom-blink.h"
#include "third_party/blink/public/mojom/input/input_handler.mojom-blink.h"
#include "third_party/blink/public/mojom/page/widget.mojom-blink.h"
#include "third_party/blink/public/mojom/widget/platform_widget.mojom-blink.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/scheduler/web_agent_group_scheduler.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/platform/web_url_request.h"
#include "third_party/blink/public/web/web_frame_owner_properties.h"
#include "third_party/blink/public/web/web_history_item.h"
#include "third_party/blink/public/web/web_local_frame_client.h"
#include "third_party/blink/public/web/web_settings.h"
#include "third_party/blink/public/web/web_view_client.h"
#include "third_party/blink/renderer/core/exported/web_view_impl.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/frame/web_frame_widget_impl.h"
#include "third_party/blink/renderer/core/scroll/scrollbar_theme.h"
#include "third_party/blink/renderer/core/testing/scoped_mock_overlay_scrollbars.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
namespace base {
class TickClock;
}
namespace blink {
class AgentGroupScheduler;
class WebFrame;
class WebLocalFrameImpl;
struct WebNavigationParams;
class WebRemoteFrameImpl;
class WebSettings;
class WidgetInputHandlerManager;
namespace frame_test_helpers {
class TestWebFrameClient;
class TestWidgetInputHandlerHost;
class WebViewHelper;
cc::LayerTreeSettings GetSynchronousSingleThreadLayerTreeSettings();
void LoadFrameDontWait(WebLocalFrame*, const WebURL& url);
void LoadFrame(WebLocalFrame*, const std::string& url);
void LoadHTMLString(WebLocalFrame*,
const std::string& html,
const WebURL& base_url,
const base::TickClock* clock = nullptr);
void LoadHistoryItem(WebLocalFrame*,
const WebHistoryItem&,
mojom::FetchCacheMode);
void ReloadFrame(WebLocalFrame*);
void ReloadFrameBypassingCache(WebLocalFrame*);
void FillNavigationParamsResponse(WebNavigationParams*);
void PumpPendingRequestsForFrameToLoad(WebLocalFrame*);
WebMouseEvent CreateMouseEvent(WebInputEvent::Type,
WebMouseEvent::Button,
const gfx::Point&,
int modifiers);
WebLocalFrameImpl* CreateLocalChild(
WebLocalFrame& parent,
mojom::blink::TreeScopeType,
TestWebFrameClient*,
WebPolicyContainerBindParams policy_container_bind_params,
WebLocalFrameClient::FinishChildFrameCreationFn finish_creation);
WebLocalFrameImpl* CreateLocalChild(
WebLocalFrame& parent,
blink::mojom::blink::TreeScopeType,
std::unique_ptr<TestWebFrameClient>,
WebPolicyContainerBindParams policy_container_bind_params,
WebLocalFrameClient::FinishChildFrameCreationFn finish_creation);
WebRemoteFrameImpl* CreateRemote();
WebRemoteFrameImpl* CreateRemoteChild(WebRemoteFrame& parent,
const WebString& name = WebString(),
scoped_refptr<SecurityOrigin> = nullptr);
void SwapRemoteFrame(
WebFrame* old_frame,
WebRemoteFrame* new_remote_frame,
mojo::PendingAssociatedRemote<mojom::blink::RemoteFrameHost> =
mojo::NullAssociatedRemote());
class TestWebFrameWidgetHost : public mojom::blink::WidgetHost,
public mojom::blink::FrameWidgetHost { … };
class TestWebFrameWidget : public WebFrameWidgetImpl { … };
CreateTestWebFrameWidgetCallback;
class WebViewHelper : public ScopedMockOverlayScrollbars { … };
class TestWebFrameClient : public WebLocalFrameClient { … };
class TestWidgetInputHandlerHost : public mojom::blink::WidgetInputHandlerHost { … };
}
}
#endif