Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / content / renderer / browser_plugin / mock_browser_plugin_manager.h
blob1ec85e34b8b7a07964b2acab20124301ff2da2ff
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.
5 #ifndef CONTENT_RENDERER_BROWSER_PLUGIN_MOCK_BROWSER_PLUGIN_MANAGER_H_
6 #define CONTENT_RENDERER_BROWSER_PLUGIN_MOCK_BROWSER_PLUGIN_MANAGER_H_
8 #include "content/renderer/browser_plugin/browser_plugin_manager.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "ipc/ipc_message_utils.h"
12 #include "ipc/ipc_test_sink.h"
14 namespace content {
16 class MockBrowserPluginManager : public BrowserPluginManager {
17 public:
18 MockBrowserPluginManager(RenderViewImpl* render_view);
20 // BrowserPluginManager implementation.
21 virtual BrowserPlugin* CreateBrowserPlugin(
22 RenderViewImpl* render_view,
23 blink::WebFrame* frame,
24 bool auto_navigate) OVERRIDE;
25 virtual void AllocateInstanceID(
26 const base::WeakPtr<BrowserPlugin>& browser_plugin) OVERRIDE;
28 // Provides access to the messages that have been received by this thread.
29 IPC::TestSink& sink() { return sink_; }
31 // RenderViewObserver override.
32 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
33 virtual bool Send(IPC::Message* msg) OVERRIDE;
34 protected:
35 virtual ~MockBrowserPluginManager();
36 void AllocateInstanceIDACK(BrowserPlugin* browser_plugin,
37 int guest_instance_id);
39 IPC::TestSink sink_;
41 // The last known good deserializer for sync messages.
42 scoped_ptr<IPC::MessageReplyDeserializer> reply_deserializer_;
44 int guest_instance_id_counter_;
46 DISALLOW_COPY_AND_ASSIGN(MockBrowserPluginManager);
49 } // namespace content
51 #endif // CONTENT_RENDERER_BROWSER_PLUGIN_MOCK_BROWSER_PLUGIN_MANAGER_H_