#include "content/test/test_render_view_host.h"
#include <memory>
#include <optional>
#include <tuple>
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "components/input/render_widget_host_input_event_router.h"
#include "components/viz/common/surfaces/parent_local_surface_id_allocator.h"
#include "components/viz/host/host_frame_sink_manager.h"
#include "content/browser/blob_storage/chrome_blob_storage_context.h"
#include "content/browser/compositor/image_transport_factory.h"
#include "content/browser/compositor/surface_utils.h"
#include "content/browser/dom_storage/dom_storage_context_wrapper.h"
#include "content/browser/dom_storage/session_storage_namespace_impl.h"
#include "content/browser/renderer_host/data_transfer_util.h"
#include "content/browser/renderer_host/render_frame_proxy_host.h"
#include "content/browser/storage_partition_impl.h"
#include "content/common/input/synthetic_gesture_target.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/common/content_client.h"
#include "content/public/common/drop_data.h"
#include "content/public/common/page_visibility_state.h"
#include "content/test/test_page_broadcast.h"
#include "content/test/test_render_frame_host.h"
#include "content/test/test_web_contents.h"
#include "media/base/video_frame.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/page_state/page_state.h"
#include "third_party/blink/public/common/web_preferences/web_preferences.h"
#include "third_party/blink/public/mojom/drag/drag.mojom.h"
#include "ui/aura/env.h"
#include "ui/compositor/compositor.h"
#include "ui/compositor/layer_type.h"
#include "ui/gfx/geometry/rect.h"
#if defined(USE_AURA)
#include "ui/aura/test/test_window_delegate.h"
#endif
namespace content {
TestRenderWidgetHostView::TestRenderWidgetHostView(RenderWidgetHost* rwh)
: … { … }
TestRenderWidgetHostView::~TestRenderWidgetHostView() { … }
gfx::NativeView TestRenderWidgetHostView::GetNativeView() { … }
gfx::NativeViewAccessible TestRenderWidgetHostView::GetNativeViewAccessible() { … }
ui::TextInputClient* TestRenderWidgetHostView::GetTextInputClient() { … }
bool TestRenderWidgetHostView::HasFocus() { … }
void TestRenderWidgetHostView::ShowWithVisibility(
PageVisibilityState page_visibility) { … }
void TestRenderWidgetHostView::Hide() { … }
bool TestRenderWidgetHostView::IsShowing() { … }
void TestRenderWidgetHostView::WasUnOccluded() { … }
void TestRenderWidgetHostView::WasOccluded() { … }
void TestRenderWidgetHostView::EnsureSurfaceSynchronizedForWebTest() { … }
uint32_t TestRenderWidgetHostView::GetCaptureSequenceNumber() const { … }
void TestRenderWidgetHostView::UpdateCursor(const ui::Cursor& cursor) { … }
void TestRenderWidgetHostView::RenderProcessGone() { … }
void TestRenderWidgetHostView::Destroy() { … }
gfx::Rect TestRenderWidgetHostView::GetViewBounds() { … }
#if BUILDFLAG(IS_MAC)
void TestRenderWidgetHostView::SetActive(bool active) {
}
void TestRenderWidgetHostView::SpeakSelection() {
}
void TestRenderWidgetHostView::SetWindowFrameInScreen(const gfx::Rect& rect) {}
void TestRenderWidgetHostView::ShowSharePicker(
const std::string& title,
const std::string& text,
const std::string& url,
const std::vector<std::string>& file_paths,
blink::mojom::ShareService::ShareCallback callback) {}
uint64_t TestRenderWidgetHostView::GetNSViewId() const {
return 0;
}
#endif
gfx::Rect TestRenderWidgetHostView::GetBoundsInRootWindow() { … }
const viz::LocalSurfaceId&
TestRenderWidgetHostView::IncrementSurfaceIdForNavigation() { … }
void TestRenderWidgetHostView::ClearFallbackSurfaceForCommitPending() { … }
void TestRenderWidgetHostView::TakeFallbackContentFrom(
RenderWidgetHostView* view) { … }
blink::mojom::PointerLockResult TestRenderWidgetHostView::LockPointer(bool) { … }
blink::mojom::PointerLockResult TestRenderWidgetHostView::ChangePointerLock(
bool) { … }
void TestRenderWidgetHostView::UnlockPointer() { … }
const viz::FrameSinkId& TestRenderWidgetHostView::GetFrameSinkId() const { … }
const viz::LocalSurfaceId& TestRenderWidgetHostView::GetLocalSurfaceId() const { … }
viz::SurfaceId TestRenderWidgetHostView::GetCurrentSurfaceId() const { … }
void TestRenderWidgetHostView::OnFirstSurfaceActivation(
const viz::SurfaceInfo& surface_info) { … }
void TestRenderWidgetHostView::OnFrameTokenChanged(
uint32_t frame_token,
base::TimeTicks activation_time) { … }
void TestRenderWidgetHostView::ClearFallbackSurfaceCalled() { … }
std::unique_ptr<SyntheticGestureTarget>
TestRenderWidgetHostView::CreateSyntheticGestureTarget() { … }
void TestRenderWidgetHostView::UpdateBackgroundColor() { … }
void TestRenderWidgetHostView::SetDisplayFeatureForTesting(
const DisplayFeature* display_feature) { … }
void TestRenderWidgetHostView::NotifyHostAndDelegateOnWasShown(
blink::mojom::RecordContentToVisibleTimeRequestPtr visible_time_request) { … }
void TestRenderWidgetHostView::
RequestSuccessfulPresentationTimeFromHostOrDelegate(
blink::mojom::RecordContentToVisibleTimeRequestPtr
visible_time_request) { … }
void TestRenderWidgetHostView::
CancelSuccessfulPresentationTimeRequestForHostAndDelegate() { … }
std::optional<DisplayFeature> TestRenderWidgetHostView::GetDisplayFeature() { … }
ui::Compositor* TestRenderWidgetHostView::GetCompositor() { … }
input::CursorManager* TestRenderWidgetHostView::GetCursorManager() { … }
TestRenderWidgetHostViewChildFrame::TestRenderWidgetHostViewChildFrame(
RenderWidgetHost* rwh)
: … { … }
void TestRenderWidgetHostViewChildFrame::Reset() { … }
void TestRenderWidgetHostViewChildFrame::SetCompositor(
ui::Compositor* compositor) { … }
ui::Compositor* TestRenderWidgetHostViewChildFrame::GetCompositor() { … }
void TestRenderWidgetHostViewChildFrame::ProcessGestureEvent(
const blink::WebGestureEvent& event,
const ui::LatencyInfo&) { … }
TestRenderViewHost::TestRenderViewHost(
FrameTree* frame_tree,
SiteInstanceGroup* group,
const StoragePartitionConfig& storage_partition_config,
std::unique_ptr<RenderWidgetHostImpl> widget,
RenderViewHostDelegate* delegate,
int32_t routing_id,
int32_t main_frame_routing_id,
scoped_refptr<BrowsingContextState> main_browsing_context_state,
CreateRenderViewHostCase create_case)
: … { … }
TestRenderViewHost::~TestRenderViewHost() { … }
bool TestRenderViewHost::CreateTestRenderView() { … }
bool TestRenderViewHost::CreateRenderView(
const std::optional<blink::FrameToken>& opener_frame_token,
int proxy_route_id,
bool window_was_created_with_opener) { … }
MockRenderProcessHost* TestRenderViewHost::GetProcess() const { … }
void TestRenderViewHost::SimulateWasHidden() { … }
void TestRenderViewHost::SimulateWasShown() { … }
blink::web_pref::WebPreferences
TestRenderViewHost::TestComputeWebPreferences() { … }
bool TestRenderViewHost::IsTestRenderViewHost() const { … }
void TestRenderViewHost::TestStartDragging(const DropData& drop_data,
SkBitmap bitmap) { … }
void TestRenderViewHost::TestOnUpdateStateWithFile(
const base::FilePath& file_path) { … }
RenderViewHostImplTestHarness::RenderViewHostImplTestHarness()
: … { … }
RenderViewHostImplTestHarness::~RenderViewHostImplTestHarness() = default;
TestRenderViewHost* RenderViewHostImplTestHarness::test_rvh() { … }
TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() { … }
TestWebContents* RenderViewHostImplTestHarness::contents() { … }
}