OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_RENDERER_MOCK_CONTENT_RENDERER_CLIENT_H_ | |
6 #define CONTENT_RENDERER_MOCK_CONTENT_RENDERER_CLIENT_H_ | |
7 #pragma once | |
8 | |
9 #include <string> | |
10 | |
11 #include "base/compiler_specific.h" | |
12 #include "content/public/renderer/content_renderer_client.h" | |
13 | |
14 namespace content { | |
15 | |
16 // Base class for unit tests that need to mock the ContentRendererClient. | |
17 class MockContentRendererClient : public ContentRendererClient { | |
18 public: | |
19 virtual ~MockContentRendererClient(); | |
20 virtual void RenderThreadStarted() OVERRIDE; | |
21 virtual void RenderViewCreated(RenderView* render_view) OVERRIDE; | |
22 virtual void SetNumberOfViews(int number_of_views) OVERRIDE; | |
23 virtual SkBitmap* GetSadPluginBitmap() OVERRIDE; | |
24 virtual std::string GetDefaultEncoding() OVERRIDE; | |
25 virtual bool OverrideCreatePlugin( | |
26 RenderView* render_view, | |
27 WebKit::WebFrame* frame, | |
28 const WebKit::WebPluginParams& params, | |
29 WebKit::WebPlugin** plugin) OVERRIDE; | |
30 virtual WebKit::WebPlugin* CreatePluginReplacement( | |
31 RenderView* render_view, | |
32 const FilePath& plugin_path) OVERRIDE; | |
33 virtual bool HasErrorPage(int http_status_code, | |
34 std::string* error_domain) OVERRIDE; | |
35 virtual void GetNavigationErrorStrings( | |
36 const WebKit::WebURLRequest& failed_request, | |
37 const WebKit::WebURLError& error, | |
38 std::string* error_html, | |
39 string16* error_description) OVERRIDE; | |
40 virtual webkit_media::WebMediaPlayerImpl* OverrideCreateWebMediaPlayer( | |
41 RenderView* render_view, | |
42 WebKit::WebFrame* frame, | |
43 WebKit::WebMediaPlayerClient* client, | |
44 base::WeakPtr<webkit_media::WebMediaPlayerDelegate> delegate, | |
45 media::FilterCollection* collection, | |
46 WebKit::WebAudioSourceProvider* audio_source_provider, | |
47 media::MessageLoopFactory* message_loop_factory, | |
48 webkit_media::MediaStreamClient* media_stream_client, | |
49 media::MediaLog* media_log) OVERRIDE; | |
50 virtual bool RunIdleHandlerWhenWidgetsHidden() OVERRIDE; | |
51 virtual bool AllowPopup(const GURL& creator) OVERRIDE; | |
52 virtual bool ShouldFork(WebKit::WebFrame* frame, | |
53 const GURL& url, | |
54 bool is_initial_navigation, | |
55 bool* send_referrer) OVERRIDE; | |
56 virtual bool WillSendRequest(WebKit::WebFrame* frame, | |
57 const GURL& url, | |
58 GURL* new_url) OVERRIDE; | |
59 virtual bool ShouldPumpEventsDuringCookieMessage() OVERRIDE; | |
60 virtual void DidCreateScriptContext(WebKit::WebFrame* frame, | |
61 v8::Handle<v8::Context> context, | |
62 int extension_group, | |
63 int world_id) OVERRIDE; | |
64 virtual void WillReleaseScriptContext(WebKit::WebFrame* frame, | |
65 v8::Handle<v8::Context> context, | |
66 int world_id) OVERRIDE; | |
67 virtual unsigned long long VisitedLinkHash(const char* canonical_url, | |
68 size_t length) OVERRIDE; | |
69 virtual bool IsLinkVisited(unsigned long long link_hash) OVERRIDE; | |
70 virtual void PrefetchHostName(const char* hostname, size_t length) OVERRIDE; | |
71 virtual bool ShouldOverridePageVisibilityState( | |
72 const RenderView* render_view, | |
73 WebKit::WebPageVisibilityState* override_state) const OVERRIDE; | |
74 virtual bool HandleGetCookieRequest(RenderView* sender, | |
75 const GURL& url, | |
76 const GURL& first_party_for_cookies, | |
77 std::string* cookies) OVERRIDE; | |
78 virtual bool HandleSetCookieRequest(RenderView* sender, | |
79 const GURL& url, | |
80 const GURL& first_party_for_cookies, | |
81 const std::string& value) OVERRIDE; | |
82 virtual void RegisterPPAPIInterfaceFactories( | |
83 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) OVERRIDE; | |
84 }; | |
85 | |
86 } // namespace content | |
87 | |
88 #endif // CONTENT_RENDERER_MOCK_CONTENT_RENDERER_CLIENT_H_ | |
OLD | NEW |