blob: 7b3eb263c131cb114f547223aaecdc60873c9ebb [file] [log] [blame]
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_COMMON_RENDER_MESSAGE_FILTER_MOJOM_TEST_UTILS_H_
#define CONTENT_COMMON_RENDER_MESSAGE_FILTER_MOJOM_TEST_UTILS_H_
#include "content/common/render_message_filter.mojom.h"
#include "content/common/content_export.h"
namespace content {
namespace mojom {
class CONTENT_EXPORT RenderMessageFilterInterceptorForTesting : public RenderMessageFilter {
virtual RenderMessageFilter* GetForwardingInterface() = 0;
void GenerateRoutingID(GenerateRoutingIDCallback callback) override;
void CreateNewWidget(int32_t opener_id, ::content::mojom::WidgetPtr widget, CreateNewWidgetCallback callback) override;
void CreateFullscreenWidget(int32_t opener_id, ::content::mojom::WidgetPtr widget, CreateFullscreenWidgetCallback callback) override;
void HasGpuProcess(HasGpuProcessCallback callback) override;
};
class CONTENT_EXPORT RenderMessageFilterAsyncWaiter {
public:
explicit RenderMessageFilterAsyncWaiter(RenderMessageFilter* proxy);
~RenderMessageFilterAsyncWaiter();
void GenerateRoutingID(
int32_t* out_routing_id);
void CreateNewWidget(
int32_t opener_id, ::content::mojom::WidgetPtr widget, int32_t* out_route_id);
void CreateFullscreenWidget(
int32_t opener_id, ::content::mojom::WidgetPtr widget, int32_t* out_route_id);
void HasGpuProcess(
bool* out_has_gpu_process);
private:
RenderMessageFilter* const proxy_;
DISALLOW_COPY_AND_ASSIGN(RenderMessageFilterAsyncWaiter);
};
} // namespace mojom
} // namespace content
#endif // CONTENT_COMMON_RENDER_MESSAGE_FILTER_MOJOM_TEST_UTILS_H_