Chromium Code Reviews| Index: content/public/test/mock_render_frame_host.h |
| diff --git a/content/public/test/mock_render_frame_host.h b/content/public/test/mock_render_frame_host.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ec837acbba2355a3f0dfb798c6ddeafc1f08704e |
| --- /dev/null |
| +++ b/content/public/test/mock_render_frame_host.h |
| @@ -0,0 +1,76 @@ |
| +// Copyright 2016 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_PUBLIC_TEST_MOCK_RENDER_FRAME_HOST_H_ |
| +#define CONTENT_PUBLIC_TEST_MOCK_RENDER_FRAME_HOST_H_ |
| + |
| +#include "content/public/browser/render_frame_host.h" |
| + |
| +namespace content { |
| + |
| +// A mock class suitable for tests. Tests can override methods they need as |
| +// required. |
| +class CONTENT_EXPORT MockRenderFrameHost : public RenderFrameHost { |
|
Charlie Reis
2016/06/16 22:03:05
We already have RenderFrameHostTester (which is ti
raymes
2016/06/20 06:35:48
Ah thanks for the pointer! That made things much n
|
| + public: |
| + MockRenderFrameHost(); |
| + ~MockRenderFrameHost() override; |
| + |
| + // IPC::Sender |
| + bool Send(IPC::Message* msg) override; |
| + |
| + // IPC::Listener |
| + bool OnMessageReceived(const IPC::Message& message) override; |
| + |
| + // RenderFrameHost |
| + int GetRoutingID() override; |
| + int GetAXTreeID() override; |
| + SiteInstance* GetSiteInstance() override; |
| + RenderProcessHost* GetProcess() override; |
| + RenderWidgetHostView* GetView() override; |
| + RenderFrameHost* GetParent() override; |
| + int GetFrameTreeNodeId() override; |
| + const std::string& GetFrameName() override; |
| + bool IsCrossProcessSubframe() override; |
| + const GURL& GetLastCommittedURL() override; |
| + url::Origin GetLastCommittedOrigin() override; |
| + gfx::NativeView GetNativeView() override; |
| + void AddMessageToConsole(ConsoleMessageLevel level, |
| + const std::string& message) override; |
| + void ExecuteJavaScript(const base::string16& javascript) override; |
| + void ExecuteJavaScript(const base::string16& javascript, |
| + const JavaScriptResultCallback& callback) override; |
| + void ExecuteJavaScriptInIsolatedWorld( |
| + const base::string16& javascript, |
| + const JavaScriptResultCallback& callback, |
| + int world_id) override; |
| + void ExecuteJavaScriptForTests(const base::string16& javascript) override; |
| + void ExecuteJavaScriptForTests( |
| + const base::string16& javascript, |
| + const JavaScriptResultCallback& callback) override; |
| + void ExecuteJavaScriptWithUserGestureForTests( |
| + const base::string16& javascript) override; |
| + void AccessibilitySetFocus(int acc_obj_id) override; |
| + void AccessibilityDoDefaultAction(int acc_obj_id) override; |
| + void AccessibilityScrollToMakeVisible(int acc_obj_id, |
| + const gfx::Rect& subfocus) override; |
| + void AccessibilityShowContextMenu(int acc_obj_id) override; |
| + void AccessibilitySetSelection(int anchor_object_id, |
| + int anchor_offset, |
| + int focus_object_id, |
| + int focus_offset) override; |
| + void ActivateFindInPageResultForAccessibility(int request_id) override; |
| + void InsertVisualStateCallback(const VisualStateCallback& callback) override; |
| + RenderViewHost* GetRenderViewHost() override; |
| + ServiceRegistry* GetServiceRegistry() override; |
| + blink::WebPageVisibilityState GetVisibilityState() override; |
| + bool IsRenderFrameLive() override; |
| + int GetProxyCount() override; |
| + void FilesSelectedInChooser( |
| + const std::vector<content::FileChooserFileInfo>& files, |
| + FileChooserParams::Mode permissions) override; |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_PUBLIC_TEST_MOCK_RENDER_FRAME_HOST_H_ |